add Formula#pinned_version

This commit is contained in:
Xu Cheng 2015-11-16 19:23:48 +08:00
parent b3f0b28025
commit 02d7abe2ec
2 changed files with 9 additions and 0 deletions

View File

@ -936,6 +936,11 @@ class Formula
@pin.pinned?
end
# @private
def pinned_version
@pin.pinned_version
end
# @private
def pin
@pin.pin

View File

@ -33,4 +33,8 @@ class FormulaPin
def pinnable?
@f.rack.exist? && @f.rack.subdirs.length > 0
end
def pinned_version
Keg.new(path.resolved_path).version if pinned?
end
end