class ProjectStatus::GitInfo
Public Class Methods
generate()
click to toggle source
# File lib/project_status/git_info.rb, line 4 def generate { commit_hash: commit, commit_hash_short: commit_short, commit_message: message, authored_date: date, authored_timestamp: timestamp, commit_tag: tag, repo_last_tag: last_tag } end
Protected Class Methods
commit()
click to toggle source
# File lib/project_status/git_info.rb, line 18 def commit `git log -1 --pretty="format:%H"` end
commit_short()
click to toggle source
# File lib/project_status/git_info.rb, line 22 def commit_short `git log -1 --pretty="format:%h"` end
date()
click to toggle source
# File lib/project_status/git_info.rb, line 30 def date `git log -1 --pretty="format:%ad"` end
last_tag()
click to toggle source
# File lib/project_status/git_info.rb, line 42 def last_tag `git describe --tags --abbrev=0`.strip end
message()
click to toggle source
# File lib/project_status/git_info.rb, line 26 def message `git log -1 --pretty="format:%s"` end
tag()
click to toggle source
# File lib/project_status/git_info.rb, line 38 def tag `git describe --exact-match #{commit}`.strip end
timestamp()
click to toggle source
# File lib/project_status/git_info.rb, line 34 def timestamp `git log -1 --pretty="format:%at"` end