Sha256: 5a056d349234d80a867e0759e930dd48a97e77c5dd9c563b64ad703a99aed6d7
Contents?: true
Size: 864 Bytes
Versions: 15
Compression:
Stored size: 864 Bytes
Contents
module Timber module Frameworks module Rails # Installs Timber into your Rails app automatically. class Railtie < ::Rails::Railtie config.timber = Config.instance config.before_initialize do Probes.insert! Timber::Frameworks::Rails.insert_middlewares(config.app_middleware) end end def self.insert_middlewares(middleware) var_name = :"@_timber_middlewares_inserted" return true if middleware.instance_variable_defined?(var_name) && middleware.instance_variable_get(var_name) == true # Rails uses a proxy :/, so we need to do this instance variable hack middleware.instance_variable_set(var_name, true) Timber::RackMiddlewares.middlewares.each do |m| middleware.insert_before ::Rails::Rack::Logger, m end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems