diff options
| author | Xu Cheng | 2015-07-30 15:53:03 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-07-31 19:44:01 +0800 |
| commit | 5aa6b5c5faa605d3dfd39ce86803c3d967093d06 (patch) | |
| tree | e0012c8cd399dcc01db6b6434dc095d4a26ce886 | |
| parent | 78442232d0be41c0cc42866d24113bbab25f836c (diff) | |
| download | brew-5aa6b5c5faa605d3dfd39ce86803c3d967093d06.tar.bz2 | |
Formula#pkg_version: return the result based on current active_spec
| -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 f508c96dc..a273e3c1c 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -67,9 +67,6 @@ class Formula # @see #active_spec attr_reader :active_spec_sym - # The {PkgVersion} for this formula with version and {#revision} information. - attr_reader :pkg_version - # Used for creating new Homebrew versions of software without new upstream # versions. # @see .revision @@ -118,7 +115,6 @@ class Formula :stable end validate_attributes! - @pkg_version = PkgVersion.new(version, revision) @build = active_spec.build @pin = FormulaPin.new(self) end @@ -207,6 +203,11 @@ class Formula active_spec.version end + # The {PkgVersion} for this formula with {version} and {#revision} information. + def pkg_version + PkgVersion.new(version, revision) + end + # A named Resource for the currently active {SoftwareSpec}. def resource(name) active_spec.resource(name) |
