Class: RMB::ListenerClient
- Inherits:
-
Object
- Object
- RMB::ListenerClient
- Defined in:
- lib/listener_client.rb
Overview
This code is called from the client application. It starts/stops the daemon via a control script
Instance Method Summary collapse
- #app_name ⇒ Object
- #control(action) ⇒ Object
-
#initialize(hash) ⇒ ListenerClient
constructor
A new instance of ListenerClient.
- #properties ⇒ Object
- #properties=(hash) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(hash) ⇒ ListenerClient
Returns a new instance of ListenerClient.
8 9 10 |
# File 'lib/listener_client.rb', line 8 def initialize(hash) @hash = hash end |
Instance Method Details
#app_name ⇒ Object
27 28 29 |
# File 'lib/listener_client.rb', line 27 def app_name @hash[:daemon_options][:app_name] end |
#control(action) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/listener_client.rb', line 20 def control(action) setup control_script = "ruby #{File.dirname(__FILE__)}/#{RMB::Properties.daemon_prefix}control.rb #{action}" control_params = "#{@hash[:working_dir]} #{@hash[:key]}" system("#{control_script} #{control_params} -- #{control_params}") end |
#properties ⇒ Object
35 36 37 |
# File 'lib/listener_client.rb', line 35 def properties @hash end |
#properties=(hash) ⇒ Object
31 32 33 |
# File 'lib/listener_client.rb', line 31 def properties=(hash) @hash=hash end |
#start ⇒ Object
12 13 14 |
# File 'lib/listener_client.rb', line 12 def start control('start') end |
#stop ⇒ Object
16 17 18 |
# File 'lib/listener_client.rb', line 16 def stop control('stop') end |