SSHKit makes it easy to write structured, testable SSH commands in Ruby
http://github.com/capistrano/sshkit