Show HN: pry-rescue — workflow-optimized debugging for ruby
1–10 of 31 posts
Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#2Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#3Thanks for this. How would I use it in Rails? Any tips for integration?
class ApplicationController
I'm hoping to get a Rack middleware out at some point; which will make this even easier.Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#4Thanks for this. How would I use it in Rails? Any tips for integration?
In rails you can just do: class ApplicationController I'm hoping to get a Rack middleware out at some point; which will make this even easier.
pry_rescue.rb
require 'pry/rescue'
class PryRescue
def initialize(app)
@app = app
end
def call(env)
Pry::rescue{ @app.call(env) }
end
end
For rails you need to require the file and use the middleware... application.rb
config.middleware.use "PryRescue"Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#5Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#6The pry console gives you access to the method that raised the exception, you can use it to inspect the values of variables (no more print statements!), the source code of methods (no more flapping around with a text editor!), and even move up and down the call stack (like a real debugger!).
Basically what we were doing in Smalltalk for decades and trying to tell people about. (To a remarkable degree of push-back and vitriol.) Many years ago, one of our community pointed out that while it lost out as a mainstream platform, Smalltalk actually won the war of ideas. (It's taking quite a long time for everyone else to catch up, however. People keep thinking they've gotten there when they're still a good 1/3rd short.)
Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#7Are there any difference to https://github.com/pry/pry-exception_explorer ?
The only technical difference is that pry-rescue can catch exceptions raised at the C level (like NoMethodError, or ZeroDivisionError); but pry-rescue also has a much easier-to-learn API/UI. (Particularly, by only supporting catching unhandled exceptions, pry-rescue can avoid the need to predicate on which exceptions should be handled).
Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#8Re: Show HN: pry-rescue — workflow-optimized debugging for ruby
#9Are there any difference to https://github.com/pry/pry-exception_explorer ?