summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-04-09 02:33:44 +0000
committerBundlerbot <bot@bundler.io>2019-04-09 02:33:44 +0000
commit23772391d5f15835b1a540a4bd5ce16aac7ecc98 (patch)
tree5d852efd23027ece0a711577a73110522e020f7c
parentf827947b48c9265bb0d5d4cfe77cc5e9aad3d0c6 (diff)
parent455c33f3df88b5e975c85e66760dbb233c3642ac (diff)
downloadbundler-23772391d5f15835b1a540a4bd5ce16aac7ecc98.tar.gz
Merge #7110
7110: Cleanup old rubies stuff r=hsbt a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that there was still some code specific for old rubies in our code base. ### What is your fix for the problem, implemented in this PR? My fix is to remove that code. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
-rw-r--r--doc/contributing/BUG_TRIAGE.md2
-rw-r--r--lib/bundler/compact_index_client/updater.rb6
-rw-r--r--lib/bundler/rubygems_ext.rb12
-rw-r--r--lib/bundler/settings.rb14
-rw-r--r--lib/bundler/shared_helpers.rb14
-rw-r--r--lib/bundler/version.rb5
-rw-r--r--lib/bundler/yaml_serializer.rb1
-rw-r--r--spec/install/gemfile/git_spec.rb2
-rw-r--r--spec/install/gemfile/platform_spec.rb3
-rw-r--r--spec/support/artifice/compact_index.rb6
10 files changed, 8 insertions, 57 deletions
diff --git a/doc/contributing/BUG_TRIAGE.md b/doc/contributing/BUG_TRIAGE.md
index 69aa3df0fd..fab584c7be 100644
--- a/doc/contributing/BUG_TRIAGE.md
+++ b/doc/contributing/BUG_TRIAGE.md
@@ -14,7 +14,7 @@ When you're looking at a ticket, here are the main questions to ask:
* Are the steps to reproduce the bug clearly documented in the ticket?
* Which versions of Bundler (1.1.x, 1.2.x, git, etc.) manifest this bug?
* Which operating systems (OS X, Windows, Ubuntu, CentOS, etc.) manifest this bug?
- * Which rubies (MRI, JRuby, Rubinius, etc.) and which versions (1.8.7, 1.9.3, etc.) have this bug?
+ * Which rubies (MRI, JRuby, Rubinius, etc.) and which versions (2.5, 2.6, etc.) have this bug?
Strategies for triaging a ticket:
* Be sure to ask the user to output the entirety of their `bundle env`. Sometimes users forget to post all of their `bundle env` output in the issue.
diff --git a/lib/bundler/compact_index_client/updater.rb b/lib/bundler/compact_index_client/updater.rb
index 4d6eb80044..d77285072c 100644
--- a/lib/bundler/compact_index_client/updater.rb
+++ b/lib/bundler/compact_index_client/updater.rb
@@ -95,11 +95,7 @@ module Bundler
end
def slice_body(body, range)
- if body.respond_to?(:byteslice)
- body.byteslice(range)
- else # pre-1.9.3
- body.unpack("@#{range.first}a#{range.end + 1}").first
- end
+ body.byteslice(range)
end
def checksum_for_file(path)
diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb
index b6837443a2..ccf71c8c00 100644
--- a/lib/bundler/rubygems_ext.rb
+++ b/lib/bundler/rubygems_ext.rb
@@ -2,11 +2,6 @@
require "pathname"
-if defined?(Gem::QuickLoader)
- # Gem Prelude makes me a sad panda :'(
- Gem::QuickLoader.load_full_rubygems_library
-end
-
require "rubygems/specification"
begin
@@ -26,7 +21,7 @@ module Gem
class Specification
attr_accessor :remote, :location, :relative_loaded_from
- if instance_methods(false).map(&:to_sym).include?(:source)
+ if instance_methods(false).include?(:source)
remove_method :source
attr_writer :source
def source
@@ -86,10 +81,7 @@ module Gem
end
end
- # RubyGems 1.8+ used only.
- methods = instance_methods(false)
- gem_dir = methods.first.is_a?(String) ? "gem_dir" : :gem_dir
- remove_method :gem_dir if methods.include?(gem_dir)
+ remove_method :gem_dir if instance_methods(false).include?(:gem_dir)
def gem_dir
full_gem_path
end
diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb
index bf709f712b..7a14a86ea5 100644
--- a/lib/bundler/settings.rb
+++ b/lib/bundler/settings.rb
@@ -395,20 +395,6 @@ module Bundler
Pathname.new(@root).join("config") if @root
end
- CONFIG_REGEX = %r{ # rubocop:disable Style/RegexpLiteral
- ^
- (BUNDLE_.+):\s # the key
- (?: !\s)? # optional exclamation mark found with ruby 1.9.3
- (['"]?) # optional opening quote
- (.* # contents of the value
- (?: # optionally, up until the next key
- (\n(?!BUNDLE).+)*
- )
- )
- \2 # matching closing quote
- $
- }xo.freeze
-
def load_config(config_file)
return {} if !config_file || ignore_config?
SharedHelpers.filesystem_access(config_file, :read) do |file|
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index 0f4f54dced..5d9e1c24e7 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -11,17 +11,6 @@ require "bundler/constants"
require "bundler/rubygems_integration"
require "bundler/current_ruby"
-module Gem
- class Dependency
- # This is only needed for RubyGems < 1.4
- unless method_defined? :requirement
- def requirement
- version_requirements
- end
- end
- end
-end
-
module Bundler
module SharedHelpers
def root
@@ -349,9 +338,6 @@ module Bundler
end
def clean_load_path
- # handle 1.9 where system gems are always on the load path
- return unless defined?(::Gem)
-
bundler_lib = bundler_ruby_lib
loaded_gem_paths = Bundler.rubygems.loaded_gem_paths
diff --git a/lib/bundler/version.rb b/lib/bundler/version.rb
index ba6312a5cd..cfd6300950 100644
--- a/lib/bundler/version.rb
+++ b/lib/bundler/version.rb
@@ -1,13 +1,10 @@
# frozen_string_literal: false
-# Ruby 1.9.3 and old RubyGems don't play nice with frozen version strings
-# rubocop:disable MutableConstant
-
module Bundler
# We're doing this because we might write tests that deal
# with other versions of bundler and we are unsure how to
# handle this better.
- VERSION = "2.1.0.pre.1" unless defined?(::Bundler::VERSION)
+ VERSION = "2.1.0.pre.1".freeze unless defined?(::Bundler::VERSION)
def self.overwrite_loaded_gem_version
begin
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb
index c9ab5a4907..374b3bb5e3 100644
--- a/lib/bundler/yaml_serializer.rb
+++ b/lib/bundler/yaml_serializer.rb
@@ -40,7 +40,6 @@ module Bundler
(.+) # key
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
[ ]?
- (?: !\s)? # optional exclamation mark found with ruby 1.9.3
(['"]?) # optional opening quote
(.*) # value
\3 # matching closing quote
diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb
index f017290441..4636c8de08 100644
--- a/spec/install/gemfile/git_spec.rb
+++ b/spec/install/gemfile/git_spec.rb
@@ -725,7 +725,7 @@ RSpec.describe "bundle install with git sources" do
build_lib "bar", :path => lib_path("foo/bar"), :gemspec => false do |s|
s.write lib_path("foo/bar/lib/version.rb"), %(BAR_VERSION = '1.0')
s.write "bar.gemspec", <<-G
- $:.unshift Dir.pwd # For 1.9
+ $:.unshift Dir.pwd
require 'lib/version'
Gem::Specification.new do |s|
s.name = 'bar'
diff --git a/spec/install/gemfile/platform_spec.rb b/spec/install/gemfile/platform_spec.rb
index 1c7dcb2ec2..7757a3c7c4 100644
--- a/spec/install/gemfile/platform_spec.rb
+++ b/spec/install/gemfile/platform_spec.rb
@@ -265,8 +265,7 @@ RSpec.describe "bundle install across platforms" do
bundle! :install, forgotten_command_line_options(:path => "vendor/bundle")
- new_version = Gem::ConfigMap[:ruby_version] == "1.8" ? "1.9.1" : "1.8"
- FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, new_version))
+ FileUtils.mv(vendored_gems, bundled_app("vendor/bundle", Gem.ruby_engine, "1.8"))
bundle! :install
expect(vendored_gems("gems/rack-1.0.0")).to exist
diff --git a/spec/support/artifice/compact_index.rb b/spec/support/artifice/compact_index.rb
index f97c2b3fbc..4f01690ae4 100644
--- a/spec/support/artifice/compact_index.rb
+++ b/spec/support/artifice/compact_index.rb
@@ -57,11 +57,7 @@ class CompactIndexAPI < Endpoint
end
def slice_body(body, range)
- if body.respond_to?(:byteslice)
- body.byteslice(range)
- else # pre-1.9.3
- body.unpack("@#{range.first}a#{range.end + 1}").first
- end
+ body.byteslice(range)
end
def gems(gem_repo = GEM_REPO)