diff options
Diffstat (limited to 'lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb')
-rw-r--r-- | lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb b/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb new file mode 100644 index 0000000000..0f6e2e0af2 --- /dev/null +++ b/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb @@ -0,0 +1,12 @@ +class IO #:nodoc: + class << self + unless method_defined? :binread + def binread(file, *args) + raise ArgumentError, "wrong number of arguments (#{1 + args.size} for 1..3)" unless args.size < 3 + File.open(file, "rb") do |f| + f.read(*args) + end + end + end + end +end |