Skip to content

Commit db571b7

Browse files
Merge pull request #7539 from jez/patch-1
Allow FormatError to take either String or Gem for source (cherry picked from commit 5956bfb)
1 parent a9168e2 commit db571b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)