Class: Lolcommits::VCSInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/lolcommits/vcs_info.rb

Class Method Summary collapse

Class Method Details

.local_name(path = ".") ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/lolcommits/vcs_info.rb', line 7

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

Returns:

  • (Boolean)


3
4
5
# File 'lib/lolcommits/vcs_info.rb', line 3

def self.repo_root?(path = ".")
  GitInfo.repo_root?(path) || MercurialInfo.repo_root?(path)
end