Adding newlines to end of files
Replacing all ^ and $ in regexes with \A and \z for Rails4 compatibility