summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-27 12:08:23 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-27 12:08:23 +0200
commit4038f317881da37fc4ae6cfbe11d7d473aeef09e (patch)
tree4748c711c3ce8c5ffb554f55a0c2ec57aa266ba3
parent35876b08bc3746fe98baf5b0b7f2c056d9c17548 (diff)
downloadbundler-4038f317881da37fc4ae6cfbe11d7d473aeef09e.tar.gz
Remove rubygems pre 2.2 compatibility code
-rw-r--r--lib/bundler/rubygems_ext.rb19
-rw-r--r--lib/bundler/rubygems_integration.rb12
2 files changed, 3 insertions, 28 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index 0e414637fc..96b93836c7 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -44,15 +44,7 @@ module Gem
end
def load_paths
- return full_require_paths if respond_to?(:full_require_paths)
-
- require_paths.map do |require_path|
- if require_path.include?(full_gem_path)
- require_path
- else
- File.join(full_gem_path, require_path)
- end
- end
+ full_require_paths
end
if method_defined?(:extension_dir)
@@ -138,15 +130,6 @@ module Gem
end
end
- class Requirement
-
- # Backport of performance enhancement added to RubyGems 2.2
- def exact?
- return false unless @requirements.size == 1
- @requirements[0][0] == "="
- end unless allocate.respond_to?(:exact?)
- end
-
class Platform
JAVA = Gem::Platform.new("java") unless defined?(JAVA)
MSWIN = Gem::Platform.new("mswin32") unless defined?(MSWIN)
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 4ecec39af2..5763a630fa 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -213,16 +213,8 @@ module Bundler
end
def loaded_gem_paths
- # RubyGems 2.2+ can put binary extension into dedicated folders,
- # therefore use RubyGems facilities to obtain their load paths.
- if Gem::Specification.method_defined? :full_require_paths
- loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths }
- loaded_gem_paths.flatten
- else
- $LOAD_PATH.select do |p|
- Bundler.rubygems.gem_path.any? {|gp| p =~ /^#{Regexp.escape(gp)}/ }
- end
- end
+ loaded_gem_paths = Gem.loaded_specs.map {|_, s| s.full_require_paths }
+ loaded_gem_paths.flatten
end
def load_plugins