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:
It's searching for the presence of one of the Danish characters in any ruby file that doesn't have the
Anyway, the command is here in case you 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.
About Calvin Correli
I've spent the last 17 years learning, growing, healing, and discovering who I truly am, so that I'm now living every day aligned with my life's purpose.
0 comments
Leave a comment