aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-06-17 09:31:31 -0500
committerJack Nagel2014-06-17 12:14:51 -0500
commitb2c42fc63c1e35cddfdde0a727fc5a02b798539e (patch)
tree57a7e4a44c0bb3eb3402d73cb670ba5cbda3536f /Library
parent40f552f891e5194838ae104a56a25548318aac11 (diff)
downloadbrew-b2c42fc63c1e35cddfdde0a727fc5a02b798539e.tar.bz2
Make signature of Pathname#write compatible with Ruby 2.1+
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/extend/pathname.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb
index 84b65857f..dd84f7fe7 100644
--- a/Library/Homebrew/extend/pathname.rb
+++ b/Library/Homebrew/extend/pathname.rb
@@ -90,10 +90,10 @@ class Pathname
# we assume this pathname object is a file obviously
alias_method :old_write, :write if method_defined?(:write)
- def write content
+ def write(content, *open_args)
raise "Will not overwrite #{to_s}" if exist?
dirname.mkpath
- File.open(self, 'w') {|f| f.write content }
+ open("w", *open_args) { |f| f.write(content) }
end
# NOTE always overwrites