From 183e191aef0459ea87934f64e4de79cf9066fa1d Mon Sep 17 00:00:00 2001 From: tzmfreedom Date: Wed, 22 Aug 2018 01:16:37 +0900 Subject: [PATCH] clear hooks on pry version > 0.11.x not to display source code --- lib/better_errors/repl/pry.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/better_errors/repl/pry.rb b/lib/better_errors/repl/pry.rb index 4390ec7e..a4c0842c 100644 --- a/lib/better_errors/repl/pry.rb +++ b/lib/better_errors/repl/pry.rb @@ -43,7 +43,8 @@ def initialize(binding, exception) @input = BetterErrors::REPL::Pry::Input.new @output = BetterErrors::REPL::Pry::Output.new @pry = ::Pry.new input: @input, output: @output - @pry.hooks.clear_all if defined?(@pry.hooks.clear_all) + @pry.hooks.clear_event_hooks(:before_session) if @pry.hooks.respond_to?(:clear_event_hooks) # pry version >= 0.11.x + @pry.hooks.clear_all if @pry.hooks.respond_to?(:clear_all) # pry version <= 0.10.x store_last_exception exception @fiber.resume end