Module: Mistilteinn::Git

Defined in:
lib/mistilteinn/git.rb

Class Method Summary collapse

Class Method Details

.command?(cmd) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/mistilteinn/git.rb', line 19

def command?(cmd)
  cmd("which git-#{cmd}") != nil
end

.config(name, value = nil) ⇒ Object



7
8
9
# File 'lib/mistilteinn/git.rb', line 7

def config(name, value=nil)
  cmd "git config #{name} #{value or ''}"
end

.rootObject



11
12
13
# File 'lib/mistilteinn/git.rb', line 11

def root
  cmd "git rev-parse --show-toplevel"
end

.work_tree?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/mistilteinn/git.rb', line 15

def work_tree?()
  cmd("git rev-parse --is-inside-work-tree") == "true"
end