class DaemonizeRails::Unicorn

Public Class Methods

new(bindings, app_name) click to toggle source
# File lib/daemonize_rails.rb, line 6
def initialize(bindings, app_name)
  @bindings = bindings
  @app_name = app_name
  @app_path = Dir.pwd
end

Public Instance Methods

check_and_create_folder(path) click to toggle source
# File lib/daemonize_rails.rb, line 19
def check_and_create_folder(path)
  if !File.exists? path
    Dir.mkdir path
    puts `chmod 755 #{path}`
  end
end
make_config_file() click to toggle source
# File lib/daemonize_rails.rb, line 12
def make_config_file
  check_and_create_folder(@app_path + "/tmp")
  check_and_create_folder(@app_path + "/tmp/pids")
  unicorn_file = ERB.new File.new(File.dirname(__FILE__) + "/unicorn_template.erb").read, nil, "%"
  unicorn_file.result(@bindings)
end