Class: Sunshine::Unicorn

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

Overview

Simple server wrapper for Unicorn setup and control.

Direct Known Subclasses

Rainbows

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 = {}) ⇒ Unicorn

Returns a new instance of Unicorn.



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

def initialize app, options={}
  super

  @timeout = options[:timeout] || 3.0

  @supports_rack = true
end

Instance Method Details

#start_cmdObject



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

def start_cmd
  "cd #{@app.current_path} && #{@bin} -D -E"+
    " #{@app.deploy_env} -p #{@port} -c #{self.config_file_path};"
end