Hi, I want pry rescue to always work no matter how pry is loaded. It would be great if I could just do something in my pryrc to activate pry rescue at runtime. The following code works but it's not very elegant. Is there a better way?
begin
require 'pry-rescue'
Pry.config.hooks.add_hook(:before_eval, :save_me) do |code, _pry|
code.replace("Pry::rescue do\n\n#{code}\n\nend")
end
rescue LoadError => err
puts "no pry-rescue :("
end
Hi, I want pry rescue to always work no matter how pry is loaded. It would be great if I could just do something in my pryrc to activate pry rescue at runtime. The following code works but it's not very elegant. Is there a better way?