aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Vandenberg2014-07-28 21:11:35 -0700
committerAdam Vandenberg2014-07-29 07:25:27 -0700
commit896dad4fa82169f43613a0a393a64ec7d8087628 (patch)
tree986a637c7d14b4a44fd762370e04bccc9719d020
parentf19e4478de075035dca2b267121a68c98a173bc1 (diff)
downloadhomebrew-896dad4fa82169f43613a0a393a64ec7d8087628.tar.bz2
Pathname.binread
-rw-r--r--Library/Homebrew/extend/pathname.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index fd97b2a35..8ecff6bf4 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -97,6 +97,10 @@ class Pathname
open("wb", *open_args) { |f| f.write(contents) }
end unless method_defined?(:binwrite)
+ def binread(*open_args)
+ open("rb", *open_args) { |f| f.read }
+ end unless method_defined?(:binread)
+
# NOTE always overwrites
def atomic_write content
require "tempfile"