diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-06-28 18:44:37 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-06-28 18:44:37 +0200 |
commit | 1b7aa1e22b972f8d297b479319bc586033ee7385 (patch) | |
tree | dfa55aa255cac4417d08c7471a03049ccbd03f18 /lib/environment.rb | |
parent | d505f1b33bb823be23728178175c799d2f30fcca (diff) | |
parent | 6fb9ec6db40d25d2892d4d1bb9de33e56979a945 (diff) |
Merge branch 'master' into development
Diffstat (limited to 'lib/environment.rb')
-rw-r--r-- | lib/environment.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/environment.rb b/lib/environment.rb index 7036951..ceb3ef8 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -13,6 +13,7 @@ LOG_DIR = File.join(basedir, "log") if File.exist?(config_file) @@config = YAML.load_file(config_file) + raise "could not load config, config file: "+config_file.to_s unless @@config else FileUtils.mkdir_p TMP_DIR FileUtils.mkdir_p LOG_DIR @@ -44,7 +45,7 @@ end load File.join config_dir,"mail.rb" if File.exists?(File.join config_dir,"mail.rb") # hack: store sinatra in global var to make url_for and halt methods accessible -before {$sinatra = self unless $sinatra} +before{ $sinatra = self unless $sinatra } class Sinatra::Base # overwriting halt to log halts (!= 202) @@ -82,7 +83,7 @@ class MyLogger < Logger end def format(msg) - pwd.ljust(18)+" :: "+msg.to_s+" :: "+trace+" :: "+ENV['REMOTE_ADDR'].to_s + pwd.ljust(18)+" :: "+msg.to_s+" :: "+trace+" :: "+($sinatra ? $sinatra.request.env['REMOTE_ADDR'] : nil).to_s end def debug(msg) @@ -136,6 +137,7 @@ RDF = Redland::Namespace.new 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' OWL = Redland::Namespace.new 'http://www.w3.org/2002/07/owl#' DC = Redland::Namespace.new 'http://purl.org/dc/elements/1.1/' OT = Redland::Namespace.new 'http://www.opentox.org/api/1.1#' +#OT = Redland::Namespace.new 'http://ortona.informatik.uni-freiburg.de/opentox.owl#' XML = Redland::Namespace.new 'http://www.w3.org/2001/XMLSchema#' # Regular expressions for parsing classification data |