summaryrefslogtreecommitdiff
path: root/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
diff options
context:
space:
mode:
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.rb10
1 files changed, 10 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..19f3c3d43e
--- /dev/null
+++ b/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb
@@ -0,0 +1,10 @@
+class IO #:nodoc:
+ class << self
+ def binread(file, *args)
+ fail 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 unless method_defined? :binread
+ end
+end