thekompanee / fuubar

The instafailing RSpec progress bar formatter
http://jeffkreeftmeijer.com/2010/fuubar-the-instafailing-rspec-progress-bar-formatter/
MIT License
955 stars 65 forks source link

Change: Stop Auto-Refresh When A Pry Session Starts #114

Closed jfelchner closed 5 years ago

jfelchner commented 5 years ago

Why This Change Is Necessary

The problem with #105 was that the Pry-related code was running as soon as the fuubar gem got loaded, which can be before Pry is defined (if the pry gem gets loaded later).

Note: In general, having fuubar depend on any externally loaded libraries is undesirable. Because each individual installation can have an infinite combination of gems, how those gems interact should be left to the user (within reason).

How These Changes Address the Issue

We remove all of the Pry hooks and then add documentation how the user can enable auto-refresh using Pry's debugger.

We then disable auto-refresh by default and allow the user to opt-in to potentially surprising behavior rather than having to opt-out of it.

Side Effects Caused By This Change

Prior users who depend on auto-refresh may be surprised that it no longer does it.

Caveats

There still is at least one limitation: if the pry gem is added to the Gemfile with the option require: false, then required too late for Fuubar to know, then the hooks will not be added, and auto-refresh will keep happening when the Pry session opens.


My Tracker Issue URLs:

github-actions[bot] commented 3 years ago

This issue has been closed automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.