Comments (5)
@joshuay03 That's what I mean, yes. It was quite useful in a Rails setting.
from debug.
Pry has another command called
disable_pry
, which will exit the current session and disable all the later breakpoints. Looks like this is what the author is looking for?
Not OP, but it would be great if debug had something similar to disable-pry
. We just switched from using pry to debug in our Rails monolith and that seems to be one of the features that's "missing". I'm planning on implementing a temporary solution in our codebase, but it's not ideal...
Hack
module Kernel
mattr_accessor :debugger_method, instance_accessor: false
def disable_debug
return unless Kernel.respond_to?(:debugger)
Kernel.debugger_method = method(:debugger)
Kernel.define_method(:debugger) { nil }
nil
end
def enable_debug
return unless Kernel.debugger_method
Kernel.define_method(:debugger, Kernel.debugger_method)
Kernel.debugger_method = nil
nil
end
end
from debug.
does it mean disable all breakpoints?
from debug.
Since !!!
calls Kernel.exit
underneath, I think the equivalent here is simply typing exit
.
Pry has another command called disable_pry
, which will exit the current session and disable all the later breakpoints. Looks like this is what the author is looking for?
from debug.
Having played with debug
a bit more, I think I now understand what OP meant.
In pry
, !!!
would exit
, but then on a subsequent request, execution would halt at a breakpoint again. With debug
however, once you exit
(at least when using it with Rails + puma), you need to restart the server to hit another breakpoint.
If for example you're stuck in a loop, with pry
you can use !!!
, remove your breakpoint and refresh the page. And if you put a breakpoint back in, and continue making requests, it'll halt as usual. But that's not the case with debug
...
from debug.
Related Issues (20)
- binding.b doesn't stop code on second controller request and above
- History not available
- Setting the irb_console configuration true has no effect HOT 1
- <enter> does not repeat last command in irb_console mode.
- Proposal: reverse continue
- Feat/Bug: Set the value of `_` (underscore) to the value of the last ruby expression HOT 3
- Slow print (STDOUT) of large objects
- Question: Could not load source 'Fastfile': not found, while debugging a Fastlane lane from VSCODE
- Remove usage of deprecated constant IRB::InputCompletor
- Large data output HOT 1
- Add a shorter alias for the whereami command HOT 1
- Could not find valid gem HOT 1
- Cut a new release for the Rails stdin bug HOT 2
- Keystrokes between `debugger` sessions seem to persist HOT 4
- after_fork_parent method waits for all child processes to stop HOT 2
- Having to specify bundle exec twice HOT 2
- The console become frozen while debugging in Rails HOT 1
- `list -` doesn't work with IRB console HOT 2
- Segmentation Fault Crash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debug.