Sha256: 05d6001e3d21348f4f64b942820332e254deff2b34cc0f2a0ab2eaeb7f9d79fb

Contents?: true

Size: 1.21 KB

Versions: 22

Compression:

Stored size: 1.21 KB

Contents

class IO
  # Standard in Ruby 1.9.3 See official documentation[http://ruby-doc.org/core-1.9.3/IO.html#method-i-advise]
  # We're only for a platform not implementing advise, so we return nil.
  def advise(advice, offset=0, len=0)
    case advice
    when  :normal,
          :sequential,
          :random,
          :willneed,
          :dontneed,
          :noreuse
      return nil
    when Symbol
      raise NotImplementedError, "Unsupported advice #{advice}"
    else
      raise TypeError, "advice must be a Symbol"
    end
  end unless method_defined? :advise
end
  
class << IO
  # Standard in Ruby 1.9.3 See official documentation[http://ruby-doc.org/core-1.9.3/IO.html#method-c-write]
  def write(name, string, offset = nil, options = Backports::Undefined)
    Backports.write(false, name, string, offset, options)
  end unless method_defined? :write

  # Standard in Ruby 1.9.3 See official documentation[http://ruby-doc.org/core-1.9.3/IO.html#method-c-binwrite]
  # This method does support an options hash, see http://bugs.ruby-lang.org/issues/5782
  def binwrite(name, string, offset = nil, options = Backports::Undefined)
    Backports.write(true, name, string, offset, options)
  end unless method_defined? :binwrite
end

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
backports-3.0.3 lib/backports/1.9.3/io.rb
backports-3.0.2 lib/backports/1.9.3/io.rb
backports-3.0.1 lib/backports/1.9.3/io.rb
backports-3.0.0 lib/backports/1.9.3/io.rb
backports-2.8.2 lib/backports/1.9.3/io.rb
backports-2.8.1 lib/backports/1.9.3/io.rb
backports-2.8.0 lib/backports/1.9.3/io.rb
backports-2.7.1 lib/backports/1.9.3/io.rb
backports-2.7.0 lib/backports/1.9.3/io.rb
backports-2.6.7 lib/backports/1.9.3/io.rb
backports-2.6.6 lib/backports/1.9.3/io.rb
backports-2.6.5 lib/backports/1.9.3/io.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/backports-2.6.4/lib/backports/1.9.3/io.rb
backports-2.6.4 lib/backports/1.9.3/io.rb
backports-2.6.3 lib/backports/1.9.3/io.rb
backports-2.6.2 lib/backports/1.9.3/io.rb
backports-2.6.1 lib/backports/1.9.3/io.rb
backports-2.6.0 lib/backports/1.9.3/io.rb
backports-2.5.3 lib/backports/1.9.3/io.rb
backports-2.5.2 lib/backports/1.9.3/io.rb