Class: Fastlane::Helper::WaldoReadIO

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/waldo/helper/waldo_helper.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ WaldoReadIO

Returns a new instance of WaldoReadIO.



557
558
559
# File 'lib/fastlane/plugin/waldo/helper/waldo_helper.rb', line 557

def initialize(path)
  @fp = File.open(path)
end

Instance Method Details

#closeObject



561
562
563
# File 'lib/fastlane/plugin/waldo/helper/waldo_helper.rb', line 561

def close
  @fp.close
end

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



565
566
567
568
569
570
571
# File 'lib/fastlane/plugin/waldo/helper/waldo_helper.rb', line 565

def read(length = nil, outbuf = nil)
  if result = @fp.read(length, outbuf)
    result.force_encoding('BINARY') if result.respond_to?(:force_encoding)
  end

  result
end