Class: Capistrano::Extensions::Server::Nginx

Inherits:
WebServer
  • Object
show all
Defined in:
lib/capistrano-exts/servers/web_server/nginx.rb

Constant Summary collapse

AVAILABLE_MODES =
[:passenger, :reverse_proxy, :php_fpm]
NGINX_TEMPLATE_PATH =
ROOT_PATH + '/capistrano-exts/templates/web_servers/nginx.conf.erb'

Instance Method Summary collapse

Methods included from Variables

#method_missing

Methods included from Erb

#render

Constructor Details

#initialize(mode, template_path = NGINX_TEMPLATE_PATH) ⇒ Nginx

Returns a new instance of Nginx.

Raises:

  • (ArgumentError)


11
12
13
14
15
16
# File 'lib/capistrano-exts/servers/web_server/nginx.rb', line 11

def initialize(mode, template_path = NGINX_TEMPLATE_PATH)
  raise ArgumentError, "The requested mode is not supported" unless AVAILABLE_MODES.include?(mode)
  raise ArgumentError, "The template file is not found or not readable" unless File.exists?(template_path)
  @mode = mode.to_sym
  @template = template_path
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Capistrano::Extensions::Variables