Sha256: 05eb890f26348edabba37a6e0ee58ddf5695eea11b4a57ade1bace704b2028aa

Contents?: true

Size: 653 Bytes

Versions: 12

Compression:

Stored size: 653 Bytes

Contents

module Sprinkle
  module Utility
    class LogRecorder #:nodoc:
      
      attr_accessor :err, :out, :command, :code
      
      def initialize
        reset
      end
            
      def log(stream, data)
        case stream
          when :err then @err << data
          when :out then @out << data
        end
      end
      
      # hash suitable to pass into a pretty failure details hash
      def hash
        {:error => err, :stdout => out, :command => command, :code => code}
      end
      
      def reset(cmd=nil)
        @command=cmd
        @code=nil
        @err=""
        @out=""        
      end
      
    end
    
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
sprinkle-0.7.1.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.7.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.7 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.6.2 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.6.1.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.6.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.6.0 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.5.2 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.5.1.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.5.1 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.5.0 lib/sprinkle/utility/log_recorder.rb
sprinkle-0.5.0.rc1 lib/sprinkle/utility/log_recorder.rb