lib/ridley/ssh/response.rb in ridley-0.5.2 vs lib/ridley/ssh/response.rb in ridley-0.6.0

- old
+ new

@@ -1,8 +1,23 @@ module Ridley class SSH # @author Jamie Winsor <jamie@vialstudios.com> - class Response < Struct.new(:stdout, :stderr, :exit_code, :exit_signal) + class Response + attr_reader :host + + attr_accessor :stdout + attr_accessor :stderr + attr_accessor :exit_code + attr_accessor :exit_signal + + def initialize(host, options = {}) + @host = host + @stdout = options[:stdout] || String.new + @stderr = options[:stderr] || String.new + @exit_code = options[:exit_code] || -1 + @exit_signal = options[:exit_signal] || nil + end + # Return true if the response was not successful # # @return [Boolean] def error? self.exit_code != 0