Sha256: ff33a9b6bbbf1267715823a62022d885f435034af0fa1c6f22cdcc190bbee4b8

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 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 'active_support'
require 'active_support/all'
require 'all_seeing_eye/model'
require 'all_seeing_eye/models/request'
require 'all_seeing_eye/integrations/rails2' if defined?(Rails)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
all_seeing_eye-0.0.18 lib/all_seeing_eye.rb
all_seeing_eye-0.0.17 lib/all_seeing_eye.rb
all_seeing_eye-0.0.16 lib/all_seeing_eye.rb
all_seeing_eye-0.0.15 lib/all_seeing_eye.rb
all_seeing_eye-0.0.14 lib/all_seeing_eye.rb
all_seeing_eye-0.0.13 lib/all_seeing_eye.rb
all_seeing_eye-0.0.12 lib/all_seeing_eye.rb
all_seeing_eye-0.0.11 lib/all_seeing_eye.rb
all_seeing_eye-0.0.10 lib/all_seeing_eye.rb