Module: Git::Multi::Nike

Defined in:
lib/git/multi.rb

Overview

the main Git::Multi capabilities

Instance Method Summary collapse

Instance Method Details

#just_do_it(interactive, pipeline, options = {}) ⇒ Object



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/git/multi.rb', line 89

def just_do_it interactive, pipeline, options = {}
  working_dir = case options[:in_dir]
    when :parent_dir then self.parent_dir
    when :local_path then self.local_path
    else Dir.pwd
  end
  Dir.chdir(working_dir) do
    if $INTERACTIVE
      puts "%s (%s)" % [
        self.full_name.invert,
        self.fractional_index
      ]
      interactive.call(self)
    else
      pipeline.call(self)
    end
  end
end