Module: Git::Multi::Nike
- Defined in:
- lib/git/multi.rb
Overview
the main ‘Git::Multi` capabilities
Instance Method Summary collapse
-
#just_do_it(interactive, pipelined, captured = nil, options = {}) ⇒ Object
rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/CyclomaticComplexity.
-
#spputs(*args) ⇒ Object
rubocop:enable Metrics/CyclomaticComplexity rubocop:enable Metrics/PerceivedComplexity.
Instance Method Details
#just_do_it(interactive, pipelined, captured = nil, options = {}) ⇒ Object
rubocop:disable Metrics/PerceivedComplexity rubocop:disable Metrics/CyclomaticComplexity
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/git/multi.rb', line 144 def just_do_it(interactive, pipelined, captured = nil, = {}) working_dir = case ([:in] || '').to_sym when :parent_dir then parent_dir when :local_path then local_path else Dir.pwd end Dir.chdir(working_dir) do if STDOUT.tty? && STDERR.tty? STDOUT.puts "#{full_name.invert} (#{fractional_index})" interactive.call(self) elsif STDERR.tty? && captured errors = File.join(ENV['TMPDIR'], "git-multi.#{$PID}") captured.call(self, errors) if File.exist?(errors) && !File.zero?(errors) # rubocop:disable Style/StderrPuts STDERR.puts "#{full_name.invert} (#{fractional_index})" Kernel.system "cat #{errors} > /dev/tty ;" # rubocop:enable Style/StderrPuts end else pipelined.call(self) end end end |
#spputs(*args) ⇒ Object
rubocop:enable Metrics/CyclomaticComplexity rubocop:enable Metrics/PerceivedComplexity
171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/git/multi.rb', line 171 def spputs(*args) # split, prefix and puts args.each do |arg| case arg when Array arg.each do |argh| puts("#{full_name}: #{argh}"); end when String spputs(arg.split($RS)) else ssputs(arg.to_s) end end end |