View retry_upto.rb
# Ruby's `retry` with steroids: | |
# | |
# - retry up to 5 times without waiting between them and retrying after any exception | |
# | |
# retry_upto(5) do ... end | |
# | |
# - retry up to 5 times, waiting 2 seconds between retries and retrying after any exception | |
# | |
# retry_upto(5, :wait => 2) do ... end | |
# |
View gist:137834
require 'sinatra' | |
require 'builder' | |
def home | |
content_type 'text/xml', :charset => 'utf-8' | |
builder do |xml| | |
xml.instruct! | |
xml.Response do | |
xml.Gather("numDigits" => "1", "action" => "press", "method" => "POST") do | |
xml.Say "For a good time, press 1" |
View *scratch*
remote = Rush::Box.new('root@ec2-75-101-233-253.compute-1.amazonaws.com') | |
remote.bash("ls") |