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.



90
91
92
# File 'lib/kar/cargotask.rb', line 90

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

Instance Method Details

#<<(output) ⇒ Object



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

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

#to_sObject



99
100
101
102
103
104
105
106
# File 'lib/kar/cargotask.rb', line 99

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