Sha256: 40f0032ac8a12e1c77b09b3b788940709a32cf74936ca1351a8d6e1f65fcb485

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

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)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
all_seeing_eye-0.0.9 lib/all_seeing_eye.rb
all_seeing_eye-0.0.8 lib/all_seeing_eye.rb
all_seeing_eye-0.0.7 lib/all_seeing_eye.rb