Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wiki Outdated? #174

Open
stdedos opened this issue May 12, 2018 · 3 comments
Open

Wiki Outdated? #174

stdedos opened this issue May 12, 2018 · 3 comments

Comments

@stdedos
Copy link

stdedos commented May 12, 2018

https://github.com/deivid-rodriguez/pry-byebug/wiki/Using-pry-byebug-inline

I haven't required 'pry' since I started using the plugin.

I could obviously fix it myself, I wanted to ask first though. I am not sure if there is any reason to keep the page, other than quick code example

@kriansa
Copy link

kriansa commented Mar 26, 2020

It depends on how you use it. If you use it with Rails, then you added it to the Gemfile and Rails automatically loads all dependencies on boot, therefore you don't need to manually require it.

If you use it elsewhere then you still need to manually require it.

@stdedos
Copy link
Author

stdedos commented Mar 26, 2020

I've added it to the Gemfile, as I would add any Python dependency to requirements.txt

But I am not using Rails, no.

@kriansa
Copy link

kriansa commented Mar 26, 2020

It was unfair to say that Rails is the only tool that automatically does it. Many frameworks do.

In fact, this isn't about any framework. It's just Bundler. In your code, somewhere, there's either a call to a require 'pry' (which I doubt, as you said yourself, you didn't find any), or a call to Bundler.require (most probable).

You can test it yourself by creating an empty project and adding 'pry' to the Gemfile. It won't load automatically, unless you require pry manually or call:

require 'bundler'
Bundler.require(:default)

You can read more about this here. As a side note, requiring any gem is just done once, so even if you execute require more than once, you don't need to worry because it will only be loaded on the first time you called.

I've added it to the Gemfile, as I would add any Python dependency to requirements.txt

I once worked in a team where people had multiple debugging tools and not all of them used pry (some used Rubymine's, for instance) and therefore we decided not to add it to the Gemfile, and people had to manually install their debugging tool of preference. 🤷‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants