lib/lambom/shell_mixin.rb in lambom-0.2.2 vs lib/lambom/shell_mixin.rb in lambom-0.3.0

- old
+ new

@@ -1,14 +1,23 @@ require 'mixlib/shellout' module Lambom module ShellMixin def run_cmd(*cmd) - puts "RUN_CMD: #{cmd}" if $debug - com = Mixlib::ShellOut.new(cmd) + + opts = {} + + if $debug + puts "RUN_CMD: #{cmd}" + opts = {:live_stream => STDOUT} + end + + com = Mixlib::ShellOut.new(cmd, opts) + com.run_command com.error! - puts "salida: #{com.stdout}" if $debug + + puts "output: #{com.stdout}" if $debug com.stdout end end end