aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2014-07-28 21:11:35 -0700
committerAdam Vandenberg2014-07-29 07:25:27 -0700
commitfbee511eba85fdd5808d1750468c751b9327c787 (patch)
tree9119e383690569f4be287564fca229ae330b904f /Library
parent8ad07144f72601d6bf42b71e4b706c3e0f5961dc (diff)
downloadbrew-fbee511eba85fdd5808d1750468c751b9327c787.tar.bz2
Pathname.binread
Diffstat (limited to 'Library')
-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"