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 2aa2362
Showing 1 changed file with 9 additions and 2 deletions.
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 2aa2362

Please sign in to comment.