formula_creator: Set version default in constructor
This commit is contained in:
parent
259823cf4d
commit
4e0b589d8c
@ -14,7 +14,7 @@ module Homebrew
|
|||||||
|
|
||||||
def initialize(name, version, fetch=true, head=false)
|
def initialize(name, version, fetch=true, head=false)
|
||||||
@name = name
|
@name = name
|
||||||
@version = version
|
@version = Version.new(version) if version
|
||||||
@fetch = fetch
|
@fetch = fetch
|
||||||
@head = head
|
@head = head
|
||||||
end
|
end
|
||||||
@ -37,11 +37,7 @@ module Homebrew
|
|||||||
@name = path.basename.to_s[/(.*?)[-_.]?#{Regexp.escape(path.version.to_s)}/, 1]
|
@name = path.basename.to_s[/(.*?)[-_.]?#{Regexp.escape(path.version.to_s)}/, 1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@version = if @version
|
@version = Version.detect(url) if @version.nil?
|
||||||
Version.new(@version)
|
|
||||||
else
|
|
||||||
Version.detect(url)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def write_formula!
|
def write_formula!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user