Module: Git

Defined in:
lib/git/lib.rb,
lib/git.rb,
lib/git/base.rb

Overview

Available Git commands

Defined Under Namespace

Modules: Lib Classes: Base

Class Method Summary collapse

Class Method Details

.check_git_existanceObject

checks if git is installed



8
9
10
11
12
13
14
# File 'lib/git.rb', line 8

def self.check_git_existance
  output = git
  
  unless /\Ausage: git/ =~ output
    raise NoGitInstalledError, 'git was not found. make sure you have it installed'
  end
end

.check_repo_existanceObject

checks if current directory is a git repository



17
18
19
20
21
22
23
# File 'lib/git.rb', line 17

def self.check_repo_existance
  output = status
  
  unless /\AOn branch/ =~ output
    raise NoGitRepositoryError, 'you are not in a git repository.'
  end
end

.clear_cacheObject



42
43
44
# File 'lib/git.rb', line 42

def self.clear_cache
  Git::Lib.clear_cache
end

.commit_all(message) ⇒ Object



38
39
40
# File 'lib/git.rb', line 38

def self.commit_all(message)
  Git::Lib.commit_all(message)
end

.gitObject

so Git calls follow the Git.<command> pattern



26
27
28
# File 'lib/git.rb', line 26

def self.git
  Git::Lib.git
end

.initObject



30
31
32
# File 'lib/git.rb', line 30

def self.init
  Git::Lib.init
end

.logObject



46
47
48
# File 'lib/git.rb', line 46

def self.log
  Git::Lib.log
end

.statusObject



34
35
36
# File 'lib/git.rb', line 34

def self.status
  Git::Lib.status
end