Sha256: ab53bda847245681323fbb267e43983d28c4bc6a04e6ccc75474351e45c31854

Contents?: true

Size: 968 Bytes

Versions: 8

Compression:

Stored size: 968 Bytes

Contents

require 'mongo'
require 'virtus'
require 'fish0/version'
require 'fish0/configuration'
require 'fish0/engine'
require 'fish0/exceptions'
require 'fish0/repository'
require 'fish0/paginator'
require 'fish0/concerns/cacheable'
require 'fish0/concerns/paginatable'
require 'fish0/concerns/view_model'
require 'fish0/concerns/base'
require 'fish0/collection'
require 'fish0/model'

module Fish0
  class << self
    def mongo_reader
      Mongo::Logger.logger = mongo_config['logger'] || Rails.logger
      @mongo_reader ||= Mongo::Client.new(mongo_config[:hosts], mongo_config[:params])
    end

    def mongo_config
      if File.file?(File.expand_path('../config/mongo.yml', __FILE__))
        config = Rails.application.config_for(:mongo)
        Configuration.mongo_hosts = config['hosts']
        Configuration.mongo_params = config['params']
      end
      @mongo_config || { hosts: Configuration.mongo_hosts, params: Configuration.mongo_params }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fish0-0.0.14 lib/fish0.rb
fish0-0.0.13 lib/fish0.rb
fish0-0.0.12 lib/fish0.rb
fish0-0.0.11 lib/fish0.rb
fish0-0.0.10 lib/fish0.rb
fish0-0.0.9 lib/fish0.rb
fish0-0.0.8 lib/fish0.rb
fish0-0.0.7 lib/fish0.rb