diff options
author | Christoph Helma <helma@in-silico.ch> | 2012-03-09 21:45:12 +0000 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2012-03-09 21:45:12 +0000 |
commit | 0430ae07ffb1e94b7e38c3f69136a26229a680e0 (patch) | |
tree | 264e26aae1e6d5cf49e19b924965faaa51df36d8 /lib | |
parent | 99691a04485b409ede5b4a1c6657ba6e59abc7de (diff) |
READE updated, Sinatra::Reloader added
Diffstat (limited to 'lib')
-rw-r--r-- | lib/environment.rb | 4 | ||||
-rw-r--r-- | lib/opentox.rb | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/environment.rb b/lib/environment.rb index 1af76f8..3889dfb 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -9,6 +9,7 @@ config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml") TMP_DIR = File.join(basedir, "tmp") LOG_DIR = File.join(basedir, "log") +=begin if File.exist?(config_file) CONFIG = YAML.load_file(config_file) not_found_error "Could not load configuration from \"#{config_file.to_s}\"" unless CONFIG @@ -19,10 +20,12 @@ else puts "Please edit #{config_file} and restart your application." exit end +=end logfile = "#{LOG_DIR}/#{ENV["RACK_ENV"]}.log" $logger = OTLogger.new(logfile) +=begin if CONFIG[:logger] and CONFIG[:logger] == "debug" $logger.level = Logger::DEBUG else @@ -34,4 +37,5 @@ AA_SERVER = CONFIG[:authorization] ? (CONFIG[:authorization][:server] ? CONFIG[: CONFIG[:authorization][:authenticate_request] = [""] unless CONFIG[:authorization][:authenticate_request] CONFIG[:authorization][:authorize_request] = [""] unless CONFIG[:authorization][:authorize_request] CONFIG[:authorization][:free_request] = [""] unless CONFIG[:authorization][:free_request] +=end diff --git a/lib/opentox.rb b/lib/opentox.rb index 4ca154c..05a8a08 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -1,4 +1,5 @@ require 'sinatra/base' +require "sinatra/reloader" module OpenTox # Base class for OpenTox services @@ -12,6 +13,10 @@ module OpenTox set :show_exceptions, false set :static, false + configure :development do + register Sinatra::Reloader + end + error do # TODO: set actor, calling OT::Error with uri parameter does not work error = request.env['sinatra.error'] |