-
Notifications
You must be signed in to change notification settings - Fork 29
/
config.ru
executable file
·41 lines (33 loc) · 897 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# encoding: UTF-8
# config.ru
if defined?(Encoding)
Encoding.default_internal = Encoding.default_external = "UTF-8"
end
begin
require 'minigems'
rescue LoadError
require 'rubygems'
end
require 'bundler'
Bundler.setup
require 'merb-core'
Merb::Config.setup(:merb_root => ::File.expand_path(::File.dirname(__FILE__)),
:environment => "production")
Merb.root = Merb::Config[:merb_root]
Merb.environment = "production"
Merb::BootLoader.run
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
Cache.reset
# Server.setup # reset our curl connection
else
# We're in conservative spawning mode. We don't need to do anything.
end
end
end
if(Merb.environment == 'production')
require Merb.root / "lib" / "udp_logger"
use Merb::Rack::UDPLogger
end
run Merb::Rack::Application.new