Module: PryByebug

Defined in:
lib/pry-byebug/base.rb,
lib/pry-byebug/version.rb

Overview

Main container module for Pry-Byebug functionality

Constant Summary collapse

VERSION =
'3.1.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#current_remote_serverObject

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



24
25
26
# File 'lib/pry-byebug/base.rb', line 24

def current_remote_server
  @current_remote_server
end

Class Method Details

.check_file_context(target, e = nil) ⇒ Object

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



17
18
19
20
# 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`?'
  fail(Pry::CommandError, e) unless file_context?(target)
end

.file_context?(target) ⇒ Boolean

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

Returns:

  • (Boolean)


8
9
10
11
# 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