Class: Ruby::Nginx::CLI
- Inherits:
-
Thor
- Object
- Thor
- Ruby::Nginx::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/ruby/nginx/cli.rb
Constant Summary collapse
- FAKE_CONFIG =
Ruby::Nginx::Configuration.new(domain: "[DOMAIN]")
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.default_paths(param) ⇒ Object
17 18 19 |
# File 'lib/ruby/nginx/cli.rb', line 17 def self.default_paths(param) "default: #{FAKE_CONFIG.default_paths[param]}" end |
.defaults(param) ⇒ Object
13 14 15 |
# File 'lib/ruby/nginx/cli.rb', line 13 def self.defaults(param) "default: #{FAKE_CONFIG.defaults[param]}" end |
Instance Method Details
#add ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/ruby/nginx/cli.rb', line 33 def add config = { domain: .domain, port: .port, host: .host, root_path: .root_path, template_path: .template_path, ssl: .ssl, log: .log, ssl_certificate_path: .ssl_certificate_path, ssl_certificate_key_path: .ssl_certificate_key_path, access_log_path: .access_log_path, error_log_path: .error_log_path }.compact Ruby::Nginx.add!(**config) rescue Ruby::Nginx::Error => e abort "[Ruby::Nginx] #{e.message}" end |
#remove ⇒ Object
55 56 57 58 59 |
# File 'lib/ruby/nginx/cli.rb', line 55 def remove Ruby::Nginx.remove!(domain: .domain) rescue Ruby::Nginx::Error => e abort "[Ruby::Nginx] #{e.message}" end |