Module: Buildable::Shell
Instance Method Summary collapse
Instance Method Details
#do(command, params = {}) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/buildable/shell.rb', line 10 def do(command, params = {}) PTY.spawn(command_line(command, params)) do |r,w,pid| r.each { |line| puts "\t#{line}" } rescue nil # prevents error when process ending Process.wait(pid) end rescue PTY::ChildExited true end |
#do_quiet(command, params = {}) ⇒ Object
19 20 21 |
# File 'lib/buildable/shell.rb', line 19 def do_quiet(command, params = {}) %x{#{command_line(command, params)}}.chomp end |
#success? ⇒ Boolean
6 7 8 |
# File 'lib/buildable/shell.rb', line 6 def success? !!($? && $?.success?) end |