Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 2497 Bytes
1 | namespace :radiant do |
2 | namespace :extensions do |
3 | namespace :<%= file_name %> do |
4 | |
5 | desc "Runs the migration of the <%= extension_name %> extension" |
6 | task :migrate => :environment do |
7 | require 'radiant/extension_migrator' |
8 | if ENV["VERSION"] |
9 | <%= class_name %>.migrator.migrate(ENV["VERSION"].to_i) |
10 | Rake::Task['db:schema:dump'].invoke |
11 | else |
12 | <%= class_name %>.migrator.migrate |
13 | Rake::Task['db:schema:dump'].invoke |
14 | end |
15 | end |
16 | |
17 | desc "Copies public assets of the <%= extension_name %> to the instance public/ directory." |
18 | task :update => :environment do |
19 | is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) } |
20 | puts "Copying assets from <%= class_name %>" |
21 | Dir[<%= class_name %>.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file| |
22 | path = file.sub(<%= class_name %>.root, '') |
23 | directory = File.dirname(path) |
24 | mkdir_p RAILS_ROOT + directory, :verbose => false |
25 | cp file, RAILS_ROOT + path, :verbose => false |
26 | end |
27 | unless <%= class_name %>.root.starts_with? RAILS_ROOT # don't need to copy vendored tasks |
28 | puts "Copying rake tasks from <%= class_name %>" |
29 | local_tasks_path = File.join(RAILS_ROOT, %w(lib tasks)) |
30 | mkdir_p local_tasks_path, :verbose => false |
31 | Dir[File.join <%= class_name %>.root, %w(lib tasks *.rake)].each do |file| |
32 | cp file, local_tasks_path, :verbose => false |
33 | end |
34 | end |
35 | end |
36 | |
37 | desc "Syncs all available translations for this ext to the English ext master" |
38 | task :sync => :environment do |
39 | # The main translation root, basically where English is kept |
40 | language_root = <%= class_name %>.root + "/config/locales" |
41 | words = TranslationSupport.get_translation_keys(language_root) |
42 | |
43 | Dir["#{language_root}/*.yml"].each do |filename| |
44 | next if filename.match('_available_tags') |
45 | basename = File.basename(filename, '.yml') |
46 | puts "Syncing #{basename}" |
47 | (comments, other) = TranslationSupport.read_file(filename, basename) |
48 | words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist |
49 | other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml |
50 | TranslationSupport.write_file(filename, basename, comments, other) |
51 | end |
52 | end |
53 | end |
54 | end |
55 | end |