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.



112
113
114
# File 'lib/kar/cargotask.rb', line 112

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

Instance Method Details

#<<(output) ⇒ Object



116
117
118
119
# File 'lib/kar/cargotask.rb', line 116

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

#to_sObject



121
122
123
124
125
126
127
128
# File 'lib/kar/cargotask.rb', line 121

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