Sha256: d73992538d45477ca2d053f1a02de39b6328e7963c8982484f2d5588eca04939

Contents?: true

Size: 622 Bytes

Versions: 47

Compression:

Stored size: 622 Bytes

Contents

fd = IO.sysopen(__FILE__)
begin
  IO.open(fd, :mode => 'r'){}
rescue TypeError
  require 'backports/tools/io'
  require 'backports/tools/alias_method_chain'

  class << IO
    def open_with_options_hash(*args)
      if args.size > 2 || args[1].respond_to?(:to_hash)
        fd, mode, options = (args << Backports::Undefined)
        args = [fd, Backports.combine_mode_and_option(mode, options)]
      end
      if block_given?
        open_without_options_hash(*args){|f| yield f}
      else
        open_without_options_hash(*args)
      end
    end

    Backports.alias_method_chain self, :open, :options_hash
  end
end

Version data entries

47 entries across 47 versions & 4 rubygems

Version Path
backports-3.25.0 lib/backports/1.9.1/io/open.rb
backports-3.24.1 lib/backports/1.9.1/io/open.rb
backports-3.24.0 lib/backports/1.9.1/io/open.rb
backports-3.23.0 lib/backports/1.9.1/io/open.rb
backports-3.22.1 lib/backports/1.9.1/io/open.rb
backports-3.22.0 lib/backports/1.9.1/io/open.rb
backports-3.21.0 lib/backports/1.9.1/io/open.rb
backports-3.20.2 lib/backports/1.9.1/io/open.rb
backports-3.20.1 lib/backports/1.9.1/io/open.rb
backports-3.20.0 lib/backports/1.9.1/io/open.rb
backports-3.19.0 lib/backports/1.9.1/io/open.rb
backports-3.18.2 lib/backports/1.9.1/io/open.rb
backports-3.18.1 lib/backports/1.9.1/io/open.rb
backports-3.18.0 lib/backports/1.9.1/io/open.rb
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/backports-3.12.0/lib/backports/1.9.1/io/open.rb
backports-3.17.2 lib/backports/1.9.1/io/open.rb
backports-3.17.1 lib/backports/1.9.1/io/open.rb
backports-3.17.0 lib/backports/1.9.1/io/open.rb
backports-3.16.1 lib/backports/1.9.1/io/open.rb
backports-3.16.0 lib/backports/1.9.1/io/open.rb