class Bundler::Thor::Actions::InjectIntoFile
def replace!(regexp, string, force)
Adds the content to the file.
def replace!(regexp, string, force) return if pretend? content = File.read(destination) if force || !content.include?(replacement) success = content.gsub!(regexp, string) File.open(destination, "wb") { |file| file.write(content) } success end end