class Nginxtra::Actions::Stop

The Nginxtra::Actions::Stop class encapsulates stopping nginx.

Public Instance Methods

no_need_to_stop() click to toggle source
# File lib/nginxtra/actions/stop.rb, line 14
def no_need_to_stop
  @thor.say "nginx is already stopped"
end
should_stop?() click to toggle source
# File lib/nginxtra/actions/stop.rb, line 18
def should_stop?
  return true if force?
  Nginxtra::Config.nginx_running?
end
stop() click to toggle source

Stop nginx and note the new last stop time.

# File lib/nginxtra/actions/stop.rb, line 8
def stop
  return no_need_to_stop unless should_stop?
  stop_nginx
  update_last_stop
end
stop_nginx() click to toggle source
# File lib/nginxtra/actions/stop.rb, line 23
def stop_nginx
  daemon :stop
end
update_last_stop() click to toggle source
# File lib/nginxtra/actions/stop.rb, line 27
def update_last_stop
  Nginxtra::Status[:last_stop_time] = Time.now
end