Sha256: bdfbd1d558b0639b570a4c4319e053edd39074d4209d72c75d9de66b4bb8b473

Contents?: true

Size: 885 Bytes

Versions: 40

Compression:

Stored size: 885 Bytes

Contents

module CopyTunerClient
  # Responsible for Rails initialization
  module Rails
    # Sets up the logger, environment, name, project root, and framework name
    # for Rails applications. Must be called after framework initialization.
    def self.initialize
      CopyTunerClient.configure(false) do |config|
        config.environment_name = ::Rails.env
        config.logger           = if defined?(::Rails::Console)
          Logger.new('/dev/null')
        elsif defined?(::Rails) && ::Rails.env.development?
          Logger.new('log/copy_tuner.log')
        else
          ::Rails.logger
        end
        config.framework        = "Rails: #{::Rails::VERSION::STRING}"
        config.middleware       = ::Rails.configuration.middleware
      end
    end
  end
end

if defined?(::Rails::Railtie)
  require 'copy_tuner_client/engine'
else
  CopyTunerClient::Rails.initialize
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
copy_tuner_client-0.15.1 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.15.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.14.2 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.14.1 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.14.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.6 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.5 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.3 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.2 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.1 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.13.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.12.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.11.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.10.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.9.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.8.1 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.8.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.7.0 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.6.2 lib/copy_tuner_client/rails.rb
copy_tuner_client-0.6.1 lib/copy_tuner_client/rails.rb