Skip to content

Commit

Permalink
clear hooks on pry version > 0.11.x not to display source code
Browse files Browse the repository at this point in the history
  • Loading branch information
tzmfreedom committed Aug 23, 2018
1 parent 946281d commit 183e191
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/better_errors/repl/pry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 183e191

Please sign in to comment.