You can do this with grep directly if you want
grep -r 'OPTIMIZE:\|FIXME:\|TODO:' public/javascripts
If you need only TODO
grep -r 'TODO:' public/javascripts # Find on todos
You can use the following to search for all js in a project, not just files under open javascripts.
grep -r 'OPTIMIZE:\|FIXME:\|TODO:' **/*.js
Here's how you can turn this into a rake challenge.
# File lib/tasks/notes.rake namespace :notes do task :js do puts `grep -r 'OPTIMIZE:\\|FIXME:\\|TODO:' public/javascripts` end end
Now you can run rake notes:js from the root of the project.
source share