Class: Nginxtra::Actions::Status

Inherits:
Object
  • Object
show all
Includes:
Nginxtra::Action
Defined in:
lib/nginxtra/actions/status.rb

Overview

The Nginxtra::Actions::Status class encapsulates checking on the status of nginx (whether or not it is running based on the pid file).

Instance Method Summary collapse

Methods included from Nginxtra::Action

#daemon, #initialize

Instance Method Details

#colored_messageObject



13
14
15
16
17
18
19
# File 'lib/nginxtra/actions/status.rb', line 13

def colored_message
  if Nginxtra::Config.nginx_running?
    @thor.set_color "running", :green, true
  else
    @thor.set_color "stopped", :red, true
  end
end

#statusObject



9
10
11
# File 'lib/nginxtra/actions/status.rb', line 9

def status
  @thor.say "The nginx server status: #{colored_message}"
end