Class: Binding

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

Instance Method Summary collapse

Instance Method Details

#_irb(_host = nil) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/pryx/pry_hack.rb', line 33

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

  IRB.conf[:USE_COLORIZE] = false

  self.irb
end

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



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/pryx/pry_hack.rb', line 6

def _pry(host=nil, port=nil, options={})
  if host
    require 'pry-remote'
  else
    require 'pry'
  end
  require 'pryx/ap_hack'
  require 'pryx/break_hack'
  # 这个必须在最后才有效, 但是目前存在一个问题,就是会将 pry3, pry! 加入 stacks
  require 'pry-stack_explorer'

  Pry::Commands.block_command 'cc', 'Continue, but stop in pry! breakpoint' do
    Pry.instance_variable_set(:@initial_session, true)
    ENV['Pry_was_started'] = nil
    throw(:breakout)
  end

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