Class: Kar::CargoTask::Results

Inherits:
Object
  • Object
show all
Defined in:
lib/kar/cargotask.rb

Instance Method Summary collapse

Constructor Details

#initializeResults

Returns a new instance of Results.



94
95
96
# File 'lib/kar/cargotask.rb', line 94

def initialize
  @io = verbose? ? $stdout : StringIO.new
end

Instance Method Details

#<<(output) ⇒ Object



98
99
100
101
# File 'lib/kar/cargotask.rb', line 98

def <<(output)
  # Always break a line even when output isn't terminated by a line break
  @io.puts output
end

#to_sObject



103
104
105
106
107
108
109
110
# File 'lib/kar/cargotask.rb', line 103

def to_s
  if verbose?
    ""
  else
    @io.rewind
    @io.read
  end
end