Class: Lolcommits::MercurialInfo
- Defined in:
- lib/lolcommits/backends/mercurial_info.rb
Instance Attribute Summary collapse
-
#author_email ⇒ Object
Returns the value of attribute author_email.
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#message ⇒ Object
Returns the value of attribute message.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#repo_internal_path ⇒ Object
Returns the value of attribute repo_internal_path.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ MercurialInfo
constructor
A new instance of MercurialInfo.
Methods inherited from VCSInfo
Constructor Details
#initialize ⇒ MercurialInfo
Returns a new instance of MercurialInfo.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 14 def initialize # mercurial sets HG_RESULT for post- hooks if ENV.key?('HG_RESULT') && ENV['HG_RESULT'] != '0' debug 'Aborting lolcommits hook from failed operation' exit 1 end Mercurial.configure do |conf| conf.hg_binary_path = 'hg' end debug 'MercurialInfo: parsed the following values from commit:' debug "MercurialInfo: \t#{message}" debug "MercurialInfo: \t#{sha}" debug "MercurialInfo: \t#{repo_internal_path}" debug "MercurialInfo: \t#{repo}" debug "MercurialInfo: \t#{branch}" debug "MercurialInfo: \t#{author_name}" if debug "MercurialInfo: \t#{author_email}" if end |
Instance Attribute Details
#author_email ⇒ Object
Returns the value of attribute author_email.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def end |
#author_name ⇒ Object
Returns the value of attribute author_name.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def end |
#branch ⇒ Object
Returns the value of attribute branch.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def branch @branch end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def end |
#repo ⇒ Object
Returns the value of attribute repo.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def repo @repo end |
#repo_internal_path ⇒ Object
Returns the value of attribute repo_internal_path.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def repo_internal_path @repo_internal_path end |
#sha ⇒ Object
Returns the value of attribute sha.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def sha @sha end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 3 def url @url end |
Class Method Details
.local_name(path = '.') ⇒ Object
10 11 12 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 10 def self.local_name(path = '.') File.basename(File.dirname(Mercurial::Repository.open(path).dothg_path)) end |
.repo_root?(path = '.') ⇒ Boolean
6 7 8 |
# File 'lib/lolcommits/backends/mercurial_info.rb', line 6 def self.repo_root?(path = '.') File.directory?(File.join(path, '.hg')) end |