Skip to content
Snippets Groups Projects
Commit cb69f339 authored by Jack Nagel's avatar Jack Nagel
Browse files

Intercept calls to sub! in inreplace blocks

parent 50b900da
No related branches found
No related tags found
No related merge requests found
......@@ -56,13 +56,21 @@ end
# used by the inreplace function (in utils.rb)
module StringInreplaceExtension
def sub! before, after
result = super
unless result
opoo "inreplace: replacement of '#{before}' with '#{after}' failed"
end
result
end
# Warn if nothing was replaced
def gsub! before, after, audit_result=true
sub = super(before, after)
if audit_result and sub.nil?
result = super(before, after)
if audit_result && result.nil?
opoo "inreplace: replacement of '#{before}' with '#{after}' failed"
end
return sub
result
end
# Looks for Makefile style variable defintions and replaces the
......
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