Regular Expressions can be used to make this method more precise. You can also use append_file and prepend_file in the same way to place code at the beginning and end of a file respectively.
h4. +application+
Adds a line to +config/application.rb+ directly after the application class definition.