Class: Heroku::Forward::Backends::Unicorn
- Defined in:
- lib/heroku/forward/backends/unicorn.rb
Instance Attribute Summary collapse
-
#config_file ⇒ Object
Returns the value of attribute config_file.
Attributes inherited from Base
#application, #environment, #pid, #socket
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Unicorn
constructor
A new instance of Unicorn.
- #spawn! ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ Unicorn
Returns a new instance of Unicorn.
9 10 11 12 13 14 |
# File 'lib/heroku/forward/backends/unicorn.rb', line 9 def initialize( = {}) @application = [:application] @socket = [:socket] || Heroku::Forward::Utils::Dir.tmp_filename('unicorn-', '.sock') @env = [:env] || 'development' @config_file = [:config_file] end |
Instance Attribute Details
#config_file ⇒ Object
Returns the value of attribute config_file.
7 8 9 |
# File 'lib/heroku/forward/backends/unicorn.rb', line 7 def config_file @config_file end |
Instance Method Details
#spawn! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/heroku/forward/backends/unicorn.rb', line 16 def spawn! return false if spawned? check! args = ['unicorn'] args.push '--env', @env args.push '--config-file', @config_file if @config_file args.push '--listen', @socket args.push @application @pid = Spoon.spawnp(*args) @spawned = true end |