class AllSeeingEye def self.configuration(location = nil) location ||= 'config' @@configuration ||= if defined?(Rails) YAML::load_file("#{Rails.root}/#{location}/all_seeing_eye.yml") else YAML::load_file("./#{location}/all_seeing_eye.yml") end @@configuration end def self.redis @host, @port = nil begin resque_config = if defined?(Rails) YAML::load_file("#{Rails.root}/#{location}/resque.yml") else YAML::load_file("./#{location}/resque.yml") end rescue @host = resque_config[ENV['RAILS_ENV']].split(':').first @port = resque_config[ENV['RAILS_ENV']].split(':').first end begin redis_config = if defined?(Rails) YAML::load_file("#{Rails.root}/#{location}/resque.yml") else YAML::load_file("./#{location}/resque.yml") end rescue @host = resque_config[ENV['RAILS_ENV']].split(':').first @port = resque_config[ENV['RAILS_ENV']].split(':').first end @host, @port = 'localhost', 6379 unless @host && @port @@redis ||= Redis.new(:host => options[:host], :port => options[:port]) 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)