Do a stricter version check
A version should always be set when going through the constructor so tighten this check. Also do some style clean ups here.
This commit is contained in:
parent
275d22db9e
commit
04088ba96d
@ -24,7 +24,6 @@ class Formula
|
||||
set_instance_variable 'bottle_sha1'
|
||||
set_instance_variable 'head'
|
||||
set_instance_variable 'specs'
|
||||
|
||||
set_instance_variable 'standard'
|
||||
set_instance_variable 'unstable'
|
||||
|
||||
@ -47,9 +46,11 @@ class Formula
|
||||
# If we got an explicit path, use that, else determine from the name
|
||||
@path = path.nil? ? self.class.path(name) : Pathname.new(path)
|
||||
|
||||
# Use a provided version, if any
|
||||
set_instance_variable 'version'
|
||||
# Otherwise detect the version from the URL
|
||||
@version ||= @spec_to_use.detect_version
|
||||
validate_variable :version if @version
|
||||
validate_variable :version
|
||||
|
||||
CHECKSUM_TYPES.each { |type| set_instance_variable type }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user