class Dapp::Dapp::Shellout::Streaming::Proxy::Base

Public Class Methods

new(*streams, with_time: false) click to toggle source
# File lib/dapp/dapp/shellout/streaming.rb, line 21
def initialize(*streams, with_time: false)
  @streams = streams
  @with_time = with_time
end

Public Instance Methods

<<(str) click to toggle source
# File lib/dapp/dapp/shellout/streaming.rb, line 26
def <<(str)
  @streams.each { |s| s << format_string(str) }
end
format_string(str) click to toggle source
# File lib/dapp/dapp/shellout/streaming.rb, line 30
def format_string(str)
  str.lines.map { |l| "#{Dapp.log_time if @with_time}#{l.chomp}\n" }.join
end