Skip to content
Snippets Groups Projects
Commit b2c42fc6 authored by Jack Nagel's avatar Jack Nagel
Browse files

Make signature of Pathname#write compatible with Ruby 2.1+

parent 40f552f8
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment