blob: 8470f0e33ccf57d7d33a2dad157d4ee013cc0171 (
plain)
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
|
require 'rubygems'
require 'rack'
require 'rack/contrib'
require 'application.rb'
# log at centralized place
logfile = "#{LOG_DIR}/#{ENV["RACK_ENV"]}.log"
log = File.new(logfile, "a+")
$stdout.reopen(log)
$stderr.reopen(log)
$stdout.sync = true
$stderr.sync = true
set :logging, false
set :raise_errors, true
['public','tmp'].each do |dir|
FileUtils.mkdir_p dir unless File.exists?(dir)
end
use Rack::ShowExceptions
#use Rack::MailExceptions do |mail|
# mail.to '...@example.com'
# mail.subject '[ERROR] %s'
# mail.smtp MAIL
#end
|