class Lolcommits::GitInfo
Constants
- GIT_URL_REGEX
Attributes
branch[RW]
message[RW]
repo[RW]
repo_internal_path[RW]
sha[RW]
url[RW]
Public Class Methods
new()
click to toggle source
# File lib/lolcommits/git_info.rb, line 9 def initialize debug 'GitInfo: parsed the following values from commit:' debug "GitInfo: \t#{message}" debug "GitInfo: \t#{sha}" debug "GitInfo: \t#{repo_internal_path}" debug "GitInfo: \t#{repo}" debug "GitInfo: \t#{branch}" debug "GitInfo: \t#{author_name}" if author_name debug "GitInfo: \t#{author_email}" if author_email end
Private Instance Methods
last_commit()
click to toggle source
# File lib/lolcommits/git_info.rb, line 77 def last_commit @commit ||= repository.log.first end
remote_https_url(url)
click to toggle source
# File lib/lolcommits/git_info.rb, line 69 def remote_https_url(url) url.tr(':', '/').tr(/^git@/, 'https://').tr(/\.git$/, '') + '/commit/' end
repository(path = '.')
click to toggle source
# File lib/lolcommits/git_info.rb, line 73 def repository(path = '.') @repository ||= Git.open(path) end