def create_box(hostname, opts={})
       ld [:hostname, hostname, opts, caller[0]]
       opts = {
         :debug => false,
         :user => current_machine_user, 
         :ostype => current_machine_os || :unix,
         :impltype => :linux, 
         :info => STDOUT,
         :paranoid => false  # doesn't get passed through (Rye bug?)
       }.merge opts
       
       nickname = hostname
       if hostname.kind_of? Rudy::Machine
         hostname, nickname = hostname.dns_public, hostname.name
       end
       
       box = ::Rye::Box.new hostname, opts
       box.nickname = nickname
      
       local_keys = Rye.keys
       box.add_keys local_keys if local_keys.is_a?(Array)
       box.add_key user_keypairpath(opts[:user])
       
       # We define hooks so we can still print each command and its output
       # when running the command blocks. NOTE: We only print this in
       # verbosity mode. 
       if !@@global.parallel && !@@global.quiet
         # This block gets called for every command method call.
         box.pre_command_hook do |cmd, user, host, nickname|
           print_command user, nickname, cmd
         end
       end

       if @@global.verbose > 0 && !@@global.quiet
         box.stdout_hook do |content|
           li content
         end
         # And this one gets called after each command method call.
         box.post_command_hook do |ret|
           print_response ret
         end
       end

       box.exception_hook(::Rye::Err, &rbox_exception_handler)
       box.exception_hook(Exception, &rbox_exception_handler)
       
       ## It'd better for unknown commands to be handled elsewhere
       ## because it doesn't make sense to retry a method that doesn't exist
       ##box.exception_hook(Rye::CommandNotFound, &rbox_exception_handler)

       box
     end
def create_box(hostname, opts={})
       ld [:hostname, hostname, opts, caller[0]]
       opts = {
         :debug => false,
         :user => current_machine_user, 
         :ostype => current_machine_os || :unix,
         :impltype => :linux, 
         :info => STDOUT,
         :paranoid => false  # doesn't get passed through (Rye bug?)
       }.merge opts
       
       nickname = hostname
       if hostname.kind_of? Rudy::Machine
         hostname, nickname = hostname.dns_public, hostname.name
       end
       
       box = ::Rye::Box.new hostname, opts
       box.nickname = nickname
      
       local_keys = Rye.keys
       box.add_keys local_keys if local_keys.is_a?(Array)
       box.add_key user_keypairpath(opts[:user])
       
       # We define hooks so we can still print each command and its output
       # when running the command blocks. NOTE: We only print this in
       # verbosity mode. 
       if !@@global.parallel && !@@global.quiet
         # This block gets called for every command method call.
         box.pre_command_hook do |cmd, user, host, nickname|
           print_command user, nickname, cmd
         end
       end

       if @@global.verbose > 0 && !@@global.quiet
         box.stdout_hook do |content|
           li content
         end
         # And this one gets called after each command method call.
         box.post_command_hook do |ret|
           print_response ret
         end
       end

       box.exception_hook(::Rye::Err, &rbox_exception_handler)
       box.exception_hook(Exception, &rbox_exception_handler)
       
       ## It'd better for unknown commands to be handled elsewhere
       ## because it doesn't make sense to retry a method that doesn't exist
       ##box.exception_hook(Rye::CommandNotFound, &rbox_exception_handler)

       box
     end
Create an instance of Rye::Box for +hostname+. +opts+ is
 an optional Hash of options. See Rye::Box.initialize

 This method should be used throughout the Rudy::Routines
 namespace rather than creating instances manually b/c it
 applies some fancy pants defaults like command hooks.