Rakefile in uricp-0.0.15 vs Rakefile in uricp-0.0.16
- old
+ new
@@ -1,22 +1,22 @@
def dump_load_path
puts $LOAD_PATH.join("\n")
found = nil
$LOAD_PATH.each do |path|
- if File.exists?(File.join(path,"rspec"))
- puts "Found rspec in #{path}"
- if File.exists?(File.join(path,"rspec","core"))
- puts "Found core"
- if File.exists?(File.join(path,"rspec","core","rake_task"))
- puts "Found rake_task"
- found = path
- else
- puts "!! no rake_task"
- end
+ next unless File.exist?(File.join(path, 'rspec'))
+
+ puts "Found rspec in #{path}"
+ if File.exist?(File.join(path, 'rspec', 'core'))
+ puts 'Found core'
+ if File.exist?(File.join(path, 'rspec', 'core', 'rake_task'))
+ puts 'Found rake_task'
+ found = path
else
- puts "!!! no core"
+ puts '!! no rake_task'
end
+ else
+ puts '!!! no core'
end
end
if found.nil?
puts "Didn't find rspec/core/rake_task anywhere"
else
@@ -24,33 +24,20 @@
end
end
require 'bundler'
require 'rake/clean'
-begin
-require 'rspec/core/rake_task'
-rescue LoadError
-dump_load_path
-raise
-end
-
require 'cucumber'
require 'cucumber/rake/task'
gem 'rdoc' # we need the installed RDoc gem, not the system one
require 'rdoc/task'
include Rake::DSL
Bundler::GemHelper.install_tasks
-
-RSpec::Core::RakeTask.new do |t|
- # Put spec opts in a file named .rspec in root
-end
-
-
-CUKE_RESULTS = 'results.html'
+CUKE_RESULTS = 'results.html'.freeze
CLEAN << CUKE_RESULTS
namespace(:features) do
Cucumber::Rake::Task.new(:new_qemu) do |t|
t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty --no-source -x"
t.fork = false
@@ -62,25 +49,21 @@
t.profile = 'old-qemu-image'
end
task(:clean) do
if ENV['ORBIT_USER'] && ENV['ORBIT_KEY']
- %w{temp_dlo test_upload}.each do |test_file|
- sh "swift --quiet --insecure -A #{ENV['ORBIT_URL'] || "https://orbit.gb1.brightbox.com/v1"} -U #{ENV['ORBIT_USER']} -K #{ENV['ORBIT_KEY']} delete #{test_file}" do |ok, res|
- if !ok
- puts "Delete failed: #{res.exitstatus}"
- end
+ %w[temp_dlo test_upload].each do |test_file|
+ sh "swift --quiet --insecure -A #{ENV['ORBIT_URL'] || 'https://orbit.gb1.brightbox.com/v1'} -U #{ENV['ORBIT_USER']} -K #{ENV['ORBIT_KEY']} delete #{test_file}" do |ok, res|
+ puts "Delete failed: #{res.exitstatus}" unless ok
end
end
end
end
end
Rake::RDocTask.new do |rd|
-
- rd.main = "README.rdoc"
-
- rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
+ rd.main = 'README.rdoc'
+
+ rd.rdoc_files.include('README.rdoc', 'lib/**/*.rb', 'bin/**/*')
end
-task :default => [:spec,"features:new_qemu"]
-
+task default: [:spec, 'features:new_qemu']