Class: Ruby::Nginx::Commands::InstallNginx
- Inherits:
-
TerminalCommand
- Object
- TerminalCommand
- Ruby::Nginx::Commands::InstallNginx
- Defined in:
- lib/ruby/nginx/commands/install_nginx.rb
Instance Attribute Summary
Attributes inherited from TerminalCommand
#cmd, #error_type, #printer, #result, #user
Instance Method Summary collapse
-
#initialize ⇒ InstallNginx
constructor
A new instance of InstallNginx.
- #run ⇒ Object
Methods included from Helpers::SudoHelper
Methods included from Helpers::PromptHelper
Constructor Details
#initialize ⇒ InstallNginx
Returns a new instance of InstallNginx.
10 11 12 |
# File 'lib/ruby/nginx/commands/install_nginx.rb', line 10 def initialize super(cmd: resolve_command, raise: Ruby::Nginx::InstallError, printer: :pretty) end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby/nginx/commands/install_nginx.rb', line 14 def run return if installed? puts "\e[0;33m#{cmd}\e[0m" if yes?("Would you like to install NGINX?") super else raise Ruby::Nginx::AbortError, "NGINX is required to continue. Please install NGINX." end end |