aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/extend
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/extend')
-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