Find all ruby files with special characters that don't yet have the # encoding magic comment set

I'm playing with upgrading zenbilling to Ruby 1.9.3, and need to add the magic encoding comment to the source files that need it.

Here's my poor man's way of doing it in the shell:

grep "[ÆØÅæøå]" `grep -rL "^# encoding" ./**/*.rb`

It's searching for the presence of one of the Danish characters in any ruby file that doesn't have the # encoding magic comment. I guess I could've also just added the comment to all files. I didn't.

Anyway, the command is here in case you need it.

A heckuva job


There are no comments yet. Be the first one to leave a comment!

Leave a comment