Module: Ding::Helpers

Included in:
Git, Ssh
Defined in:
lib/ding/helpers.rb

Instance Method Summary collapse

Instance Method Details

#run_cmd(cmd) ⇒ Object

NOTE: only for commands where we are interested in the effect as unless verbose is turned on, stdout and stderr are suppressed



5
6
7
8
9
10
11
12
# File 'lib/ding/helpers.rb', line 5

def run_cmd(cmd)
  if self.options[:verbose]
    puts "$ #{cmd}"
  else
    cmd << ' &>/dev/null '
  end
  system cmd
end