diff options
| author | Jack Nagel | 2014-06-17 09:31:31 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-06-17 12:14:51 -0500 |
| commit | 5f0040f3ee4093bf03dc47cd307e8227d82b87ca (patch) | |
| tree | 5e83a29239146e1ab86a83ac6b18868cd6fde447 /Library/Homebrew | |
| parent | 614a96fe0eb86b46587cce9332bb305299370943 (diff) | |
| download | homebrew-5f0040f3ee4093bf03dc47cd307e8227d82b87ca.tar.bz2 | |
Make signature of Pathname#write compatible with Ruby 2.1+
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 4 |
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 |
