From 81b5d17c8f5adede4febc1f0bccf87dac4a3da7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20G=C3=BCtlein?= Date: Mon, 2 Nov 2009 16:27:28 +0100 Subject: initial commit of devel version --- config.ru | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'config.ru') diff --git a/config.ru b/config.ru index 85e510e..422e0c8 100644 --- a/config.ru +++ b/config.ru @@ -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 -- cgit v1.2.3