Class: Ruby::Nginx::Commands::InstallMkcert
- Inherits:
-
TerminalCommand
- Object
- TerminalCommand
- Ruby::Nginx::Commands::InstallMkcert
- Defined in:
- lib/ruby/nginx/commands/install_mkcert.rb
Instance Attribute Summary
Attributes inherited from TerminalCommand
#cmd, #error_type, #printer, #result, #user
Instance Method Summary collapse
-
#initialize ⇒ InstallMkcert
constructor
A new instance of InstallMkcert.
- #run ⇒ Object
Methods included from Helpers::SudoHelper
Methods included from Helpers::PromptHelper
Constructor Details
#initialize ⇒ InstallMkcert
Returns a new instance of InstallMkcert.
10 11 12 |
# File 'lib/ruby/nginx/commands/install_mkcert.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_mkcert.rb', line 14 def run return if installed? puts "\e[0;33m#{cmd}\e[0m" if yes?("Would you like to install mkcert?") super else raise Ruby::Nginx::AbortError, "mkcert is required to continue. Please install mkcert." end end |