Class: Lolcommits::VCSInfo
- Inherits:
-
Object
- Object
- Lolcommits::VCSInfo
- Includes:
- Methadone::CLILogging
- Defined in:
- lib/lolcommits/vcs_info.rb
Overview
base class ala plugin.rb
Direct Known Subclasses
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 ⇒ VCSInfo
constructor
A new instance of VCSInfo.
Constructor Details
#initialize ⇒ VCSInfo
Returns a new instance of VCSInfo.
27 28 29 |
# File 'lib/lolcommits/vcs_info.rb', line 27 def initialize (__method__) end |
Instance Attribute Details
#author_email ⇒ Object
Returns the value of attribute author_email.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def end |
#author_name ⇒ Object
Returns the value of attribute author_name.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def end |
#branch ⇒ Object
Returns the value of attribute branch.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def branch @branch end |
#message ⇒ Object
Returns the value of attribute message.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def end |
#repo ⇒ Object
Returns the value of attribute repo.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def repo @repo end |
#repo_internal_path ⇒ Object
Returns the value of attribute repo_internal_path.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def repo_internal_path @repo_internal_path end |
#sha ⇒ Object
Returns the value of attribute sha.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def sha @sha end |
#url ⇒ Object
Returns the value of attribute url.
6 7 8 |
# File 'lib/lolcommits/vcs_info.rb', line 6 def url @url end |
Class Method Details
.base_message(method) ⇒ Object
13 14 15 |
# File 'lib/lolcommits/vcs_info.rb', line 13 def self.(method) raise NotImplementedError, "#{self.class.name} is a base class; implement '#{method}' in a subclass", caller end |
.local_name(path = '.') ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/lolcommits/vcs_info.rb', line 17 def self.local_name(path = '.') if GitInfo.repo_root?(path) GitInfo.local_name(path) elsif MercurialInfo.repo_root?(path) MercurialInfo.local_name(path) else raise "'#{File.expand_path(path)}' is not the root of a supported VCS" end end |
.repo_root?(path = '.') ⇒ Boolean
9 10 11 |
# File 'lib/lolcommits/vcs_info.rb', line 9 def self.repo_root?(path = '.') GitInfo.repo_root?(path) || MercurialInfo.repo_root?(path) end |