I'm getting a warning on my console that i'd like to resolve. The problem is that i'm not sure which gem is causing this warning. What is the best way to search through the source for all the gems for a specific project.
Thanks
The accepted answer will search through all gems installed on your system, possibly including ones that aren't actually dependencies.
To search only through actual dependencies of your app, not just any installed gem, from the app root dir:
grep -r "escape_javascript" $(bundle show --paths) .
The .
on the end will make sure to search your actual app too, not only it's dependencies. If that's what you want.
From http://hectorcorrea.com/blog/bundle-grep-and-rails-applications/68
I usually do the following:
cd `bundle show rails` # Go to the directory having rails gem content
cd .. # Go one level up to the folder having all gems
grep -ir escape_javascript * # search for the required text in all files
> actionview-4.1.6/lib/action_view/helpers/javascript_helper.rb: def escape_javascript(javascript)
> actionview-4.1.6/lib/action_view/helpers/javascript_helper.rb: alias_method :j, :escape_javascript
EDIT: The answer below by jrochkind is the correct answer; my answer is incorrect as it searches through all the gems installed in the system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With