Rakefile in resque-scheduler-1.9.9 vs Rakefile in resque-scheduler-1.9.10
- old
+ new
@@ -1,13 +1,41 @@
-require 'bundler'
-Bundler::GemHelper.install_tasks
+require 'bundler/gem_tasks'
$LOAD_PATH.unshift 'lib'
task :default => :test
-desc "Run tests"
+desc 'Run tests'
task :test do
+ if RUBY_VERSION =~ /^1\.8/
+ unless ENV['SEED']
+ srand
+ ENV['SEED'] = (srand % 0xFFFF).to_s
+ end
+
+ $stdout.puts "Running with SEED=#{ENV['SEED']}"
+ srand Integer(ENV['SEED'])
+ elsif ENV['SEED']
+ ARGV += %W(--seed #{ENV['SEED']})
+ end
Dir['test/*_test.rb'].each do |f|
require File.expand_path(f)
end
+end
+
+desc 'Run rubocop'
+task :rubocop do
+ unless RUBY_VERSION < '1.9'
+ sh('rubocop --config .rubocop.yml --format simple') { |r, _| r || abort }
+ end
+end
+
+begin
+ require 'rdoc/task'
+
+ Rake::RDocTask.new do |rd|
+ rd.main = 'README.md'
+ rd.rdoc_files.include('README.md', 'lib/**/*.rb')
+ rd.rdoc_dir = 'doc'
+ end
+rescue LoadError
end