1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Fix bundle info not indicating a gem which has been deleted, unlike bundle show

Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>

https://github.com/rubygems/rubygems/commit/2851b40ffb
This commit is contained in:
DEVRAJ KUMAR 2020-04-11 03:50:19 +05:30 committed by Hiroshi SHIBATA
parent f0ae5ac313
commit 9139acca66
Notes: git 2020-06-05 07:33:53 +09:00
2 changed files with 15 additions and 3 deletions

View file

@ -40,10 +40,13 @@ module Bundler
end
def print_gem_path(spec)
path = if spec.name == "bundler"
File.expand_path("../../../..", __FILE__)
if spec.name == "bundler"
path = File.expand_path("../../../..", __FILE__)
else
spec.full_gem_path
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}"
end
end
Bundler.ui.info path

View file

@ -41,6 +41,15 @@ RSpec.describe "bundle info" do
expect(err).to eq("Could not find gem 'missing'.")
end
it "warns if path no longer exists on disk" do
FileUtils.rm_rf(default_bundle_path("gems", "rails-2.3.2"))
bundle "info rails --path"
expect(err).to match(/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
it "prints information about the default gem" do
bundle! "info rdoc"