Class: Jrf::CLI::Runner::RsNormalizer
- Inherits:
-
Object
- Object
- Jrf::CLI::Runner::RsNormalizer
- Defined in:
- lib/jrf/cli/runner.rb
Instance Method Summary collapse
-
#initialize(input) ⇒ RsNormalizer
constructor
A new instance of RsNormalizer.
- #read(length = nil, outbuf = nil) ⇒ Object
Constructor Details
#initialize(input) ⇒ RsNormalizer
Returns a new instance of RsNormalizer.
14 15 16 |
# File 'lib/jrf/cli/runner.rb', line 14 def initialize(input) @input = input end |
Instance Method Details
#read(length = nil, outbuf = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jrf/cli/runner.rb', line 18 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 |