Class: Lolcommits::VCSInfo
- Inherits:
-
Object
- Object
- Lolcommits::VCSInfo
- Defined in:
- lib/lolcommits/vcs_info.rb
Class Method Summary collapse
Class Method Details
.local_name(path = '.') ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/lolcommits/vcs_info.rb', line 9 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.(path)}' is not the root of a supported VCS" end end |
.repo_root?(path = '.') ⇒ Boolean
5 6 7 |
# File 'lib/lolcommits/vcs_info.rb', line 5 def self.repo_root?(path = '.') GitInfo.repo_root?(path) || MercurialInfo.repo_root?(path) end |