Class: MiniGit::Capturing

Inherits:
MiniGit
  • Object
show all
Defined in:
lib/minigit.rb

Constant Summary

Constants inherited from MiniGit

VERSION

Instance Attribute Summary collapse

Attributes inherited from MiniGit

#git_command, #git_dir, #git_work_tree

Instance Method Summary collapse

Methods inherited from MiniGit

#find_git_dir, git, #initialize, method_missing, #method_missing, #switches_for, #system

Constructor Details

This class inherits a constructor from MiniGit

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MiniGit

Instance Attribute Details

#shelloutObject (readonly)

Returns the value of attribute shellout.



139
140
141
# File 'lib/minigit.rb', line 139

def shellout
  @shellout
end

Instance Method Details

#capturingObject



151
152
153
# File 'lib/minigit.rb', line 151

def capturing
  self
end

#git(*args) ⇒ Object



141
142
143
144
145
146
147
148
149
# File 'lib/minigit.rb', line 141

def git(*args)
  argv = switches_for(*args)
  argv << { :environment => { 'GIT_DIR' => git_dir, 'GIT_WORK_TREE' => git_work_tree } }
  @shellout = Mixlib::ShellOut.new(git_command, *argv)
  @shellout.run_command.error!
  @shellout.stdout
rescue Mixlib::ShellOut::ShellCommandFailed
  raise GitError.new(argv, @shellout.status, :shellout => @shellout)
end

#noncapturingObject



155
156
157
158
159
# File 'lib/minigit.rb', line 155

def noncapturing
  @noncapturing ||= MiniGit.new(:git_command => @git_command,
                                :git_dir => @git_dir,
                                :git_work_tree => @git_work_tree)
end