Skip to content

Commit

Permalink
Simplify Rakefile, README, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwhite committed Feb 6, 2009
1 parent a367b83 commit 5c5e0ea
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 157 deletions.
File renamed without changes.
File renamed without changes.
12 changes: 5 additions & 7 deletions README.rdoc
Expand Up @@ -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 <tt>spec/</tt> rather than
<tt>test/</tt> 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.
54 changes: 13 additions & 41 deletions Rakefile
Expand Up @@ -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|
Expand All @@ -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
59 changes: 0 additions & 59 deletions SPECDOC

This file was deleted.

File renamed without changes.
74 changes: 24 additions & 50 deletions 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

0 comments on commit 5c5e0ea

Please sign in to comment.