Class: EDL::LinebreakMagician
- Inherits:
-
StringIO
- Object
- StringIO
- EDL::LinebreakMagician
- Defined in:
- lib/edl/linebreak_magician.rb
Overview
EDLs sometimes come with r line breaks, and this is something that fails with Ruby standard line separator detection. We need something to help us with that. In this case we can just do a bulk replace because EDLs will be relatively small for even very long features.
Constant Summary collapse
- LOOSE_CR =
/#{Regexp.escape("\r")}/
Instance Method Summary collapse
-
#initialize(with_io) ⇒ LinebreakMagician
constructor
A new instance of LinebreakMagician.
Constructor Details
#initialize(with_io) ⇒ LinebreakMagician
Returns a new instance of LinebreakMagician.
9 10 11 12 |
# File 'lib/edl/linebreak_magician.rb', line 9 def initialize(with_io) blob = with_io.read super(blob.gsub(LOOSE_CR, "\n")) end |