Module: Utils::IRB::Service

Defined in:
lib/utils/irb/service.rb

Defined Under Namespace

Classes: Proxy

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.hostnameObject

Returns the value of attribute hostname


5
6
7
# File 'lib/utils/irb/service.rb', line 5

def hostname
  @hostname
end

.portObject

Returns the value of attribute port


7
8
9
# File 'lib/utils/irb/service.rb', line 7

def port
  @port
end

Class Method Details

.connect(uri = nil) ⇒ Object


16
17
18
19
20
# File 'lib/utils/irb/service.rb', line 16

def connect(uri = nil)
  uri ||= "druby://localhost:6642"
  irb = DRbObject.new_with_uri(uri)
  Proxy.new(irb)
end

.start(uri = nil, &block) ⇒ Object


9
10
11
12
13
14
# File 'lib/utils/irb/service.rb', line 9

def start(uri = nil, &block)
  uri ||= "druby://localhost:6642"
  block    ||= proc {}
  puts "Starting IRB server listening to #{uri.inspect}."
  DRb.start_service(uri, eval('irb_current_working_binding', block.binding))
end