Sha256: 89949b596076d91a091c85e735dee52063ac2859a6ee06f235adb3dafb17cdfb

Contents?: true

Size: 901 Bytes

Versions: 6

Compression:

Stored size: 901 Bytes

Contents

require 'copycopter_client/helper'

if defined?(ActionController::Base)
  ActionController::Base.send :include, CopycopterClient::Helper
end
if defined?(ActionView::Base)
  ActionView::Base.send :include, CopycopterClient::Helper
end

module CopycopterClient
  # 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
      CopycopterClient.configure(false) do |config|
        config.environment_name = ::Rails.env
        config.logger           = ::Rails.logger
        config.framework        = "Rails: #{::Rails::VERSION::STRING}"
        config.fallback_backend = I18n.backend
      end
    end
  end
end

if defined?(Rails::Railtie)
  require 'copycopter_client/railtie'
else
  CopycopterClient::Rails.initialize
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
copycopter_client-1.0.0.beta6 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta5 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta4 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta3 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta2 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta1 lib/copycopter_client/rails.rb