From ecf46b841b24fe650504a7388f25d1093189a09d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 11 Sep 2016 17:47:04 +0100 Subject: [PATCH] utils/inreplace: fix Rubocop warnings. --- Library/Homebrew/utils/inreplace.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 9978b02fe7..c7557ab41d 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