summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/specification_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/specification_command.rb')
-rw-r--r--lib/rubygems/commands/specification_command.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rubygems/commands/specification_command.rb b/lib/rubygems/commands/specification_command.rb
index 5cdf5966d2..6025660498 100644
--- a/lib/rubygems/commands/specification_command.rb
+++ b/lib/rubygems/commands/specification_command.rb
@@ -106,7 +106,11 @@ Specific fields in the specification can be extracted in YAML format:
if local?
if File.exist? gem
- specs << Gem::Package.new(gem).spec rescue nil
+ begin
+ specs << Gem::Package.new(gem).spec
+ rescue
+ nil
+ end
end
if specs.empty?