This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
replace!(regexp, string, force)
protected
Adds the content to the file.
# File lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb, line 99
def replace!(regexp, string, force)
return if pretend?
content = File.read(destination)
if force || !content.include?(replacement)
content.gsub!(regexp, string)
File.open(destination, "wb") { |file| file.write(content) }
end
end