Skip to content
Snippets Groups Projects
Commit ecf46b84 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

utils/inreplace: fix Rubocop warnings.

parent 1f2abbdd
No related branches found
No related tags found
No related merge requests found
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment