Class: Ruby::Nginx::Commands::StopNginx
- Inherits:
-
TerminalCommand
- Object
- TerminalCommand
- Ruby::Nginx::Commands::StopNginx
- Defined in:
- lib/ruby/nginx/commands/stop_nginx.rb
Instance Attribute Summary
Attributes inherited from TerminalCommand
#cmd, #error_type, #printer, #result, #user
Instance Method Summary collapse
-
#initialize(sudo: false) ⇒ StopNginx
constructor
A new instance of StopNginx.
- #run ⇒ Object
Methods included from Helpers::SudoHelper
Methods included from Helpers::PromptHelper
Constructor Details
#initialize(sudo: false) ⇒ StopNginx
Returns a new instance of StopNginx.
9 10 11 12 13 14 |
# File 'lib/ruby/nginx/commands/stop_nginx.rb', line 9 def initialize(sudo: false) @sudo = sudo sudo_reason = "Allow sudo elevation to stop NGINX?" super(cmd: sudoify("nginx -s stop", sudo, sudo_reason), raise: Ruby::Nginx::StopError) end |