Permalink
Browse files

v3.1.1: Fix IO.binread [#71]

  • Loading branch information...
1 parent 4a58664 commit d664c2af7ff46ee94364ee4a374471d3c18ec9c2 @marcandre committed Mar 8, 2013
Showing with 6 additions and 6 deletions.
  1. +1 −1 Gemfile.lock
  2. +4 −4 lib/backports/1.9.1/io/binread.rb
  3. +1 −1 lib/backports/version.rb
View
@@ -7,7 +7,7 @@ GIT
PATH
remote: .
specs:
- backports (3.0.3)
+ backports (3.1.1)
GEM
remote: http://rubygems.org/
@@ -1,10 +1,10 @@
unless IO.respond_to? :binread
require 'backports/tools'
- def IO.binread(file, *arg)
- raise ArgumentError, "wrong number of arguments (#{1+arg.size} for 1..3)" unless arg.size < 3
- File.open(Backports.convert_to_path(file),"rb") do |f|
- f.read(*arg)
+ def IO.binread(file, length = nil, offset = 0)
+ File.open(Backports.convert_path(file),"rb") do |f|
+ f.seek(offset)
+ f.read(length)
end
end
end
View
@@ -1,3 +1,3 @@
module Backports
- VERSION = "3.1.0" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
+ VERSION = "3.1.1" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
end

0 comments on commit d664c2a

Please sign in to comment.