From bc9c7b5fc122f51286b505e9dcee966db6bc3d69 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Fri, 21 Feb 2014 23:20:08 -0600 Subject: Avoid installing C exts on JRuby to allow running specs. This patch does the following: * Omits rdiscount and ronn from deps to be installed when running on JRuby, since they're only needed for release tasks. * Removes an unnecessary require of ronn. * Rewrites release tasks to warn that ronn is required if it cannot be loaded. The result is that JRuby can run both spec:deps and spec targets, bringing us closer to getting specs green on JRuby. --- Rakefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index aa63fffe..c2fbe0c0 100644 --- a/Rakefile +++ b/Rakefile @@ -30,7 +30,11 @@ end namespace :spec do desc "Ensure spec dependencies are installed" task :deps do - {"rdiscount" => "~> 1.6", "ronn" => "~> 0.7.3", "rspec" => "~> 3.0.beta"}.each do |name, version| + deps = RUBY_ENGINE == 'jruby' ? + {"rspec" => "~> 3.0.beta"} : + {"rdiscount" => "~> 1.6", "ronn" => "~> 0.7.3", "rspec" => "~> 3.0.beta"} + + deps.each do |name, version| sh "#{Gem.ruby} -S gem list -i '^#{name}$' -v '#{version}' || " \ "#{Gem.ruby} -S gem install #{name} -v '#{version}' --no-ri --no-rdoc" end @@ -62,11 +66,10 @@ end begin # running the specs needs both rspec and ronn require 'rspec/core/rake_task' - require 'ronn' desc "Run specs" RSpec::Core::RakeTask.new do |t| - t.rspec_opts = %w(-fs --color) + t.rspec_opts = %w(-f documentation --color) t.ruby_opts = %w(-w) end task :spec => "man:build" @@ -224,8 +227,8 @@ begin rescue LoadError namespace :man do - task(:build) { abort "Install the ronn gem to be able to release!" } - task(:clean) { abort "Install the ronn gem to be able to release!" } + task(:build) { warn "Install the ronn gem to be able to release!" } + task(:clean) { warn "Install the ronn gem to be able to release!" } end end -- cgit v1.2.3