Skip to content

Commit

Permalink
Work with pry 0.14 (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Aug 15, 2022
1 parent 20e02f2 commit 7759fe9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -4,7 +4,7 @@

### Added

* Support for pry 0.14.0 (#346).
* Support for pry 0.14 (#346, #386). NOTE: pry-byebug now needs to be explicitly required from `~/.pryrc` since plugin autoloading has been removed from Pry.

### Removed

Expand Down
4 changes: 2 additions & 2 deletions lib/byebug/processors/pry_processor.rb
Expand Up @@ -17,7 +17,7 @@ def self.start
Byebug.start
Setting[:autolist] = false
Context.processor = self
Byebug.current_context.step_out(4, true)
Byebug.current_context.step_out(5, true)
end

#
Expand Down Expand Up @@ -106,7 +106,7 @@ def resume_pry
if defined?(@pry) && @pry
@pry.repl(new_binding)
else
@pry = Pry.start_without_pry_byebug(new_binding)
@pry = Pry::REPL.start_without_pry_byebug(target: new_binding)
end
end
end
Expand Down
11 changes: 3 additions & 8 deletions lib/pry-byebug/pry_ext.rb
Expand Up @@ -2,16 +2,11 @@

require "byebug/processors/pry_processor"

class << Pry
class << Pry::REPL
alias start_without_pry_byebug start

def start_with_pry_byebug(target = TOPLEVEL_BINDING, options = {})
if target.is_a?(Binding) && PryByebug.file_context?(target)
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
else
# No need for the tracer unless we have a file context to step through
start_without_pry_byebug(target, options)
end
def start_with_pry_byebug(_ = {})
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
end

alias start start_with_pry_byebug
Expand Down

0 comments on commit 7759fe9

Please sign in to comment.