create: path.version may be nil

Fixes https://github.com/Homebrew/homebrew-core/issues/3067.
This commit is contained in:
Xu Cheng 2016-07-18 00:03:56 +08:00
parent 092d4712a1
commit b6772c1fde
No known key found for this signature in database
GPG Key ID: C2A3860FA0B459CE

View File

@ -110,8 +110,7 @@ class FormulaCreator
when %r{github\.com/\S+/(\S+)/archive/}
@name = $1
else
/(.*?)[-_.]?#{Regexp.escape(path.version)}/.match path.basename
@name = $1
@name = path.basename.to_s[/(.*?)[-_.]?#{Regexp.escape(path.version.to_s)}/, 1]
end
end
update_path