diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-07-08 15:32:18 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-07-08 15:36:47 +0200 |
commit | f288806d0223955974096e8360fa5ec7ba6b0d07 (patch) | |
tree | acf96060d5a76e2ba2e3f233e18786ee885fb8ff /Rakefile | |
parent | f38ebff92fb4421ac4dcca752dc9a0047dedfc9f (diff) | |
download | bundler-f288806d0223955974096e8360fa5ec7ba6b0d07.tar.gz |
Remove development dependencies from gemspecremove_add_development_dependency_from_gemspec
And refactor development setup.
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 44 |
1 files changed, 8 insertions, 36 deletions
@@ -3,9 +3,7 @@ $:.unshift File.expand_path("../lib", __FILE__) require "benchmark" -def development_dependencies - @development_dependencies ||= Gem::Specification.load("bundler.gemspec").development_dependencies -end +require_relative "spec/support/rubygems_ext" # Benchmark task execution module Rake @@ -36,17 +34,7 @@ namespace :spec do desc "Ensure spec dependencies are installed" task :deps do - deps = Hash[development_dependencies.map do |d| - [d.name, d.requirement.to_s] - end] - - # JRuby can't build ronn, so we skip that - deps.delete("ronn") if RUBY_ENGINE == "jruby" - - gem_install_command = "install --no-document --conservative " + deps.sort_by {|name, _| name }.map do |name, version| - "'#{name}:#{version}'" - end.join(" ") - sh %(#{Gem.ruby} -S gem #{gem_install_command}) + Spec::Rubygems.dev_setup end namespace :travis do @@ -191,18 +179,10 @@ namespace :man do if RUBY_ENGINE == "jruby" task(:build) {} else - ronn_dep = development_dependencies.find do |dep| - dep.name == "ronn" - end - - ronn_requirement = ronn_dep.requirement.to_s - begin - gem "ronn", ronn_requirement - - require "ronn" - rescue LoadError - task(:build) { abort "We couln't activate ronn (#{ronn_requirement}). Try `gem install ronn:'#{ronn_requirement}'` to be able to build the help pages" } + Spec::Rubygems.gem_require("ronn") + rescue Gem::LoadError => e + task(:build) { abort "We couln't activate ronn (#{e.requirement}). Try `gem install ronn:'#{e.requirement}'` to be able to build the help pages" } else directory "man" @@ -254,18 +234,10 @@ namespace :man do end end -automatiek_dep = development_dependencies.find do |dep| - dep.name == "automatiek" -end - -automatiek_requirement = automatiek_dep.requirement.to_s - begin - gem "automatiek", automatiek_requirement - - require "automatiek" -rescue LoadError - msg = "We couldn't activate automatiek (#{automatiek_requirement}). Try `gem install automatiek:'#{automatiek_requirement}'` to be able to vendor gems" + Spec::Rubygems.gem_require("automatiek") +rescue Gem::LoadError => e + msg = "We couldn't activate automatiek (#{e.requirement}). Try `gem install automatiek:'#{e.requirement}'` to be able to vendor gems" namespace :vendor do desc "Vendor a specific version of molinillo" |