Class: Pkgr::Addon::LiveStream

Inherits:
Object
  • Object
show all
Defined in:
lib/pkgr/addon.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream = STDOUT) ⇒ LiveStream

Returns a new instance of LiveStream.



99
100
101
# File 'lib/pkgr/addon.rb', line 99

def initialize(stream = STDOUT)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



98
99
100
# File 'lib/pkgr/addon.rb', line 98

def stream
  @stream
end

Instance Method Details

#<<(data) ⇒ Object



103
104
105
106
107
# File 'lib/pkgr/addon.rb', line 103

def <<(data)
  data.split("\n").each do |line|
    stream.puts "       #{line}"
  end
end