diff options
| author | Adam Vandenberg | 2012-03-09 10:18:12 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-09 18:44:48 -0800 |
| commit | 04088ba96dfcc91eb74a3903e9ca1c951fa11511 (patch) | |
| tree | 27fb6254831a8549b5110e32f20c855cf403ebee | |
| parent | 275d22db9ea3f2a260864793009edc8ddfacb1e3 (diff) | |
| download | brew-04088ba96dfcc91eb74a3903e9ca1c951fa11511.tar.bz2 | |
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.
| -rw-r--r-- | Library/Homebrew/formula.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 676e997d6..742b5e53a 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -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' @@ -41,19 +40,21 @@ class Formula end raise "No url provided for formula #{name}" if @url.nil? - @name=name + @name = name validate_variable :name # 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 } - @downloader=download_strategy.new @spec_to_use.url, name, version, @spec_to_use.specs + @downloader = download_strategy.new @spec_to_use.url, name, version, @spec_to_use.specs end # if the dir is there, but it's empty we consider it not installed |
