Class: NginxUtils::CLI
- Inherits:
-
Thor
- Object
- Thor
- NginxUtils::CLI
- Defined in:
- lib/nginx_utils/cli.rb
Instance Method Summary collapse
Instance Method Details
#create_vhost ⇒ Object
55 56 57 58 |
# File 'lib/nginx_utils/cli.rb', line 55 def create_vhost vhost = NginxUtils::VirtualHost.new() puts vhost.config end |
#logrotate ⇒ Object
32 33 34 |
# File 'lib/nginx_utils/cli.rb', line 32 def logrotate NginxUtils::Logrotate.new().execute end |
#status(host = "localhost") ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/nginx_utils/cli.rb', line 10 def status(host="localhost") result = NginxUtils::Status.get host: host if [:only_value] puts result.values.join("\t") else puts "Active Connections: #{result[:active_connections]}" puts "Accepts: #{result[:accepts]} Handled: #{result[:handled]} Requests: #{result[:requests]}" puts "Reading: #{result[:reading]} Writing: #{result[:writing]} Waiting: #{result[:waiting]}" end end |