From 7823d94600673060d3194cbd70c766486dbd592f Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Thu, 26 Apr 2012 15:44:10 +0000 Subject: environment.rb removed --- lib/environment.rb | 41 ----------------------------------------- lib/opentox-server.rb | 4 +--- lib/opentox.rb | 4 +++- opentox-server.gemspec | 1 - 4 files changed, 4 insertions(+), 46 deletions(-) delete mode 100644 lib/environment.rb diff --git a/lib/environment.rb b/lib/environment.rb deleted file mode 100644 index 3889dfb..0000000 --- a/lib/environment.rb +++ /dev/null @@ -1,41 +0,0 @@ -# set default environment -ENV['RACK_ENV'] = 'production' unless ENV['RACK_ENV'] - -# load/setup configuration -basedir = File.join(ENV['HOME'], ".opentox") -config_dir = File.join(basedir, "config") -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 -else - FileUtils.mkdir_p TMP_DIR - FileUtils.mkdir_p LOG_DIR - FileUtils.mkdir_p config_dir - 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 - $logger.level = Logger::WARN -end - -# TODO: move to opentox-client??? -AA_SERVER = CONFIG[:authorization] ? (CONFIG[:authorization][:server] ? CONFIG[:authorization][:server] : nil) : nil -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-server.rb b/lib/opentox-server.rb index 3e5e68f..35a1224 100644 --- a/lib/opentox-server.rb +++ b/lib/opentox-server.rb @@ -4,10 +4,8 @@ require 'rack/contrib' require 'sinatra' require 'sinatra/url_for' require 'roo' -require '4store-ruby' require 'rdf/n3' -require File.join(File.dirname(__FILE__),"environment.rb") +#require File.join(File.dirname(__FILE__),"environment.rb") require File.join(File.dirname(__FILE__),"4store.rb") -#require File.join(File.dirname(__FILE__),"file-store.rb") require File.join(File.dirname(__FILE__),"opentox.rb") require File.join(File.dirname(__FILE__),"authorization-helper.rb") diff --git a/lib/opentox.rb b/lib/opentox.rb index 9fac2eb..7a73d66 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -1,9 +1,11 @@ require 'sinatra/base' require "sinatra/reloader" -require File.join(ENV["HOME"],".opentox","config","default.rb") ENV["RACK_ENV"] ||= "production" +logfile = File.join(ENV['HOME'], ".opentox","log","#{ENV["RACK_ENV"]}.log") +$logger = OTLogger.new(logfile) + module OpenTox # Base class for OpenTox services diff --git a/opentox-server.gemspec b/opentox-server.gemspec index 9a6f1aa..6746b5a 100644 --- a/opentox-server.gemspec +++ b/opentox-server.gemspec @@ -27,6 +27,5 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'emk-sinatra-url-for' s.add_runtime_dependency 'roo' s.add_runtime_dependency 'unicorn' - s.add_runtime_dependency '4store-ruby' s.add_runtime_dependency 'rdf-n3' end -- cgit v1.2.3