diff options
author | Bundlerbot <bot@bundler.io> | 2019-07-15 18:55:10 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2019-07-15 18:55:10 +0000 |
commit | 36ce7ccf84968d2a7f0eba98c605a5eac8e17e68 (patch) | |
tree | 806ecf4db84886f2b81164ad91de39d7ad7d3968 | |
parent | 53bc81ecdf3e4a94c25a856c3227fb94d76c1769 (diff) | |
parent | 2a7a5daba077b9c626ca75ea0e802914c2e988b0 (diff) | |
download | bundler-36ce7ccf84968d2a7f0eba98c605a5eac8e17e68.tar.gz |
Merge #7239
7239: Fully remove compatibility guard r=deivid-rodriguez a=deivid-rodriguez
### What was the end-user problem that led to this PR?
The problem was that this code is untested and never run.
### What was your diagnosis of the problem?
My diagnosis was that we can remove it.
### What is your fix for the problem, implemented in this PR?
My fix is to remove the code.
### Why did you choose this fix out of the possible options?
I actually intented to remove this in https://github.com/bundler/bundler/pull/6983, but after a discussing it with @simi I decided to keep it (see https://github.com/bundler/bundler/pull/6983#discussion_r259327593). After a second though I think this is safe to remove and that the potential use case (that the latest bundler is allowed to be installed by a really really old rubygems that didn't support ruby version constraints) is not a problem. The `required_ruby_version` constraint landed in [rubygems 0.6, 15 years ago](https://github.com/rubygems/rubygems/commit/240a9d3a3dc7211cad9680ce2579f502e215b519).
Co-authored-by: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | lib/bundler.rb | 2 | ||||
-rw-r--r-- | lib/bundler/compatibility_guard.rb | 9 | ||||
-rw-r--r-- | lib/bundler/inline.rb | 2 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 2 | ||||
-rw-r--r-- | spec/install/bundler_spec.rb | 4 | ||||
-rw-r--r-- | spec/lock/lockfile_spec.rb | 2 | ||||
-rw-r--r-- | spec/other/compatibility_guard_spec.rb | 16 | ||||
-rw-r--r-- | spec/support/hax.rb | 8 |
8 files changed, 2 insertions, 43 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 735750f59d..10dd4f65f9 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_relative "bundler/compatibility_guard" - require_relative "bundler/vendored_fileutils" require "pathname" require "rbconfig" diff --git a/lib/bundler/compatibility_guard.rb b/lib/bundler/compatibility_guard.rb deleted file mode 100644 index eaff1a10d4..0000000000 --- a/lib/bundler/compatibility_guard.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: false - -require_relative "version" - -if Bundler::VERSION.split(".").first.to_i >= 2 - if Gem::Version.new(Object::RUBY_VERSION.dup) < Gem::Version.new("2.3") - abort "Bundler 2 requires Ruby 2.3 or later. Either install bundler 1 or update to a supported Ruby version." - end -end diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index fed31ba4e3..c7c58de52b 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_relative "compatibility_guard" - # Allows for declaring a Gemfile inline in a ruby script, optionally installing # any gems that aren't already installed on the user's system. # diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 614e09f746..5eed3151b3 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require_relative "compatibility_guard" - require "pathname" require "rbconfig" require "rubygems" diff --git a/spec/install/bundler_spec.rb b/spec/install/bundler_spec.rb index 85b1fdcfbb..8741a5e771 100644 --- a/spec/install/bundler_spec.rb +++ b/spec/install/bundler_spec.rb @@ -134,7 +134,7 @@ RSpec.describe "bundle install" do simulate_bundler_version "99999999.99.1" - bundle! "check", :env => { "BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD" => "1" } + bundle! "check" expect(out).to include("The Gemfile's dependencies are satisfied") end @@ -147,7 +147,7 @@ RSpec.describe "bundle install" do simulate_bundler_version "99999999.99.1" - bundle! "check", :env => { "BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD" => "1" } + bundle! "check" expect(out).to include("The Gemfile's dependencies are satisfied") end diff --git a/spec/lock/lockfile_spec.rb b/spec/lock/lockfile_spec.rb index ae858f51cd..e32bb83b3d 100644 --- a/spec/lock/lockfile_spec.rb +++ b/spec/lock/lockfile_spec.rb @@ -3,8 +3,6 @@ RSpec.describe "the lockfile format" do include Bundler::GemHelpers - before { ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] = "TRUE" } - it "generates a simple lockfile for a single source, gem" do install_gemfile <<-G source "#{file_uri_for(gem_repo1)}" diff --git a/spec/other/compatibility_guard_spec.rb b/spec/other/compatibility_guard_spec.rb deleted file mode 100644 index c72842eab5..0000000000 --- a/spec/other/compatibility_guard_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -RSpec.describe "bundler compatibility guard" do - context "when the bundler version is 2+" do - before { simulate_bundler_version "2.0.a" } - - context "when running on Ruby < 2.3", :ruby => "< 2.3" do - before { simulate_rubygems_version "2.6.11" } - - it "raises a friendly error" do - bundle :version - expect(err).to eq("Bundler 2 requires Ruby 2.3 or later. Either install bundler 1 or update to a supported Ruby version.") - end - end - end -end diff --git a/spec/support/hax.rb b/spec/support/hax.rb index 826fbbcc0f..74daccc9db 100644 --- a/spec/support/hax.rb +++ b/spec/support/hax.rb @@ -59,11 +59,3 @@ class Object end end end - -if ENV["BUNDLER_SPEC_IGNORE_COMPATIBILITY_GUARD"] - $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard.rb", __FILE__) - $LOADED_FEATURES << File.expand_path("../../../bundler/compatibility_guard", __FILE__) - $LOADED_FEATURES << "bundler/compatibility_guard.rb" - $LOADED_FEATURES << "bundler/compatibility_guard" - require "bundler/compatibility_guard" -end |