From 107532a5e3ef1cb8a098d6160933a612ac2fc3da Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Wed, 19 Jun 2024 14:28:19 +0900 Subject: [PATCH] Hide patchlevel from lockfile --- bundler/lib/bundler/ruby_version.rb | 4 +--- bundler/spec/bundler/ruby_version_spec.rb | 10 ++-------- bundler/spec/install/gemfile/ruby_spec.rb | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/bundler/lib/bundler/ruby_version.rb b/bundler/lib/bundler/ruby_version.rb index 0ed5cbc6cacf..7f60dde4768d 100644 --- a/bundler/lib/bundler/ruby_version.rb +++ b/bundler/lib/bundler/ruby_version.rb @@ -43,7 +43,6 @@ def initialize(versions, patchlevel, engine, engine_version) def to_s(versions = self.versions) output = String.new("ruby #{versions_string(versions)}") - output << "p#{patchlevel}" if patchlevel && patchlevel != "-1" output << " (#{engine} #{versions_string(engine_versions)})" unless engine == "ruby" output @@ -72,8 +71,7 @@ def single_version_string def ==(other) versions == other.versions && engine == other.engine && - engine_versions == other.engine_versions && - patchlevel == other.patchlevel + engine_versions == other.engine_versions end def host diff --git a/bundler/spec/bundler/ruby_version_spec.rb b/bundler/spec/bundler/ruby_version_spec.rb index 39d0571361ef..b96893cefe8c 100644 --- a/bundler/spec/bundler/ruby_version_spec.rb +++ b/bundler/spec/bundler/ruby_version_spec.rb @@ -100,7 +100,7 @@ describe "#to_s" do it "should return info string with the ruby version, patchlevel, engine, and engine version" do - expect(subject.to_s).to eq("ruby 2.0.0p645 (jruby 2.0.1)") + expect(subject.to_s).to eq("ruby 2.0.0 (jruby 2.0.1)") end context "no patchlevel" do @@ -115,7 +115,7 @@ let(:engine) { "ruby" } it "should return info string with the ruby version and patchlevel" do - expect(subject.to_s).to eq("ruby 2.0.0p645") + expect(subject.to_s).to eq("ruby 2.0.0") end end @@ -149,12 +149,6 @@ it_behaves_like "two ruby versions are not equal" end - context "the patchlevels do not match" do - let(:other_patchlevel) { "21" } - - it_behaves_like "two ruby versions are not equal" - end - context "the engines do not match" do let(:other_engine) { "ruby" } diff --git a/bundler/spec/install/gemfile/ruby_spec.rb b/bundler/spec/install/gemfile/ruby_spec.rb index 3e15d82bbe25..313babc81d75 100644 --- a/bundler/spec/install/gemfile/ruby_spec.rb +++ b/bundler/spec/install/gemfile/ruby_spec.rb @@ -83,7 +83,7 @@ def locked_ruby_version myrack RUBY VERSION - ruby 2.1.4p422 + ruby 2.1.4 BUNDLED WITH #{Bundler::VERSION}