diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-07-08 15:32:18 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-08-03 09:30:00 +0900 |
commit | 452516f50f80e3bbb6dc9911dcdb133a2e16c170 (patch) | |
tree | 3881244c03aaf98a523d447c1c2c4143ecba5e27 /spec | |
parent | 7255f55dba83aacbde76184aff965162e339ba2a (diff) | |
download | ruby-452516f50f80e3bbb6dc9911dcdb133a2e16c170.tar.gz |
[bundler/bundler] Remove development dependencies from gemspec
And refactor development setup.
https://github.com/bundler/bundler/commit/f288806d02
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/support/rubygems_ext.rb | 37 |
1 files changed, 35 insertions, 2 deletions
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 |