Class: Binding

Inherits:
Object show all
Defined in:
lib/pryx/pry_hack.rb,
lib/pryx/irb_hack.rb

Overview

注意如果开启 pry-stack_explorer, 就不要使用 debugger, 因为进入新的上下文后, pry-stack_explorer 将失效.

Instance Method Summary collapse

Instance Method Details

#_irb(_host = nil) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/pryx/irb_hack.rb', line 2

def _irb(_host=nil)
  warn 'loading irb ...'

  require 'pryx/common_plugins'

  self.irb
end

#_pry(host: nil, port: nil, options: {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/pryx/pry_hack.rb', line 4

def _pry(host: nil, port: nil, options: {})
  if host
    require 'pry-remote'
  else
    require 'pry'
  end

  require 'pryx/common_plugins'

  # NOTICE: Ensure pry-navs (in pry_plugins) always required after pry-remote
  require 'pryx/pry_plugins'

  if host
    notify_send('loading remote pry ...')
    # remote_pry(host, port, options) if Pry.initial_session?
    self.remote_pry(host, port, options)
  else
    warn 'loading pry ...'
    self.pry
  end
end