summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-08-02 10:08:03 +0000
committerBundlerbot <bot@bundler.io>2019-08-02 10:08:03 +0000
commite1c518363641208429f397170354054b3d28effd (patch)
tree81f8db8d6bf8839aab783e734d8770c993beb40b
parentd7808eae1b1a06e1e3a7be53d99830df2605bb9f (diff)
parent5215ae7fa35f673130552371d81d25f4918357e7 (diff)
downloadbundler-e1c518363641208429f397170354054b3d28effd.tar.gz
Merge #7267
7267: Use RbConfig::CONFIG directly instead of Gem::ConfigMap. r=deivid-rodriguez a=hsbt ### What was the end-user problem that led to this PR? When we try to remove `Gem::ConfigMap` on rubygems repository, It breaks the bundler examples. https://github.com/rubygems/rubygems/pull/2848#issuecomment-515726585 ### What was your diagnosis of the problem? Gem::ConfigMap is compatibility code for the old Ruby like 1.8/1.9. ### What is your fix for the problem, implemented in this PR? Use RbConfig instead of `Gem::ConfigMap` directly. It was always provided after the Ruby 2.x. Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/rubygems_integration.rb4
-rw-r--r--spec/support/path.rb5
3 files changed, 4 insertions, 7 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 10dd4f65f9..1887457c77 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -150,7 +150,7 @@ module Bundler
end
def ruby_scope
- "#{Bundler.rubygems.ruby_engine}/#{Bundler.rubygems.config_map[:ruby_version]}"
+ "#{Bundler.rubygems.ruby_engine}/#{RbConfig::CONFIG["ruby_version"]}"
end
def user_home
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index dcf0007ca2..7549c592f1 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -213,10 +213,6 @@ module Bundler
Gem::MARSHAL_SPEC_DIR
end
- def config_map
- Gem::ConfigMap
- end
-
def clear_paths
Gem.clear_paths
end
diff --git a/spec/support/path.rb b/spec/support/path.rb
index ca05ef5e3b..aa06a3f047 100644
--- a/spec/support/path.rb
+++ b/spec/support/path.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "pathname"
+require "rbconfig"
module Spec
module Path
@@ -32,7 +33,7 @@ module Spec
if Bundler::VERSION.split(".").first.to_i < 3
system_gem_path(*path)
else
- bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), Gem::ConfigMap[:ruby_version], *path].compact)
+ bundled_app(*[".bundle", ENV.fetch("BUNDLER_SPEC_RUBY_ENGINE", Gem.ruby_engine), RbConfig::CONFIG["ruby_version"], *path].compact)
end
end
@@ -51,7 +52,7 @@ module Spec
end
def vendored_gems(path = nil)
- bundled_app(*["vendor/bundle", Gem.ruby_engine, Gem::ConfigMap[:ruby_version], path].compact)
+ bundled_app(*["vendor/bundle", Gem.ruby_engine, RbConfig::CONFIG["ruby_version"], path].compact)
end
def cached_gem(path)