Class: Ruby::Nginx::Commands::NginxOptions

Inherits:
TerminalCommand show all
Defined in:
lib/ruby/nginx/commands/nginx_options.rb

Instance Attribute Summary

Attributes inherited from TerminalCommand

#cmd, #error_type, #printer, #result, #user

Instance Method Summary collapse

Methods included from Helpers::SudoHelper

#sudoify

Methods included from Helpers::PromptHelper

#yes?

Constructor Details

#initializeNginxOptions

Returns a new instance of NginxOptions.



9
10
11
# File 'lib/ruby/nginx/commands/nginx_options.rb', line 9

def initialize
  super(cmd: "nginx -V", raise: Ruby::Nginx::Error)
end

Instance Method Details

#runObject



13
14
15
16
17
18
# File 'lib/ruby/nginx/commands/nginx_options.rb', line 13

def run
  super

  # nginx -V outputs to stderr
  format_output(result.stderr)
end