def execute(command, options = {})
      options = {} if options == nil
      
      commands = parse command
      Trooper.logger.debug commands
      
      if !options[:local]

        connection.exec! commands do |ch, stream, data|
          raise Trooper::StdError, "#{data}\n[ERROR INFO] #{commands}" if stream == :stderr
          ch.wait
          return [commands, stream, data]
        end
        
      else

        if commands != ''
          begin
            stdin, stdout, stderr = Open3.popen3(commands)
            raise Trooper::StdError, "#{stderr.read}\n[ERROR INFO] #{commands}" if stderr.read != ''

            return [commands, :stdout, stdout.read]
          rescue Exception => e
            raise Trooper::StdError, "#{e.message}\n[ERROR INFO] #{commands}"
          end
        end

      end
    end
def execute(command, options = {})
      options = {} if options == nil
      
      commands = parse command
      Trooper.logger.debug commands
      
      if !options[:local]

        connection.exec! commands do |ch, stream, data|
          raise Trooper::StdError, "#{data}\n[ERROR INFO] #{commands}" if stream == :stderr
          ch.wait
          return [commands, stream, data]
        end
        
      else

        if commands != ''
          begin
            stdin, stdout, stderr = Open3.popen3(commands)
            raise Trooper::StdError, "#{stderr.read}\n[ERROR INFO] #{commands}" if stderr.read != ''

            return [commands, :stdout, stdout.read]
          rescue Exception => e
            raise Trooper::StdError, "#{e.message}\n[ERROR INFO] #{commands}"
          end
        end

      end
    end
Public: Execute a set of commands via net/ssh.

 command - A String or Array of command to run on a remote server
 options - The Hash options used to refine the selection (default: {}):
             :local - Run the commands on the local machine (optional).

 Examples

   runner.execute(['cd to/path', 'touch file']) # => ['cd to/path && touch file', :stdout, '']
   runner.execute('cat file') # => ['cat file', :stdout, 'file content']
   runner.execute('cat file', :local => true) # => ['cat file', :stdout, 'file content']

 Returns an array or raises an exception.