diff options
| author | Mike McQuaid | 2016-09-12 08:09:00 +0100 |
|---|---|---|
| committer | GitHub | 2016-09-12 08:09:00 +0100 |
| commit | 9a6999c30276a05c0bfc89f03b91dea4371ed407 (patch) | |
| tree | 80c15a5d370974edf5ed89e8b6b63c3f3045ebd2 /Library/Homebrew/utils/inreplace.rb | |
| parent | b93b60e6ca3d609267fd20f35c63527552f10f19 (diff) | |
| parent | 94f763e9c7c7efa1a22a28a2d4c74fa5fcbe4771 (diff) | |
| download | brew-9a6999c30276a05c0bfc89f03b91dea4371ed407.tar.bz2 | |
Merge pull request #925 from MikeMcQuaid/utils-rubocop
Fix Library/Homebrew/utils RuboCop warnings
Diffstat (limited to 'Library/Homebrew/utils/inreplace.rb')
| -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 |
