diff options
author | Bundlerbot <bot@bundler.io> | 2020-01-17 11:14:32 +0000 |
---|---|---|
committer | Bundlerbot <bot@bundler.io> | 2020-01-17 11:14:32 +0000 |
commit | 3d4abdd0f69f919476ea5410e9cc90214ce052f4 (patch) | |
tree | d0f6571a84b5d10b0a3c70fa4727f0f2c1cb6339 | |
parent | dfb128fc09e5239c3b226d4f818cd1484ae29145 (diff) | |
parent | 394cd143f007e03db70d72c353bf5d3752139b21 (diff) | |
download | bundler-3d4abdd0f69f919476ea5410e9cc90214ce052f4.tar.gz |
Merge #7559
7559: Reactivate usused code for ruby version resolution r=deivid-rodriguez a=larskanis
The code was changed in commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 so that RubyVersion.system was no longer respected. This is reactivated now and specs are adjusted accordingly.
### What was the end-user problem that led to this PR?
Not known.
### What was your diagnosis of the problem?
I read the bundler source code and noticed this.
### What is your fix for the problem, implemented in this PR?
My fix re-adds the ruby version as it was before commit 38b0e7ed64c3ca1c40f43c5aa9a1ead2f6cd7049 , since it seems to be a mistake.
### Why did you choose this fix out of the possible options?
As a alternative I added #7558 that removes the code in question.
Co-authored-by: Lars Kanis <kanis@comcard.de>
-rw-r--r-- | lib/bundler/definition.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/resolving_spec.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3e5186039a..efd7618194 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -860,8 +860,8 @@ module Bundler @metadata_dependencies ||= begin ruby_versions = concat_ruby_version_requirements(@ruby_version) if ruby_versions.empty? || !@ruby_version.exact? - concat_ruby_version_requirements(RubyVersion.system) - concat_ruby_version_requirements(locked_ruby_version_object) unless @unlock[:ruby] + concat_ruby_version_requirements(RubyVersion.system, ruby_versions) + concat_ruby_version_requirements(locked_ruby_version_object, ruby_versions) unless @unlock[:ruby] end [ Dependency.new("Ruby\0", ruby_versions), diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index fc2936b28c..d0448ca30b 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -219,7 +219,7 @@ RSpec.describe "bundle install with install-time dependencies" do describe "with a < requirement" do let(:ruby_requirement) { %("< 5000") } - let(:error_message_requirement) { "< 5000" } + let(:error_message_requirement) { Gem::Requirement.new(["< 5000", "= #{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"]).to_s } it_behaves_like "ruby version conflicts" end @@ -227,7 +227,7 @@ RSpec.describe "bundle install with install-time dependencies" do describe "with a compound requirement" do let(:reqs) { ["> 0.1", "< 5000"] } let(:ruby_requirement) { reqs.map(&:dump).join(", ") } - let(:error_message_requirement) { Gem::Requirement.new(reqs).to_s } + let(:error_message_requirement) { Gem::Requirement.new(reqs + ["= #{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"]).to_s } it_behaves_like "ruby version conflicts" end |