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.



103
104
105
# File 'lib/kar/cargotask.rb', line 103

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

Instance Method Details

#<<(output) ⇒ Object



107
108
109
110
# File 'lib/kar/cargotask.rb', line 107

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

#to_sObject



112
113
114
115
116
117
118
119
# File 'lib/kar/cargotask.rb', line 112

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