Sha256: 044faac26f80eb4deec3b0130d7f0a1e379a0a25e968d1eab7bab3cc1cb445e0

Contents?: true

Size: 693 Bytes

Versions: 4

Compression:

Stored size: 693 Bytes

Contents

module TreasureData
module Logger
module Agent
  module Rails

    def self.init_controller
      ActionController::Base.send(:include, ControllerExtension)
    end

    module ControllerExtension
      if defined?(ActiveSupport::Concern)
        # Rails 2
        extend ActiveSupport::Concern
      else
        def self.included(mod)
          im = InstanceMethods
          cm = ClassMethods
          mod.class_eval do
            include im
            extend cm
          end
        end
      end

      module InstanceMethods
        def td_access_log
          request.env['td.access_log'] ||= {}
        end
      end

      module ClassMethods
      end
    end

  end
end
end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
td-logger-0.2.8 lib/td/logger/agent/rails/controller.rb
td-logger-0.2.7 lib/td/logger/agent/rails/controller.rb
td-logger-0.2.6 lib/td/logger/agent/rails/controller.rb
td-logger-0.2.5 lib/td/logger/agent/rails/controller.rb