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

Lazy loading of Byebug #166

Closed
bquorning opened this issue Aug 20, 2015 · 1 comment
Closed

Lazy loading of Byebug #166

bquorning opened this issue Aug 20, 2015 · 1 comment

Comments

@bquorning
Copy link
Contributor

I’m working on a project where we like to always have Byebug available in our test suite. But calling require 'byebug' in our spec helper adds 160ms to our RSpec startup time. And we want that number to be as low as possible.

Therefore, in our spec helper, I have defined this little hack:

def byebug
  require 'byebug'
  super
end

I’m wondering if we could implement something similar in Byebug itself, so I could just call something like require 'byebug/lazy' instead of the hack above?

@deivid-rodriguez
Copy link
Owner

Hi @bquorning. I understand your request. I have a macro in my editor myself that expands debug to require 'byebug'; byebug. :)

Perhaps we could even do this by default. require 'byebug' would just monkeypatch Kernel with the byebug method, and requiring the whole of byebug would be done inside the method.

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