class Thor::Actions::InjectIntoFile
def replace!(regexp, string)
Adds the content to the file.
def replace!(regexp, string) unless base.options[:pretend] content = File.read(destination) content.gsub!(regexp, string) File.open(destination, 'wb') { |file| file.write(content) } end end