[前][次][番号順一覧][スレッド一覧]

ruby-changes:68384

From: David <ko1@a...>
Date: Mon, 11 Oct 2021 19:13:29 +0900 (JST)
Subject: [ruby-changes:68384] 607efe9154 (master): [rubygems/rubygems] Show the exact name of the gem that was deleted

https://git.ruby-lang.org/ruby.git/commit/?id=607efe9154

From 607efe91540057ef0ca3be4a829869df018ee94a Mon Sep 17 00:00:00 2001
From: David Rodriguez <deivid.rodriguez@r...>
Date: Sat, 9 Oct 2021 11:28:05 +0200
Subject: [rubygems/rubygems] Show the exact name of the gem that was deleted

If a non exact name (matched as a regexp) is passed to `bundle info`,
these strings might not match.

https://github.com/rubygems/rubygems/commit/831edf1edf
---
 lib/bundler/cli/info.rb            | 5 +++--
 spec/bundler/commands/info_spec.rb | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/bundler/cli/info.rb b/lib/bundler/cli/info.rb
index 3111b64a33..bf0f85d3eb 100644
--- a/lib/bundler/cli/info.rb
+++ b/lib/bundler/cli/info.rb
@@ -40,12 +40,13 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/cli/info.rb#L40
     end
 
     def print_gem_path(spec)
-      if spec.name == "bundler"
+      name = spec.name
+      if name == "bundler"
         path = File.expand_path("../../../..", __FILE__)
       else
         path = spec.full_gem_path
         unless File.directory?(path)
-          return Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at: #{path}"
+          return Bundler.ui.warn "The gem #{name} has been deleted. It was installed at: #{path}"
         end
       end
 
diff --git a/spec/bundler/commands/info_spec.rb b/spec/bundler/commands/info_spec.rb
index 186bb2a657..29cac94057 100644
--- a/spec/bundler/commands/info_spec.rb
+++ b/spec/bundler/commands/info_spec.rb
@@ -62,6 +62,10 @@ RSpec.describe "bundle info" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/commands/info_spec.rb#L62
 
       expect(err).to match(/The gem rails has been deleted/i)
       expect(err).to match(default_bundle_path("gems", "rails-2.3.2").to_s)
+
+      bundle "info rail --path"
+      expect(err).to match(/The gem rails has been deleted/i)
+      expect(err).to match(default_bundle_path("gems", "rails-2.3.2").to_s)
     end
 
     context "given a default gem shippped in ruby", :ruby_repo do
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]