diff options
| author | Mike McQuaid | 2016-09-11 17:47:04 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-11 19:13:00 +0100 |
| commit | ecf46b841b24fe650504a7388f25d1093189a09d (patch) | |
| tree | 8eefbab62d777b28051c9fb7ac77ed0a08f044d7 /Library | |
| parent | 1f2abbdd6e960399b50f35e3e34261d13b9cf893 (diff) | |
| download | brew-ecf46b841b24fe650504a7388f25d1093189a09d.tar.bz2 | |
utils/inreplace: fix Rubocop warnings.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/utils/inreplace.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 9978b02fe..c7557ab41 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -1,9 +1,9 @@ module Utils class InreplaceError < RuntimeError def initialize(errors) - super errors.inject("inreplace failed\n") { |s, (path, errs)| + super errors.inject("inreplace failed\n") do |s, (path, errs)| s << "#{path}:\n" << errs.map { |e| " #{e}\n" }.join - } + end end end @@ -24,7 +24,7 @@ module Utils if before.nil? && after.nil? yield s else - after = after.to_s if Symbol === after + after = after.to_s if after.is_a? Symbol s.gsub!(before, after, audit_result) end @@ -33,7 +33,7 @@ module Utils Pathname(path).atomic_write(s) end - raise InreplaceError.new(errors) unless errors.empty? + raise InreplaceError, errors unless errors.empty? end module_function :inreplace end |
