lib/polyphony/core/debug.rb
# Returns a firehose proc for the given io and block.
#
# @param io [IO, nil] IO instance
# @param block [Proc] event handler block
# @return [Proc] firehose proc
Returns a firehose proc for the given io and block.
Returns a firehose proc for the given io and block .
def firehose_proc(io, block)
        if io
          ->(*e) { io.orig_write("#{trace_event_info(e).inspect}\n") }
        elsif block
          ->(*e) { block.(trace_event_info(e)) }
        else
          raise "Please provide an io or a block"
        end
      end
def firehose_proc ( io , block ) if io -> ( * e ) { io . orig_write ( "#{trace_event_info(e).inspect}\n" ) } elsif block -> ( * e ) { block . ( trace_event_info ( e ) ) } else raise "Please provide an io or a block" end end
Returns a firehose proc for the given io and block.
Returns a firehose proc for the given io and block .
None
Proc
io
None
block
event handler block
event handler block