Sha256: d378207acabcacfc9177a073172cf5849144a8d203feecec0ce8b4f561486a83
Contents?: true
Size: 584 Bytes
Versions: 26
Compression:
Stored size: 584 Bytes
Contents
begin File.open(__FILE__) { |f| IO.open(f.fileno, :mode => 'r').close } rescue TypeError require 'backports/tools' 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
26 entries across 26 versions & 2 rubygems