aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils/inreplace.rb
diff options
context:
space:
mode:
authorMike McQuaid2016-09-12 08:09:00 +0100
committerGitHub2016-09-12 08:09:00 +0100
commit9a6999c30276a05c0bfc89f03b91dea4371ed407 (patch)
tree80c15a5d370974edf5ed89e8b6b63c3f3045ebd2 /Library/Homebrew/utils/inreplace.rb
parentb93b60e6ca3d609267fd20f35c63527552f10f19 (diff)
parent94f763e9c7c7efa1a22a28a2d4c74fa5fcbe4771 (diff)
downloadbrew-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.rb8
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