Class: Ungodly::GodManager
- Inherits:
-
Object
- Object
- Ungodly::GodManager
- Defined in:
- lib/ungodly.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
Returns the value of attribute config_path.
-
#env ⇒ Object
Returns the value of attribute env.
-
#god_path ⇒ Object
Returns the value of attribute god_path.
-
#managed_pid_dir ⇒ Object
Returns the value of attribute managed_pid_dir.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
- #config_path_param ⇒ Object
-
#env_param ⇒ Object
Helper methods for generating fragments of god commands.
- #god_exec_param ⇒ Object
-
#initialize(options = {}) ⇒ GodManager
constructor
A new instance of GodManager.
-
#launch_cmd ⇒ Object
Helper methods for generating god commands.
- #managed_pid_dir_param ⇒ Object
- #port_param ⇒ Object
- #status_cmd ⇒ Object
- #terminate_cmd ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ GodManager
Returns a new instance of GodManager.
29 30 31 32 33 34 35 36 37 |
# File 'lib/ungodly.rb', line 29 def initialize( = {}) @env = [:env] @god_path = [:god_path] @port = [:port] @managed_pid_dir = [:managed_pid_dir] @config_path = [:config_path] end |
Instance Attribute Details
#config_path ⇒ Object
Returns the value of attribute config_path.
27 28 29 |
# File 'lib/ungodly.rb', line 27 def config_path @config_path end |
#env ⇒ Object
Returns the value of attribute env.
26 27 28 |
# File 'lib/ungodly.rb', line 26 def env @env end |
#god_path ⇒ Object
Returns the value of attribute god_path.
26 27 28 |
# File 'lib/ungodly.rb', line 26 def god_path @god_path end |
#managed_pid_dir ⇒ Object
Returns the value of attribute managed_pid_dir.
27 28 29 |
# File 'lib/ungodly.rb', line 27 def managed_pid_dir @managed_pid_dir end |
#port ⇒ Object
Returns the value of attribute port.
27 28 29 |
# File 'lib/ungodly.rb', line 27 def port @port end |
Instance Method Details
#config_path_param ⇒ Object
57 58 59 |
# File 'lib/ungodly.rb', line 57 def config_path_param (config_path) ? ["-c", config_path] : [] end |
#env_param ⇒ Object
Helper methods for generating fragments of god commands
41 42 43 |
# File 'lib/ungodly.rb', line 41 def env_param (env) ? [env] : [] end |
#god_exec_param ⇒ Object
45 46 47 |
# File 'lib/ungodly.rb', line 45 def god_exec_param [god_path || "god"] end |
#launch_cmd ⇒ Object
Helper methods for generating god commands
64 65 66 |
# File 'lib/ungodly.rb', line 64 def launch_cmd env_param + god_exec_param + port_param + managed_pid_dir_param + config_path_param end |
#managed_pid_dir_param ⇒ Object
53 54 55 |
# File 'lib/ungodly.rb', line 53 def managed_pid_dir_param (managed_pid_dir) ? ["--managed-pid-dir", managed_pid_dir] : [] end |
#port_param ⇒ Object
49 50 51 |
# File 'lib/ungodly.rb', line 49 def port_param (port) ? ["-p", port.to_s] : [] end |
#status_cmd ⇒ Object
72 73 74 |
# File 'lib/ungodly.rb', line 72 def status_cmd env_param + god_exec_param + port_param + ["status"] end |
#terminate_cmd ⇒ Object
68 69 70 |
# File 'lib/ungodly.rb', line 68 def terminate_cmd env_param + god_exec_param + port_param + ["terminate"] end |