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:
- 4851 Bytes
1 | begin |
2 | require 'jeweler' |
3 | Jeweler::Tasks.new do |gem| |
4 | gem.name = "radiant-<%= file_name %>-extension" |
5 | gem.summary = %Q{<%= class_name.titleize %> for Radiant CMS} |
6 | gem.description = %Q{Describe your extension here} |
7 | gem.email = "<%= author_email %>" |
8 | gem.homepage = "<%= homepage %>" |
9 | gem.authors = ["<%= author_name %>"] |
10 | # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings |
11 | end |
12 | rescue LoadError |
13 | puts "Jeweler (or a dependency) not available. This is only required if you plan to package <%= file_name %> as a gem." |
14 | end |
15 | |
16 | # In rails 1.2, plugins aren't available in the path until they're loaded. |
17 | # Check to see if the rspec plugin is installed first and require |
18 | # it if it is. If not, use the gem version. |
19 | |
20 | # Determine where the RSpec plugin is by loading the boot |
21 | unless defined? RADIANT_ROOT |
22 | ENV["RAILS_ENV"] = "test" |
23 | case |
24 | when ENV["RADIANT_ENV_FILE"] |
25 | require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot" |
26 | when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions} |
27 | require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot" |
28 | else |
29 | require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot" |
30 | end |
31 | end |
32 | |
33 | require 'rake' |
34 | require 'rake/rdoctask' |
35 | require 'rake/testtask' |
36 | |
37 | rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib') |
38 | $LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base) |
39 | require 'spec/rake/spectask' |
40 | require 'cucumber' |
41 | require 'cucumber/rake/task' |
42 | |
43 | # Cleanup the RADIANT_ROOT constant so specs will load the environment |
44 | Object.send(:remove_const, :RADIANT_ROOT) |
45 | |
46 | extension_root = File.expand_path(File.dirname(__FILE__)) |
47 | |
48 | task :default => :spec |
49 | task :stats => "spec:statsetup" |
50 | |
51 | desc "Run all specs in spec directory" |
52 | Spec::Rake::SpecTask.new(:spec) do |t| |
53 | t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] |
54 | t.spec_files = FileList['spec/**/*_spec.rb'] |
55 | end |
56 | |
57 | task :features => 'spec:integration' |
58 | |
59 | namespace :spec do |
60 | desc "Run all specs in spec directory with RCov" |
61 | Spec::Rake::SpecTask.new(:rcov) do |t| |
62 | t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] |
63 | t.spec_files = FileList['spec/**/*_spec.rb'] |
64 | t.rcov = true |
65 | t.rcov_opts = ['--exclude', 'spec', '--rails'] |
66 | end |
67 | |
68 | desc "Print Specdoc for all specs" |
69 | Spec::Rake::SpecTask.new(:doc) do |t| |
70 | t.spec_opts = ["--format", "specdoc", "--dry-run"] |
71 | t.spec_files = FileList['spec/**/*_spec.rb'] |
72 | end |
73 | |
74 | [:models, :controllers, :views, :helpers].each do |sub| |
75 | desc "Run the specs under spec/#{sub}" |
76 | Spec::Rake::SpecTask.new(sub) do |t| |
77 | t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""] |
78 | t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"] |
79 | end |
80 | end |
81 | |
82 | desc "Run the Cucumber features" |
83 | Cucumber::Rake::Task.new(:integration) do |t| |
84 | t.fork = true |
85 | t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'pretty')] |
86 | # t.feature_pattern = "#{extension_root}/features/**/*.feature" |
87 | t.profile = "default" |
88 | end |
89 | |
90 | # Setup specs for stats |
91 | task :statsetup do |
92 | require 'code_statistics' |
93 | ::STATS_DIRECTORIES << %w(Model\ specs spec/models) |
94 | ::STATS_DIRECTORIES << %w(View\ specs spec/views) |
95 | ::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers) |
96 | ::STATS_DIRECTORIES << %w(Helper\ specs spec/views) |
97 | ::CodeStatistics::TEST_TYPES << "Model specs" |
98 | ::CodeStatistics::TEST_TYPES << "View specs" |
99 | ::CodeStatistics::TEST_TYPES << "Controller specs" |
100 | ::CodeStatistics::TEST_TYPES << "Helper specs" |
101 | ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/} |
102 | end |
103 | |
104 | namespace :db do |
105 | namespace :fixtures do |
106 | desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y" |
107 | task :load => :environment do |
108 | require 'active_record/fixtures' |
109 | ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym) |
110 | (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file| |
111 | Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*')) |
112 | end |
113 | end |
114 | end |
115 | end |
116 | end |
117 | |
118 | desc 'Generate documentation for the <%= file_name %> extension.' |
119 | Rake::RDocTask.new(:rdoc) do |rdoc| |
120 | rdoc.rdoc_dir = 'rdoc' |
121 | rdoc.title = '<%= class_name %>' |
122 | rdoc.options << '--line-numbers' << '--inline-source' |
123 | rdoc.rdoc_files.include('README') |
124 | rdoc.rdoc_files.include('lib/**/*.rb') |
125 | end |
126 | |
127 | # For extensions that are in transition |
128 | desc 'Test the <%= file_name %> extension.' |
129 | Rake::TestTask.new(:test) do |t| |
130 | t.libs << 'lib' |
131 | t.pattern = 'test/**/*_test.rb' |
132 | t.verbose = true |
133 | end |
134 | |
135 | # Load any custom rakefiles for extension |
136 | Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f } |