Sha256: 1fe895db3bfae790030e9cb0e9d33c252b8aef8b2a67c15259391ff4ec568512
Contents?: true
Size: 972 Bytes
Versions: 2
Compression:
Stored size: 972 Bytes
Contents
module Cohortly class Engine < Rails::Engine initializer "read_config" do |app| config_file = File.join(Rails.root, 'config', 'cohortly.yml') if File.exists?(config_file) Cohortly::Config.config.tap do |cfg| conf = YAML.load_file(config_file)[Rails.env] conf.keys.each { |k| cfg.send("#{k}=", conf[k]) } Cohortly::Metric.connection Mongo::Connection.new(cfg.host, cfg.port) Cohortly::Metric.set_database_name cfg.database Cohortly::Metric.database.authenticate(cfg.username, cfg.password) if(cfg.password) Cohortly::TagReport.connection Cohortly::Metric.connection Cohortly::TagReport.set_database_name cfg.database Cohortly::UserCohort.connection Cohortly::Metric.connection Cohortly::UserCohort.set_database_name cfg.database end end Cohortly::StoredProcedures.store_procedures end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
cohortly-0.0.93 | lib/cohortly/engine.rb |
cohortly-0.0.92 | lib/cohortly/engine.rb |