lib/lambom/shell_mixin.rb in lambom-0.4.7 vs lib/lambom/shell_mixin.rb in lambom-0.4.8
- old
+ new
@@ -1,34 +1,34 @@
require 'mixlib/shellout'
require 'securerandom'
module Lambom
- module ShellMixin
-
- DEFAULT_TIMEOUT = 12000
-
- def run_cmd(*cmd)
- # Seteamos a 200min o timeout por defecto
+ module ShellMixin
+
+ DEFAULT_TIMEOUT = 12000
+
+ def run_cmd(*cmd)
+ # Seteamos a 200min o timeout por defecto
- opts = {:timeout => DEFAULT_TIMEOUT}
+ opts = {:timeout => DEFAULT_TIMEOUT}
- if $debug
- puts "RUN_CMD: #{cmd}"
- opts[:live_stream] = STDOUT
- end
+ if $debug
+ puts "RUN_CMD: #{cmd}"
+ opts[:live_stream] = STDOUT
+ end
- com = Mixlib::ShellOut.new(cmd, opts)
+ com = Mixlib::ShellOut.new(cmd, opts)
- com.run_command
- com.error!
+ com.run_command
+ com.error!
- puts "output: #{com.stdout}" if $debug
- com.stdout
- end
+ puts "output: #{com.stdout}" if $debug
+ com.stdout
+ end
- class String
- def self.random(n)
- SecureRandom.hex(n)
- end
- end
+ class String
+ def self.random(n)
+ SecureRandom.hex(n)
+ end
end
+ end
end