From 5c5e0ea27f00994f36069a942dbec26708ac056c Mon Sep 17 00:00:00 2001 From: Ian White Date: Fri, 6 Feb 2009 09:18:13 +0000 Subject: [PATCH] Simplify Rakefile, README, etc --- CHANGELOG => History.txt | 0 MIT-LICENSE => License.txt | 0 README.rdoc | 12 +++---- Rakefile | 54 +++++++--------------------- SPECDOC | 59 ------------------------------ TODO => Todo.txt | 0 garlic.rb | 74 +++++++++++++------------------------- 7 files changed, 42 insertions(+), 157 deletions(-) rename CHANGELOG => History.txt (100%) rename MIT-LICENSE => License.txt (100%) delete mode 100644 SPECDOC rename TODO => Todo.txt (100%) diff --git a/CHANGELOG b/History.txt similarity index 100% rename from CHANGELOG rename to History.txt diff --git a/MIT-LICENSE b/License.txt similarity index 100% rename from MIT-LICENSE rename to License.txt diff --git a/README.rdoc b/README.rdoc index 25bb415..6071456 100644 --- a/README.rdoc +++ b/README.rdoc @@ -24,14 +24,12 @@ Example: # will look for views in 'views/bar', then 'views/foo', then 'view/application' end -See Ardes::InheritViews for more details +See InheritViews for more details -=== Specs and Coverage -* {SPECDOC}[link:files/SPECDOC.html] lists the specifications -* {RSpec Report}[link:rspec_report.html] is a report of spec pass/fails -* {RCov Report}[link:coverage/index.html] is the rcov report - -=== Testing +=== Testing & CI RSpec is used for testing, so the tests are in spec/ rather than test/ Do rake --tasks for more details. + +{garlic}[http://github.com/ianwhite/garlic] is used for CI, see garlic.rb for details on +what versions of rails are tested. diff --git a/Rakefile b/Rakefile index e6d8b59..8c47cc4 100644 --- a/Rakefile +++ b/Rakefile @@ -16,40 +16,23 @@ Spec::Rake::SpecTask.new(:spec) do |t| t.spec_opts = ["--colour"] end -namespace :spec do - desc "Generate RCov report for #{plugin_name}" - Spec::Rake::SpecTask.new(:rcov) do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.rcov = true - t.rcov_dir = 'doc/coverage' - t.rcov_opts = ['--text-report', '--exclude', "spec/,rcov.rb,#{File.expand_path(File.join(File.dirname(__FILE__),'../../..'))}"] - end - - namespace :rcov do - desc "Verify RCov threshold for #{plugin_name}" - RCov::VerifyTask.new(:verify => "spec:rcov") do |t| - t.threshold = 100.0 - t.index_html = File.join(File.dirname(__FILE__), 'doc/coverage/index.html') - end - end - - desc "Generate specdoc for #{plugin_name}" - Spec::Rake::SpecTask.new(:doc) do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.spec_opts = ["--format", "specdoc:SPECDOC"] - end +desc "Generate RCov report for #{plugin_name}" +Spec::Rake::SpecTask.new(:rcov) do |t| + t.spec_files = FileList['spec/**/*_spec.rb'] + t.rcov = true + t.rcov_dir = 'doc/coverage' + t.rcov_opts = ['--text-report', '--exclude', "spec/,rcov.rb,#{File.expand_path(File.join(File.dirname(__FILE__),'../../..'))}"] +end - namespace :doc do - desc "Generate html specdoc for #{plugin_name}" - Spec::Rake::SpecTask.new(:html => :rdoc) do |t| - t.spec_files = FileList['spec/**/*_spec.rb'] - t.spec_opts = ["--format", "html:doc/rspec_report.html", "--diff"] - end +namespace :rcov do + desc "Verify RCov threshold for #{plugin_name}" + RCov::VerifyTask.new(:verify => "spec:rcov") do |t| + t.threshold = 100.0 + t.index_html = File.join(File.dirname(__FILE__), 'doc/coverage/index.html') end end task :rdoc => :doc -task "SPECDOC" => "spec:doc" desc "Generate rdoc for #{plugin_name}" Rake::RDocTask.new(:doc) do |t| @@ -58,22 +41,11 @@ Rake::RDocTask.new(:doc) do |t| t.title = "#{plugin_name}" t.template = ENV['RDOC_TEMPLATE'] t.options = ['--line-numbers', '--inline-source'] - t.rdoc_files.include('README.rdoc', 'SPECDOC', 'MIT-LICENSE') + t.rdoc_files.include('README.rdoc', 'History.txt', 'License.txt') t.rdoc_files.include('lib/**/*.rb') end -namespace :doc do - desc "Generate all documentation (rdoc, specdoc, specdoc html and rcov) for #{plugin_name}" - task :all => ["spec:doc:html", "spec:doc", "spec:rcov", "doc"] -end - task :cruise do - # run the garlic task, capture the output, if succesful make the docs and copy them to ardes sh "garlic clean && mkdir -p .garlic && (garlic all > .garlic/report.txt)" - `scp -i ~/.ssh/ardes .garlic/report.txt ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}_garlic_report.txt` - cd ".garlic/2.2-stable/vendor/plugins/#{plugin_name}" do - `rake doc:all` - `scp -i ~/.ssh/ardes -r doc ardes@ardes.com:~/subdomains/plugins/httpdocs/doc/#{plugin_name}` - end puts "The build is GOOD" end \ No newline at end of file diff --git a/SPECDOC b/SPECDOC deleted file mode 100644 index 766cf54..0000000 --- a/SPECDOC +++ /dev/null @@ -1,59 +0,0 @@ - -AController < TestController; inherit_views (the class) -- should be inherit views -- should have inherit view paths == ['a'] - -AController < TestController; inherit_views (an instance) -- should be inherit views -- should have inherit view paths == ['a'] -- GET :in_abc should render a/in_abc -- GET :in_a should render a/in_a -- GET :in_ab should render a/in_ab -- GET :render_non_existent_partial should raise ActionView::TemplateError -- GET :render_non_existent_template should raise ActionView::MissingTemplate - -BController < TestController; inherit_views 'a' (the class) -- should be inherit views -- should have inherit view paths == ['b', 'a'] - -BController < TestController; inherit_views 'a' (an instance) -- should be inherit views -- should have inherit view paths == ['b', 'a'] -- GET :in_first should render a/in_a -- GET :in_ab should render b/in_ab -- GET :in_b should render b/in_b -- GET :in_abc should render b/in_abc -- GET :partial_in_bc should render b/partial_in_bc & b/_partial_in_bc -- GET :partial_in_b should render b/partial_in_b & b/_partial_in_b -- GET :collection_in_bc should render b/collection_in_bc then b/_partial_in_bc - -CController < BController (the class) -- should be inherit views -- should have inherit view paths == ['c', 'b', 'a'] - -CController < BController (an instance) -- should be inherit views -- should have inherit view paths == ['c', 'b', 'a'] -- GET :in_a should render a/in_a -- GET :in_ab should render b/in_ab -- GET :in_b should render b/in_b -- GET :in_abc should render c/in_abc -- GET :in_c should render c/in_c -- GET :partial_in_bc should render b/partial_in_bc then c/_partial_in_bc -- GET :partial_in_b should render b/partial_in_b & b/_partial_in_b -- GET :collection_in_bc should render b/collection_in_bc then c/_partial_in_bc - -DController < AController; inherit_views 'other' (the class) -- should be inherit views -- should have inherit view paths == ['d', 'other', 'a'] - -DController < AController; inherit_views 'other' (an instance) -- should be inherit views -- should have inherit view paths == ['d', 'other', 'a'] - -NormalController -- GET :partial_from_c should render normal/partial_from_c, then c/_partial_in_bc - -Finished in 0.242443 seconds - -37 examples, 0 failures diff --git a/TODO b/Todo.txt similarity index 100% rename from TODO rename to Todo.txt diff --git a/garlic.rb b/garlic.rb index 7073aa4..f2d20c3 100644 --- a/garlic.rb +++ b/garlic.rb @@ -1,58 +1,32 @@ garlic do repo 'inherit_views', :path => '.' - repo 'rails', :url => 'git://github.com/rails/rails' #, :local => "~/dev/vendor/rails" - repo 'rspec', :url => 'git://github.com/dchelimsky/rspec' #, :local => "~/dev/vendor/spec" - repo 'rspec-rails', :url => 'git://github.com/dchelimsky/rspec-rails' #, :local => "~/dev/vendor/spec" - - # these are for testing rails-2.0-2.1 branch - repo 'ianwhite-rspec', :url => 'git://github.com/ianwhite/rspec' #, :local => "~/dev/ianwhite/spec" - repo 'ianwhite-rspec-rails', :url => 'git://github.com/ianwhite/rspec-rails' #, :local => "~/dev/ianwhite/spec" - + repo 'rails', :url => 'git://github.com/rails/rails' + repo 'rspec', :url => 'git://github.com/dchelimsky/rspec' + repo 'rspec-rails', :url => 'git://github.com/dchelimsky/rspec-rails' - # for target, default repo is 'rails', default branch is 'master' - target '2.2-stable', :branch => 'origin/2-2-stable' do - prepare do - plugin 'inherit_views', :branch => 'origin/master', :clone => true - plugin 'ianwhite-rspec', :as => 'rspec' - plugin 'ianwhite-rspec-rails', :as => 'rspec-rails' do - sh "script/generate rspec -f" - end - end - run do - cd "vendor/plugins/inherit_views" do - sh "rake spec:rcov:verify" - end - end - end - - target '2.0-stable', :branch => 'origin/2-0-stable' do - prepare do - plugin 'inherit_views', :branch => 'origin/rails-2.0-2.1', :clone => true - plugin 'ianwhite-rspec', :as => 'rspec' - plugin 'ianwhite-rspec-rails', :as => 'rspec-rails' do - sh "script/generate rspec -f" - end - end - run do - cd "vendor/plugins/inherit_views" do - sh "rake spec" - end - end - end - - target '2.1-stable', :branch => 'origin/2-1-stable' do - prepare do - plugin 'inherit_views', :branch => 'origin/rails-2.0-2.1', :clone => true - plugin 'ianwhite-rspec', :as => 'rspec' - plugin 'ianwhite-rspec-rails', :as => 'rspec-rails' do - sh "script/generate rspec -f" + # first is rails target, last is inherit views branch + [ + {:rails => 'master', :inherit_views => 'rails-2.3'}, + {:rails => '2-2-stable', :inherit_views => 'master'}, + {:rails => '2-1-stable', :inherit_views => 'rails-2.0-2.1'} + #{:rails => '2-0-stable', :inherit_views => 'rails-2.0-2.1'} rspec + raisl 2.0 is not playing nice at the moment + ].each do |target| + + target target[:rails], :branch => "origin/#{target[:rails]}" do + prepare do + plugin 'inherit_views', :branch => "origin/#{target[:inherit_views]}", :clone => true + plugin 'rspec', :as => 'rspec' + plugin 'rspec-rails', :as => 'rspec-rails' do + sh "script/generate rspec -f" + end end - end - run do - cd "vendor/plugins/inherit_views" do - sh "rake spec" + run do + cd "vendor/plugins/inherit_views" do + sh "rake rcov:verify" + end end end + end -end +end \ No newline at end of file