Rename write_binary to binwrite

This commit is contained in:
Adam Vandenberg 2014-07-27 15:30:46 -07:00
parent bb2c9b7ba4
commit 8e96ce0aa5

View File

@ -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 }