diff --git a/lib/bundler/bundler.gemspec b/lib/bundler/bundler.gemspec index 741e5726bb..5ffd717ea6 100644 --- a/lib/bundler/bundler.gemspec +++ b/lib/bundler/bundler.gemspec @@ -34,13 +34,6 @@ Gem::Specification.new do |s| s.required_ruby_version = ">= 2.3.0" s.required_rubygems_version = ">= 2.5.2" - s.add_development_dependency "automatiek", "~> 0.1.0" - s.add_development_dependency "rake", "~> 12.0" - s.add_development_dependency "ronn", "~> 0.7.3" - s.add_development_dependency "rspec", "~> 3.6" - s.add_development_dependency "rubocop", "= 0.72.0" - s.add_development_dependency "rubocop-performance", "= 1.4.0" - # s.files = Dir.glob("{lib,exe}/**/*", File::FNM_DOTMATCH).reject {|f| File.directory?(f) } # we don't check in man pages, but we need to ship them because diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index 1a2588f30a..f7482260e4 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -1,11 +1,20 @@ # frozen_string_literal: true require "rubygems/user_interaction" -require "support/path" +require_relative "path" require "fileutils" module Spec module Rubygems + DEV_DEPS = { + "automatiek" => "~> 0.1.0", + "rake" => "~> 12.0", + "ronn" => "~> 0.7.3", + "rspec" => "~> 3.6", + "rubocop" => "= 0.72.0", + "rubocop-performance" => "= 1.4.0", + }.freeze + DEPS = { # artifice doesn't support rack 2.x now. "rack" => "< 2.0", @@ -17,9 +26,33 @@ module Spec "rake" => "12.3.2", "builder" => "~> 3.2", # ruby-graphviz is used by the viz tests - "ruby-graphviz" => nil, + "ruby-graphviz" => ">= 0.a", }.freeze + def self.dev_setup + deps = DEV_DEPS + + # JRuby can't build ronn, so we skip that + deps.delete("ronn") if RUBY_ENGINE == "jruby" + + install_gems(deps) + end + + def self.gem_load(gem_name, bin_container) + gem_activate(gem_name) + load Gem.bin_path(gem_name, bin_container) + end + + def self.gem_activate(gem_name) + gem_requirement = DEV_DEPS[gem_name] + gem gem_name, gem_requirement + end + + def self.gem_require(gem_name) + gem_activate(gem_name) + require gem_name + end + def self.setup Gem.clear_paths