An Interest In:
Web News this Week
- March 21, 2024
- March 20, 2024
- March 19, 2024
- March 18, 2024
- March 17, 2024
- March 16, 2024
- March 15, 2024
Search and debug gems with `bundle open`
Ever get frustrated trying to search through code on GitHub? Or wish you could put a breakpoint in a gem so you could figure out what it was doing?
Dont mess around with cloning the gem repo or monkey patching code in your own app. Use bundle open
instead.
Usage
In your shell, run the command: bundle open GEM_NAME
bundler
will open the source code for the exact version of the gem youve got installed in your editor. You can search the code inside your editor and even add breakpoints or make code changes locally to test out things.
Options
The bundle open
command launches the editor that youve set via the EDITOR
or BUNDLER_EDITOR
environment variables. You can set this to be vim
, emacs
, VS Code
, or whatever tool you like to use.
If youve made changes to the local gems for debugging or experimental purposes, you can use the bundle pristine
command to restore your gems to their original state.
Additional Resources
Bundler Docs: bundle open
Bundler Docs: bundle pristine
Original Link: https://dev.to/swanson/search-and-debug-gems-with-bundle-open-3fbg
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To