Class: Jrf::CLI::Runner::RsNormalizer

Inherits:
Object
  • Object
show all
Defined in:
lib/jrf/cli/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(input) ⇒ RsNormalizer

Returns a new instance of RsNormalizer.



16
17
18
# File 'lib/jrf/cli/runner.rb', line 16

def initialize(input)
  @input = input
end

Instance Method Details

#read(length = nil, outbuf = nil) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/jrf/cli/runner.rb', line 20

def read(length = nil, outbuf = nil)
  chunk = @input.read(length)
  return nil if chunk.nil?

  chunk = chunk.tr(RS_CHAR, "\n")
  if outbuf
    outbuf.replace(chunk)
  else
    chunk
  end
end