examples/ssh_to_ec2_instance.rb
# Simple log wrapper to do fancy messages ;-)
Simple log wrapper to do fancy messages ;-)
Simple log wrapper to do fancy messages ; - )
def log(message, &block)
  cols, rows = `stty size`.split.map { |x| x.to_i }.reverse
  print "[%s] %-#{cols-20}s" % [Time.now.strftime("%H:%M:%S"), "#{message}..."]
  $stdout.flush
  retval = block.call
  puts "[OK]"
  return retval
end
def log ( message , & block ) cols , rows = ` stty size ` . split . map { | x | x . to_i } . reverse print "[%s] %-#{cols-20}s" % [ Time . now . strftime ( "%H:%M:%S" ) , "#{message}..." ] $stdout . flush retval = block . call puts "[OK]" return retval end
Simple log wrapper to do fancy messages ;-)
Simple log wrapper to do fancy messages ; - )
message
<not_specific>
block
<not_specific>