diff options
| author | Xu Cheng | 2015-07-30 16:25:21 +0800 | 
|---|---|---|
| committer | Xu Cheng | 2015-07-31 19:44:02 +0800 | 
| commit | 21eecbf1d6cfa162b50bf0fc2dd4aed259c5d3c2 (patch) | |
| tree | faedc15a4a79fdc098646be8d928244bef4d2053 /Library/Homebrew/formula.rb | |
| parent | 03facd85546c2f32ec0127e55306dffcde2f3897 (diff) | |
| download | brew-21eecbf1d6cfa162b50bf0fc2dd4aed259c5d3c2.tar.bz2 | |
Formula: add set_acitve_spec method
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 134b4045f..bc698b717 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -119,6 +119,16 @@ class Formula      @pin = FormulaPin.new(self)    end +  # @private +  def set_active_spec(spec_sym) +    spec = send(spec_sym) +    raise FormulaSpecificationError, "#{spec_sym} spec is not available for #{full_name}" unless spec +    @active_spec = spec +    @active_spec_sym = spec_sym +    validate_attributes! +    @build = active_spec.build +  end +    private    def set_spec(name)  | 
