Class: PryBot::Server

Inherits:
Object show all
Defined in:
lib/server.rb

Class Method Summary collapse

Class Method Details

.run(object) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/server.rb', line 6

def self.run(object)
  shared_io = PryBot::SharedIO.new
  DRb.start_service 'druby://:9000', shared_io
  
  # Startup PRY
  Pry.color = false
  Pry.pager = false
  pry = Pry.start(object, :input => shared_io.input_proxy, :output => shared_io.output_proxy)

  # Kill PRY
  DRb.thread.join
  trap("INT") { DRb.stop_service }
end