Class: Servitude::Cli::Service
- Defined in:
- lib/servitude/cli/service.rb
Class Method Summary collapse
- .common_start_options ⇒ Object
- .environment_option ⇒ Object
- .handle_no_command_error(name) ⇒ Object
- .pid_option ⇒ Object
Instance Method Summary collapse
Class Method Details
.common_start_options ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/servitude/cli/service.rb', line 13 def self. method_option :config, type: :string, aliases: '-c', desc: "The path for the config file", default: Servitude::DEFAULT_CONFIG_PATH environment_option method_option :log_level, desc: "The log level", type: :string, aliases: '-o' method_option :log, desc: "The path for the log file", type: :string, aliases: '-l' method_option :threads, desc: "The number of threads", type: :numeric, aliases: '-t' end |
.environment_option ⇒ Object
5 6 7 |
# File 'lib/servitude/cli/service.rb', line 5 def self.environment_option method_option :environment, desc: "The environment to execute in", type: :string, aliases: '-e' end |
.handle_no_command_error(name) ⇒ Object
80 81 82 |
# File 'lib/servitude/cli/service.rb', line 80 def self.handle_no_command_error( name ) puts "Unrecognized command: #{name}" end |
.pid_option ⇒ Object
9 10 11 |
# File 'lib/servitude/cli/service.rb', line 9 def self.pid_option method_option :pid, desc: "The path for the PID file", type: :string end |
Instance Method Details
#restart ⇒ Object
24 25 26 27 |
# File 'lib/servitude/cli/service.rb', line 24 def restart stop start_daemon end |
#start ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/servitude/cli/service.rb', line 33 def start if [:interactive] start_interactive else start_daemon end end |