add_breakpoint

in lib/pry-byebug/commands/breakpoint.rb [110:133]


    def add_breakpoint(place, condition)
      case place
      when /^(\d+)$/
        errmsg = "Line number declaration valid only in a file context."
        PryByebug.check_file_context(target, errmsg)

        lineno = Regexp.last_match[1].to_i
        breakpoints.add_file(current_file, lineno, condition)
      when /^(.+):(\d+)$/
        file = Regexp.last_match[1]
        lineno = Regexp.last_match[2].to_i
        breakpoints.add_file(file, lineno, condition)
      when /^(.*)[.
        if Regexp.last_match[1].strip.empty?
          errmsg = "Method name declaration valid only in a file context."
          PryByebug.check_file_context(target, errmsg)
          place = target.eval("self.class.to_s") + place
        end
        breakpoints.add_method(place, condition)
      else
        raise(ArgumentError, "Cannot identify arguments as breakpoint")
      end
    end