diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2009-11-02 16:27:28 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2009-11-02 16:27:28 +0100 |
commit | 81b5d17c8f5adede4febc1f0bccf87dac4a3da7f (patch) | |
tree | b32f5f1d1ae2903f6dd805c29dc07f3d414bd751 /config.ru | |
parent | 6a1b5313d63c985997c3e2d350ecb3bdbff245b0 (diff) |
initial commit of devel version
Diffstat (limited to 'config.ru')
-rw-r--r-- | config.ru | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1,12 +1,13 @@ require 'rubygems' require 'sinatra' require 'application.rb' +require 'fileutils' + +FileUtils.mkdir_p 'log' unless File.exists?('log') +log = File.new("log/"+FileUtils.pwd.split("/")[-1]+"-#{ENV["RACK_ENV"]}.log", "a") +$stdout.reopen(log) +$stderr.reopen(log) +$stdout.sync = true +$stderr.sync = true -if ENV["RACK_ENV"] == 'production' - FileUtils.mkdir_p 'log' unless File.exists?('log') - log = File.new("log/sinatra.log", "a") - $stdout.reopen(log) - $stderr.reopen(log) -end - run Sinatra::Application |