module PryByebug

Main container module for Pry-Byebug functionality

Main container module for Pry-Byebug functionality

Constants

VERSION

Attributes

current_remote_server[RW]

Reference to currently running pry-remote server. Used by the processor.

Public Class Methods

check_file_context(target, e = nil) click to toggle source

Ensures that a command is executed in a local file context.

# File lib/pry-byebug/base.rb, line 17
def check_file_context(target, e = nil)
  e ||= "Cannot find local context. Did you use `binding.pry`?"
  raise(Pry::CommandError, e) unless file_context?(target)
end
file_context?(target) click to toggle source

Checks that a target binding is in a local file context.

# File lib/pry-byebug/base.rb, line 8
def file_context?(target)
  file = target.eval("__FILE__")
  file == Pry.eval_path || !Pry::Helpers::BaseHelpers.not_a_real_file?(file)
end

Private Instance Methods

check_file_context(target, e = nil) click to toggle source

Ensures that a command is executed in a local file context.

# File lib/pry-byebug/base.rb, line 17
def check_file_context(target, e = nil)
  e ||= "Cannot find local context. Did you use `binding.pry`?"
  raise(Pry::CommandError, e) unless file_context?(target)
end
file_context?(target) click to toggle source

Checks that a target binding is in a local file context.

# File lib/pry-byebug/base.rb, line 8
def file_context?(target)
  file = target.eval("__FILE__")
  file == Pry.eval_path || !Pry::Helpers::BaseHelpers.not_a_real_file?(file)
end