Sha256: 799a73d264c33311e4febf33a8e961c2f9f2e0d00e62786be8c73e2b2fc2e57b

Contents?: true

Size: 921 Bytes

Versions: 2

Compression:

Stored size: 921 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.middleware       = ::Rails.configuration.middleware
      end
    end
  end
end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
copycopter_client-1.0.0.beta10 lib/copycopter_client/rails.rb
copycopter_client-1.0.0.beta9 lib/copycopter_client/rails.rb