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:
- 3692 Bytes
1 | require 'rake/testtask' |
2 | |
3 | namespace :db do |
4 | namespace :migrate do |
5 | desc "Run all Radiant extension migrations" |
6 | task :extensions => :environment do |
7 | require 'radiant/extension_migrator' |
8 | Radiant::ExtensionMigrator.migrate_extensions |
9 | Rake::Task['db:schema:dump'].invoke |
10 | end |
11 | end |
12 | namespace :remigrate do |
13 | desc "Migrate down and back up all Radiant extension migrations" |
14 | task :extensions => :environment do |
15 | require 'highline/import' |
16 | if agree("This task will destroy any data stored by extensions in the database. Are you sure you want to \ncontinue? [yn] ") |
17 | require 'radiant/extension_migrator' |
18 | Radiant::Extension.descendants.each {|ext| ext.migrator.migrate(0) } |
19 | Rake::Task['db:migrate:extensions'].invoke |
20 | Rake::Task['db:schema:dump'].invoke |
21 | end |
22 | end |
23 | end |
24 | end |
25 | |
26 | namespace :test do |
27 | desc "Runs tests on all available Radiant extensions, pass EXT=extension_name to test a single extension" |
28 | task :extensions => "db:test:prepare" do |
29 | extension_roots = Radiant::Extension.descendants.map(&:root) |
30 | if ENV["EXT"] |
31 | extension_roots = extension_roots.select {|x| /\/(\d+_)?#{ENV["EXT"]}$/ === x } |
32 | if extension_roots.empty? |
33 | puts "Sorry, that extension is not installed." |
34 | end |
35 | end |
36 | extension_roots.each do |directory| |
37 | if File.directory?(File.join(directory, 'test')) |
38 | chdir directory do |
39 | if RUBY_PLATFORM =~ /win32/ |
40 | system "rake.cmd test RADIANT_ENV_FILE=#{RAILS_ROOT}/config/environment" |
41 | else |
42 | system "rake test RADIANT_ENV_FILE=#{RAILS_ROOT}/config/environment" |
43 | end |
44 | end |
45 | end |
46 | end |
47 | end |
48 | end |
49 | |
50 | namespace :spec do |
51 | desc "Runs specs on all available Radiant extensions, pass EXT=extension_name to test a single extension" |
52 | task :extensions => "db:test:prepare" do |
53 | extension_roots = Radiant::Extension.descendants.map(&:root) |
54 | if ENV["EXT"] |
55 | extension_roots = extension_roots.select {|x| /\/(\d+_)?#{ENV["EXT"]}$/ === x } |
56 | if extension_roots.empty? |
57 | puts "Sorry, that extension is not installed." |
58 | end |
59 | end |
60 | extension_roots.each do |directory| |
61 | if File.directory?(File.join(directory, 'spec')) |
62 | chdir directory do |
63 | if RUBY_PLATFORM =~ /win32/ |
64 | system "rake.cmd spec RADIANT_ENV_FILE=#{RAILS_ROOT}/config/environment" |
65 | else |
66 | system "rake spec RADIANT_ENV_FILE=#{RAILS_ROOT}/config/environment" |
67 | end |
68 | end |
69 | end |
70 | end |
71 | end |
72 | end |
73 | |
74 | namespace :radiant do |
75 | # TODO: load previously copied tasks just once. |
76 | # If update_all is run multiple times, previously copied tasks will be loaded twice, |
77 | # once from the local copy (RAILS_ROOT/lib/tasks) and once from the gem source. |
78 | task :extensions => :environment do |
79 | Radiant::ExtensionLoader.instance.extensions.each do |extension| |
80 | next if extension.root.starts_with? RAILS_ROOT |
81 | Dir[File.join extension.root, %w(lib tasks *.rake)].sort.each { |task| load task } |
82 | end |
83 | end |
84 | namespace :extensions do |
85 | desc "Runs update asset task for all extensions" |
86 | task :update_all => [:environment, 'radiant:extensions'] do |
87 | extension_names = Radiant::ExtensionLoader.instance.extensions.map { |f| f.to_s.underscore.sub(/_extension$/, '') } |
88 | extension_update_tasks = extension_names.map { |n| "radiant:extensions:#{n}:update" }.select { |t| Rake::Task.task_defined?(t) } |
89 | extension_update_tasks.each {|t| Rake::Task[t].invoke } |
90 | end |
91 | end |
92 | end |
93 | |
94 | # Load any custom rakefiles from extensions |
95 | [RAILS_ROOT, RADIANT_ROOT].uniq.each do |root| |
96 | Dir[root + '/vendor/extensions/*/lib/tasks/*.rake'].sort.each { |ext| load ext } |
97 | end |