create: detect name from GitHub archives.

This commit is contained in:
Mike McQuaid 2013-10-25 21:06:17 +01:00
parent a999ddc002
commit 90a630dcad

View File

@ -78,9 +78,11 @@ class FormulaCreator
@url = url
path = Pathname.new(url)
if @name.nil?
%r{github.com/\S+/(\S+)/archive/}.match url
@name ||= $1
/(.*?)[-_.]?#{path.version}/.match path.basename
@name = $1
@path = Formula.path $1 unless $1.nil?
@name ||= $1
@path = Formula.path @name unless @name.nil?
else
@path = Formula.path name
end