diff options
author | David RodrÃguez <[email protected]> | 2023-12-12 21:21:35 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-12-14 20:22:48 +0800 |
commit | 5cf6f7f8859a0418bbbe2b608a88557d4f06e098 (patch) | |
tree | a9ff0931b28bb64ab072680ba208f90b3fa22c59 /lib | |
parent | 7564038864bcf7c3cfb2f602e318e9beae17b2f7 (diff) |
[rubygems/rubygems] Remove more methods now defined in all RubyGems versions
https://github.com/rubygems/rubygems/commit/e015200ffa
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/fetcher.rb | 2 | ||||
-rw-r--r-- | lib/bundler/installer.rb | 6 | ||||
-rw-r--r-- | lib/bundler/plugin.rb | 4 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 34 | ||||
-rw-r--r-- | lib/bundler/runtime.rb | 2 |
5 files changed, 7 insertions, 41 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index c9c8d1b6d6..42bd2c0984 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -113,7 +113,7 @@ module Bundler uri = Bundler::URI.parse("#{remote_uri}#{Gem::MARSHAL_SPEC_DIR}#{spec_file_name}.rz") spec = if uri.scheme == "file" - path = Bundler.rubygems.correct_for_windows_path(uri.path) + path = Gem::Util.correct_for_windows_path(uri.path) Bundler.safe_load_marshal Bundler.rubygems.inflate(Gem.read_binary(path)) elsif cached_spec_path = gemspec_cached_path(spec_file_name) Bundler.load_gemspec(cached_spec_path) diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb index c38b0e48ed..e837f732cf 100644 --- a/lib/bundler/installer.rb +++ b/lib/bundler/installer.rb @@ -214,7 +214,7 @@ module Bundler end def load_plugins - Bundler.rubygems.load_plugins + Gem.load_plugins requested_path_gems = @definition.requested_specs.select {|s| s.source.is_a?(Source::Path) } path_plugin_files = requested_path_gems.map do |spec| @@ -223,8 +223,8 @@ module Bundler error_message = "#{spec.name} #{spec.version} has an invalid gemspec" raise Gem::InvalidSpecificationException, error_message end.flatten - Bundler.rubygems.load_plugin_files(path_plugin_files) - Bundler.rubygems.load_env_plugins + Gem.load_plugin_files(path_plugin_files) + Gem.load_env_plugins end def ensure_specs_are_compatible! diff --git a/lib/bundler/plugin.rb b/lib/bundler/plugin.rb index 6da9882990..588fa79be8 100644 --- a/lib/bundler/plugin.rb +++ b/lib/bundler/plugin.rb @@ -307,7 +307,7 @@ module Bundler @hooks_by_event = Hash.new {|h, k| h[k] = [] } load_paths = spec.load_paths - Bundler.rubygems.add_to_load_path(load_paths) + Gem.add_to_load_path(*load_paths) path = Pathname.new spec.full_gem_path begin @@ -342,7 +342,7 @@ module Bundler # done to avoid conflicts path = index.plugin_path(name) - Bundler.rubygems.add_to_load_path(index.load_paths(name)) + Gem.add_to_load_path(*index.load_paths(name)) load path.join(PLUGIN_FILE_NAME) diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 5158e7a044..0793fe1d40 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -43,18 +43,6 @@ module Bundler Gem.loaded_specs[name] end - def add_to_load_path(paths) - return Gem.add_to_load_path(*paths) if Gem.respond_to?(:add_to_load_path) - - if insert_index = Gem.load_path_insert_index - # Gem directories must come after -I and ENV['RUBYLIB'] - $LOAD_PATH.insert(insert_index, *paths) - else - # We are probably testing in core, -I and RUBYLIB don't apply - $LOAD_PATH.unshift(*paths) - end - end - def mark_loaded(spec) if spec.respond_to?(:activated=) current = Gem.loaded_specs[spec.name] @@ -116,16 +104,6 @@ module Bundler Gem::Util.inflate(obj) end - def correct_for_windows_path(path) - if Gem::Util.respond_to?(:correct_for_windows_path) - Gem::Util.correct_for_windows_path(path) - elsif path[0].chr == "/" && path[1].chr =~ /[a-z]/i && path[2].chr == ":" - path[1..-1] - else - path - end - end - def gem_dir Gem.dir end @@ -183,18 +161,6 @@ module Bundler loaded_gem_paths.flatten end - def load_plugins - Gem.load_plugins if Gem.respond_to?(:load_plugins) - end - - def load_plugin_files(files) - Gem.load_plugin_files(files) if Gem.respond_to?(:load_plugin_files) - end - - def load_env_plugins - Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins) - end - def ui=(obj) Gem::DefaultUserInteraction.ui = obj end diff --git a/lib/bundler/runtime.rb b/lib/bundler/runtime.rb index 045f29c5ad..993f1082c3 100644 --- a/lib/bundler/runtime.rb +++ b/lib/bundler/runtime.rb @@ -28,7 +28,7 @@ module Bundler spec.load_paths.reject {|path| $LOAD_PATH.include?(path) } end.reverse.flatten - Bundler.rubygems.add_to_load_path(load_paths) + Gem.add_to_load_path(*load_paths) setup_manpath |