Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work with pry 0.14 #386

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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