summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-27 12:06:53 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-04-27 12:06:53 +0200
commit671c78db49ee2157e1996f1a9b9e36d97a96b3ae (patch)
tree8ae0c992a5b42a940a388ed1a4be626c74e7c1f9
parent29d856f40b6b5cdbac7ef060dd0a0137e35ba0ac (diff)
downloadbundler-671c78db49ee2157e1996f1a9b9e36d97a96b3ae.tar.gz
Remove rubygems pre 1.4 compatibility code
-rw-r--r--lib/bundler/rubygems_ext.rb17
-rw-r--r--lib/bundler/rubygems_integration.rb10
2 files changed, 0 insertions, 27 deletions
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index df8646a2bb..0e414637fc 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -136,26 +136,9 @@ module Gem
end
out
end
-
- # Backport of performance enhancement added to RubyGems 1.4
- def matches_spec?(spec)
- # name can be a Regexp, so use ===
- return false unless name === spec.name
- return true if requirement.none?
-
- requirement.satisfied_by?(spec.version)
- end unless allocate.respond_to?(:matches_spec?)
end
class Requirement
- # Backport of performance enhancement added to RubyGems 1.4
- def none?
- # note that it might be tempting to replace with with RubyGems 2.0's
- # improved implementation. Don't. It requires `DefaultRequirement` to be
- # defined, and more importantantly, these overrides are not used when the
- # running RubyGems defines these methods
- to_s == ">= 0"
- end unless allocate.respond_to?(:none?)
# Backport of performance enhancement added to RubyGems 2.2
def exact?
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 81bac3540e..ea9d25b192 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -463,16 +463,6 @@ module Bundler
Gem.clear_paths
end
- # This backports the correct segment generation code from RubyGems 1.4+
- # by monkeypatching it into the method in RubyGems 1.3.6 and 1.3.7.
- def backport_segment_generation
- redefine_method(Gem::Version, :segments) do
- @segments ||= @version.scan(/[0-9]+|[a-z]+/i).map do |s|
- /^\d+$/ =~ s ? s.to_i : s
- end
- end
- end
-
# This backport fixes the marshaling of @segments.
def backport_yaml_initialize
redefine_method(Gem::Version, :yaml_initialize) do |_, map|