Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created March 12, 2011 02:39
Show Gist options
  • Save ahoward/866980 to your computer and use it in GitHub Desktop.
Save ahoward/866980 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'session'
bash = Session::Bash.new
command = 'ruby -e"STDOUT.sync = true; loop{ puts Time.now; sleep(rand) }"'
bash.execute command do |stdout, stderr|
puts "STDOUT:\n#{ stdout }" if stdout
puts "STDERR:\n#{ stderr }" if stderr
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment