Sha256: dc32e28eb488e27c8ed79b1d666f82c07a14ceafe465e4ea8ad7b4c94c2f1314

Contents?: true

Size: 621 Bytes

Versions: 26

Compression:

Stored size: 621 Bytes

Contents

unless IO.method_defined? :advise
  require 'backports/tools'

  class IO
    def advise(advice, offset=0, len=0)
      raise RangeError if Backports.coerce_to_int(offset) >= 1<<31
      raise RangeError if Backports.coerce_to_int(len) >= 1<<31
      raise IOError if closed?
      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
  end
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
scout_realtime-1.0.5 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.4 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.3 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.3.pre lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.2 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.1 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-1.0.0 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.5 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.5.pre lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.4 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
backports-3.6.0 lib/backports/1.9.3/io/advise.rb
backports-3.5.0 lib/backports/1.9.3/io/advise.rb
backports-3.4.1 lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.3 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.2 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
scout_realtime-0.5.1 lib/vendor/backports-3.3.5/lib/backports/1.9.3/io/advise.rb
backports-3.4.0 lib/backports/1.9.3/io/advise.rb
backports-3.3.5 lib/backports/1.9.3/io/advise.rb
backports-3.3.4 lib/backports/1.9.3/io/advise.rb
backports-3.3.3 lib/backports/1.9.3/io/advise.rb