Sha256: 3c95b6f70f84b7bd233f17c678623141feff46353b9aaaf80247897b001276ef

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

require 'rails'

module Proselytism
  class Engine < Rails::Engine

    ActiveSupport.on_load :before_initialize do |app|
      config_file_path = File.join(Rails.root, 'config', 'proselytism.yml')
      if File.exist?(config_file_path)
        params = YAML.load_file(config_file_path)
        Proselytism.config do |config|
          params[Rails.env].each do |k, v|
            config.send "#{k}=", v
          end
        end
      end
    end

    ActiveSupport.on_load :after_initialize do |app|
      Proselytism.config.log_level  ||= Rails.logger.level
      Proselytism.config.log_path   ||= File.join(Rails.root, 'log', "proselytism.log")
      Proselytism.config.logger     ||= Proselytism::BufferedLogger.new Proselytism.config.log_path, Proselytism.config.log_level
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
proselytism-0.0.2 lib/proselytism/engine.rb