[rubygems/rubygems] Fixed malformed lockfile version on installing

https://github.com/rubygems/rubygems/commit/c969a192bf
This commit is contained in:
Imir Kiyamov 2023-08-27 21:45:57 +04:00 committed by git
parent b0ec1db8a7
commit 23eb13d49d
2 changed files with 9 additions and 0 deletions

View File

@ -170,6 +170,8 @@ module Bundler
parsed_version = Bundler::LockfileParser.bundled_with
@lockfile_version = parsed_version ? Gem::Version.new(parsed_version) : nil
rescue ArgumentError
@lockfile_version = nil
end
def restart_version

View File

@ -129,6 +129,13 @@ RSpec.describe "Self management", :rubygems => ">= 3.3.0.dev", :realworld => tru
expect(out).to eq(Bundler::VERSION[0] == "2" ? "Bundler version #{Bundler::VERSION}" : Bundler::VERSION)
end
it "ignores malformed lockfile version" do
lockfile_bundled_with("2.3.")
bundle "install --verbose"
expect(out).to include("Using bundler #{Bundler::VERSION}")
end
private
def lockfile_bundled_with(version)