Sha256: 727102a0ac10003266643fe22a76e6b52529e0fd650941bd40bdb8e50dac06e9

Contents?: true

Size: 808 Bytes

Versions: 3

Compression:

Stored size: 808 Bytes

Contents

#!/usr/bin/env ruby
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', File.dirname(__FILE__))

require 'rubygems'
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
require 'daemons'

options = {
  :app_name   => 'alondra',
  :dir_mode   => :script,
  :dir        => 'tmp/pids'
}

Daemons.run_proc 'alondra', options do

  ENV["ALONDRA_SERVER"] = 'true'
  
  require_relative File.join('..', 'config', 'environment')
  
  log_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'log', 'alondra.log'))
  
  Rails.logger =  ActiveSupport::BufferedLogger.new(log_path)

  Log.info "Started alondra server on port #{Alondra::Alondra.config.port}... #{EM.reactor_running?}"

  EM.reactor_thread.join
  
  Log.info 'Alondra server terminated'
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
alondra-0.1.1 lib/generators/alondra/templates/alondra
alondra-0.1.0 lib/generators/alondra/templates/alondra
alondra-0.0.4 lib/generators/alondra/templates/alondra