Class: Git::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/git/base.rb

Class Method Summary collapse

Class Method Details

.command(command = '', opts = '') ⇒ Object

wrapper for git commands



13
14
15
# File 'lib/git/base.rb', line 13

def self.command(command = '', opts = '')
  IO.popen("git #{command} #{opts} 2>&1") # 2>&1 surpresses stderr
end

.command_output(command = '', opts = '') ⇒ Object

wrapper for command method which returns the output



5
6
7
8
9
10
# File 'lib/git/base.rb', line 5

def self.command_output(command = '', opts = '')
  f = command(command, opts)
  output = f.readlines.join
  f.close
  output
end