diff options
author | Charles Oliver Nutter <headius@headius.com> | 2014-02-21 23:20:08 -0600 |
---|---|---|
committer | Charles Oliver Nutter <headius@headius.com> | 2014-02-21 23:20:08 -0600 |
commit | bc9c7b5fc122f51286b505e9dcee966db6bc3d69 (patch) | |
tree | c702ebf43669c1ee5101d6e56d202ae5f8e13119 | |
parent | bb8f694147cb07cd820297978b0378ffa4c6d54b (diff) | |
download | bundler-bc9c7b5fc122f51286b505e9dcee966db6bc3d69.tar.gz |
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.
-rw-r--r-- | Rakefile | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 |