Class: Sunshine::Nginx

Inherits:
Server show all
Defined in:
lib/sunshine/daemons/nginx.rb

Overview

Simple server wrapper for nginx setup and control.

Instance Attribute Summary

Attributes inherited from Server

#port, #server_name, #sigkill

Attributes inherited from Daemon

#app, #bin, #config_file, #config_path, #config_template, #name, #pid, #processes, #restart_cmd, #server_apps, #status_cmd, #stop_cmd, #sudo, #target, #timeout

Instance Method Summary collapse

Methods inherited from Server

binder_methods, passenger_root, #setup, #stop_cmd, #supports_rack?, #use_passenger?

Methods inherited from Daemon

binder_methods, #config_file_path, #config_template_files, #each_server_app, #has_setup?, #log_file, #log_files, #restart, #setup, #start, #stop, underscore, #upload_config_files

Constructor Details

#initialize(app, options = {}) ⇒ Nginx

Returns a new instance of Nginx.



8
9
10
11
12
13
14
15
# File 'lib/sunshine/daemons/nginx.rb', line 8

def initialize app, options={}
  super

  @sudo = options[:sudo] || @port < 1024

  @dep_name = options[:dep_name] ||
    use_passenger? ? 'passenger-nginx' : 'nginx'
end

Instance Method Details

#start_cmdObject



18
19
20
# File 'lib/sunshine/daemons/nginx.rb', line 18

def start_cmd
  "#{@bin} -c #{self.config_file_path}"
end