Skip to content

Commit

Permalink
allow break-ing on REPL-defined methods
Browse files Browse the repository at this point in the history
  • Loading branch information
banister committed Oct 31, 2012
1 parent 674e0b2 commit 4756121
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/pry-debugger/breakpoints.rb
Expand Up @@ -10,11 +10,15 @@ module Breakpoints

# Add a new breakpoint.
def add(file, line, expression = nil)
raise ArgumentError, 'Invalid file!' unless File.exist?(file)
if !File.exist?(file) && file != Pry.eval_path
raise ArgumentError, 'Invalid file!' unless File.exist?(file)
end
validate_expression expression

Pry.processor.debugging = true
Debugger.add_breakpoint(File.expand_path(file), line, expression)

path = file == Pry.eval_path ? file : File.expand_path(file)
Debugger.add_breakpoint(path, line, expression)
end

# Change the conditional expression for a breakpoint.
Expand Down

0 comments on commit 4756121

Please sign in to comment.