lib/polyphony/extensions/io.rb in polyphony-0.79 vs lib/polyphony/extensions/io.rb in polyphony-0.80
- old
+ new
@@ -1,13 +1,15 @@
# frozen_string_literal: true
require 'open3'
-# IO class method patches
+# IO extensions
class ::IO
class << self
alias_method :orig_binread, :binread
+
+ # TODO: add docs to all methods in this file
def binread(name, length = nil, offset = nil)
File.open(name, 'rb:ASCII-8BIT') do |f|
f.seek(offset) if offset
length ? f.read(length) : f.read
end
@@ -74,10 +76,10 @@
end
end
# IO instance method patches
class ::IO
- def __parser_read_method__
+ def __read_method__
:backend_read
end
# def each(sep = $/, limit = nil, chomp: nil)
# sep, limit = $/, sep if sep.is_a?(Integer)