aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-10-03 16:12:19 +0200
committerMarkus Reiter2016-10-04 14:45:11 +0200
commit23dec587fd26c606e459e72b2987e73bc910a095 (patch)
tree269faef30d682247c26d2e6afdd2fc41ece2f138 /Library/Homebrew/tap.rb
parentcafe1497808ef1ddb002061665ad606aa2340d10 (diff)
downloadbrew-23dec587fd26c606e459e72b2987e73bc910a095.tar.bz2
Make `core_tap_version_string` reusable.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index c73e3f7a7..d970a0a37 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -138,6 +138,13 @@ class Tap
name
end
+ def version_string
+ return "N/A" unless installed?
+ pretty_revision = git_short_head
+ return "(no git repository)" unless pretty_revision
+ "(git revision #{pretty_revision}; last commit #{git_last_commit_date})"
+ end
+
# True if this {Tap} is an official Homebrew tap.
def official?
user == "Homebrew"
@@ -525,7 +532,7 @@ class CoreTap < Tap
end
def self.instance
- @instance ||= CoreTap.new
+ @instance ||= new
end
def self.ensure_installed!(options = {})