Class: PostSetupHandlers::PryRemoteServer

Inherits:
Object
  • Object
show all
Defined in:
lib/gamebox/post_setup_handlers/pry_remote_server.rb

Class Method Summary collapse

Class Method Details

.setup(argv, env, config) ⇒ Object



3
4
5
# File 'lib/gamebox/post_setup_handlers/pry_remote_server.rb', line 3

def self.setup(argv,env,config)
  start_remote_pry if config[:debug] or argv.include?('--debug')
end

.start_remote_pryObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/gamebox/post_setup_handlers/pry_remote_server.rb', line 7

def self.start_remote_pry
  log "Pry Remote Server started!"

  Thread.abort_on_exception = true

  Thread.new do
    loop do
      begin
        if th = DRb.thread
          th.kill
        end

        binding.remote_pry
        log "remote_pry returned"
      rescue Exception => e
        log "finished remote pry"
      end
    end
  end

end