Skip to content

Commit

Permalink
Bring conditions back to start with pry-byebug
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSepehri committed Aug 16, 2022
1 parent 1b98163 commit 7910609
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Master (Unreleased)

## 3.10.1 (2022-08-16)

### Fixed

* Rails console loading a debugger REPL instead of the standard Pry REPL(#392)

## 3.10.0 (2022-08-15)

### Added
Expand Down
11 changes: 9 additions & 2 deletions lib/pry-byebug/pry_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
class << Pry::REPL
alias start_without_pry_byebug start

def start_with_pry_byebug(_ = {})
Byebug::PryProcessor.start unless ENV["DISABLE_PRY"]
def start_with_pry_byebug(options = {})
target = options[:target]

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(options)
end
end

alias start start_with_pry_byebug
Expand Down

0 comments on commit 7910609

Please sign in to comment.