diff options
author | mr <mr@mrautenberg.de> | 2010-01-19 10:02:09 +0100 |
---|---|---|
committer | mr <mr@mrautenberg.de> | 2010-01-19 10:02:09 +0100 |
commit | 0e7f3c196b123acd9d311f02f09f8b03992cea5f (patch) | |
tree | 9991c400dc3f01e7c626ed64bd21be9f051e0cf0 /lib/environment.rb | |
parent | 253e15cae162d88a269cc86608dd3334cab29cf9 (diff) |
move authorization to branch test
Diffstat (limited to 'lib/environment.rb')
-rw-r--r-- | lib/environment.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/environment.rb b/lib/environment.rb index 6100928..f7513c5 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -6,6 +6,7 @@ basedir = File.join(ENV['HOME'], ".opentox") config_dir = File.join(basedir, "config") @@tmp_dir = File.join(basedir, "tmp") config_file = File.join(config_dir, "#{ENV['RACK_ENV']}.yaml") +user_file = File.join(config_dir, "users.yaml") if File.exist?(config_file) @@config = YAML.load_file(config_file) @@ -17,6 +18,14 @@ else exit end +if File.exist?(user_file) + @@users = YAML.load_file(user_file) +else + FileUtils.cp(File.join(File.dirname(__FILE__), 'templates/users.yaml'), user_file) + puts "Please edit #{user_file} and restart your application." + exit +end + # RDF namespaces 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#' |