Skip to content

Commit 5956bfb

Browse files
Merge pull request #7539 from jez/patch-1
Allow FormatError to take either String or Gem for source
2 parents 00da18b + 7c1240c commit 5956bfb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/rubygems/package.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FormatError < Error
5959

6060
def initialize(message, source = nil)
6161
if source
62-
@path = source.path
62+
@path = source.is_a?(String) ? source : source.path
6363

6464
message += " in #{path}" if path
6565
end

0 commit comments

Comments
 (0)