diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-08-11 23:01:21 -0300 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-08-17 23:43:22 -0400 |
commit | d759b899fc8d062c4b7682817536a068d3224731 (patch) | |
tree | 37e2cf8521620497149d5f057c1073d6feb61551 | |
parent | 10fb9743f55354ceb72e445fed67b16555d879a2 (diff) | |
download | bundler-d759b899fc8d062c4b7682817536a068d3224731.tar.gz |
Update supported versions according to https://github.com/bundler/bundler/issues/5789
-rw-r--r-- | lib/bundler.rb | 1 | ||||
-rw-r--r-- | lib/bundler/compatibility_guard.rb | 10 | ||||
-rw-r--r-- | lib/bundler/inline.rb | 1 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 1 | ||||
-rw-r--r-- | spec/other/compatibility_guard_spec.rb | 6 |
5 files changed, 11 insertions, 8 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index a587f1e430..e4b9313401 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/compatibility_guard" require "bundler/vendored_fileutils" diff --git a/lib/bundler/compatibility_guard.rb b/lib/bundler/compatibility_guard.rb index 6e40a119d1..8904d014f5 100644 --- a/lib/bundler/compatibility_guard.rb +++ b/lib/bundler/compatibility_guard.rb @@ -1,14 +1,14 @@ -# frozen_string_literal: true +# frozen_string_literal: false require "rubygems" require "bundler/version" if Bundler::VERSION.split(".").first.to_i >= 2 - if Gem::Version.new(Object::RUBY_VERSION) < Gem::Version.new("2.0.0") - abort "Bundler 2 requires Ruby 2+. Either install bundler 1 or update to a supported Ruby version." + if Gem::Version.new(Object::RUBY_VERSION) < 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 - if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.0.0") - abort "Bundler 2 requires RubyGems 2+. Either install bundler 1 or update to a supported RubyGems version." + if Gem::Version.new(Gem::VERSION.dup) < Gem::Version.new("2.5") + abort "Bundler 2 requires RubyGems 2.5 or later. Either install bundler 1 or update to a supported RubyGems version." end end diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index f5e3a8c157..9d25f3261a 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/compatibility_guard" # Allows for declaring a Gemfile inline in a ruby script, optionally installing diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index bc4c1c1d88..ce3286cc28 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true + require "bundler/compatibility_guard" require "pathname" diff --git a/spec/other/compatibility_guard_spec.rb b/spec/other/compatibility_guard_spec.rb index abe70741a1..8f458b18e5 100644 --- a/spec/other/compatibility_guard_spec.rb +++ b/spec/other/compatibility_guard_spec.rb @@ -4,10 +4,10 @@ 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", :ruby => "< 2.a" do + context "when running on Ruby < 2", :ruby => "< 2.3" do it "raises a friendly error" do bundle :version - expect(err).to eq("Bundler 2 requires Ruby 2+. Either install bundler 1 or update to a supported Ruby 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 @@ -16,7 +16,7 @@ RSpec.describe "bundler compatibility guard" do it "raises a friendly error" do bundle :version - expect(err).to eq("Bundler 2 requires RubyGems 2+. Either install bundler 1 or update to a supported RubyGems version.") + expect(err).to eq("Bundler 2 requires RubyGems 2.5 or later. Either install bundler 1 or update to a supported RubyGems version.") end end end |