Rakefile in vacuum_cleaner-1.0.0 vs Rakefile in vacuum_cleaner-1.0.1
- old
+ new
@@ -1,10 +1,10 @@
require 'rake'
require 'rake/testtask'
+$: << File.join(File.dirname(__FILE__), 'lib')
+require 'vacuum_cleaner'
-require File.join(File.dirname(__FILE__), 'lib', 'vacuum_cleaner')
-
begin
require 'yard'
desc 'Generate documentation for vacuum_cleaner. (requires yard)'
YARD::Rake::YardocTask.new(:doc) do |t|
t.files = ['lib/**/*.rb']
@@ -33,11 +33,11 @@
gemspec.extra_rdoc_files = %w{README.md}
gemspec.add_development_dependency('shoulda', '>= 2.10.2')
gemspec.add_development_dependency('activesupport', '>= 2.3.5')
- gemspec.files.reject! { |file| file =~ /\.gemspec$/ } # kinda redundant
+ gemspec.files.reject! { |file| file =~ /\.gemspec$/ || file =~ /\.png$/ || file =~ /\.watcher_example+$/} # do not include gemspec + png files
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
end
@@ -62,11 +62,23 @@
t.libs << 'test'
t.pattern = 'test/integration/**/*_test.rb'
t.verbose = true
end
+ desc 'Run both the integration and unit tests'
task :all => [:'test:unit', :'test:integration']
+
+ desc 'Run test with supplied rakes like RAKES=jrake,rake19,rake'
+ task :portability do |t|
+ raise "No RAKES specified e.g. add RAKES=rake,rake19" unless ENV['RAKES']
+ ENV['RAKES'].split(/[,;\s]\s*/).each do |rake_cmd|
+ puts
+ puts " * * * runing `#{rake_cmd} test:all`"
+ puts
+ system("#{rake_cmd} test:all")
+ end
+ end
end
namespace :metrics do
desc 'Report all metrics, i.e. stats and code coverage.'
task :all => [:stats, :coverage]
@@ -83,10 +95,10 @@
desc 'Report code coverage to HTML (doc/coverage) and shell (requires rcov).'
task :coverage do |t|
rm_f "doc/coverage"
mkdir_p "doc/coverage"
- rcov = %(rcov -Ilib:test --exclude '\/gems\/' -o doc/coverage -T test/unit/vacuum_cleaner/*_test.rb -T test/unit/vacuum_cleaner/*/*_test.rb)
+ rcov = %(rcov -Ilib:test --exclude '\/gems\/' -o doc/coverage -T test/integration/*_test.rb -T test/unit/vacuum_cleaner/*_test.rb -T test/unit/vacuum_cleaner/*/*_test.rb)
system rcov
end
desc 'Report the fishy smell of bad code (requires reek)'
task :smelly do |t|