aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend/pathname.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2014-07-27 15:30:46 -0700
committerAdam Vandenberg2014-07-27 15:30:46 -0700
commit6c8e7f5941f3b6390648e34f22806407aa12c92d (patch)
tree8b8f1afa1dfcaf20de1ca9c2cf8b0b79af5b9c70 /Library/Homebrew/extend/pathname.rb
parent7897e37b5754d7b2a86bd15849e4a3a8e6df0f15 (diff)
downloadhomebrew-6c8e7f5941f3b6390648e34f22806407aa12c92d.tar.bz2
Rename write_binary to binwrite
Diffstat (limited to 'Library/Homebrew/extend/pathname.rb')
-rw-r--r--Library/Homebrew/extend/pathname.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 382dc5a71..253380982 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -93,7 +93,8 @@ class Pathname
open("w", *open_args) { |f| f.write(content) }
end
- def write_binary binary_content
+ # Note: Ruby 2.1+ has Pathname#write and Pathname#binwrite
+ def binwrite binary_content
raise "Will not overwrite #{to_s}" if exist?
dirname.mkpath
File.open(self, 'wb') {|f| f.write binary_content }