class AllSeeingEye def self.environment ENV['RUBBER_ENV'] || ENV['RAILS_ENV'] || ENV['ALL_SEEING_EYE_ENV'] || 'development' end def self.configuration location = ENV['ALL_SEEING_EYE_CONFIG'] || 'config' @@configuration ||= Hash.new @@configuration[:redis] ||= begin YAML::load_file("./#{location}/resque.yml")[AllSeeingEye.environment] rescue begin YAML::load_file("./#{location}/redis.yml")[AllSeeingEye.environment] rescue 'localhost:6379' end end @@configuration[:all_seeing_eye] ||= YAML::load_file("./#{location}/all_seeing_eye.yml") @@configuration end def self.redis @@redis ||= Redis.new(:host => AllSeeingEye.configuration[:redis].split(':').first, :port => AllSeeingEye.configuration[:redis].split(':').last) end end require 'redis' require 'yaml' require 'chronic' require 'rbtree' require 'all_seeing_eye/model' require 'all_seeing_eye/models/request' require 'all_seeing_eye/integrations/rails2' if defined?(Rails)