Sha256: 888c99125876727140670782a06d586b8f766bd495a03bbe38bef469cf30c320

Contents?: true

Size: 707 Bytes

Versions: 13

Compression:

Stored size: 707 Bytes

Contents

module Instrumental
  class Middleware
    class Rails3 < Stack
      def self.create
        if defined?(Rails) && Rails.respond_to?(:version) && Rails.version.to_s =~ /^3/
          new
        end
      end

      def install_middleware
        require 'instrumental/rack/rails3/middleware_bootstrap'
      end

      def log(msg)
        Rails.logger.error msg
      end

      def recognize_uri(request)
        Rails.application.routes.finalize!
        params = Rails.application.routes.recognize_path(request.url, request.env)
        ["controller", params[:controller], params[:action]]
      rescue ActionController::RoutingError => e
        ["controller", "unknown"]
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
instrumental_agent-0.6.1 lib/instrumental/rack/rails3.rb
instrumental_agent-0.6.0 lib/instrumental/rack/rails3.rb
instrumental_agent-0.5.1 lib/instrumental/rack/rails3.rb
instrumental_agent-0.5.0 lib/instrumental/rack/rails3.rb
instrumental_agent-0.4.0 lib/instrumental/rack/rails3.rb
instrumental_agent-0.3.0 lib/instrumental/rack/rails3.rb
instrumental_agent-0.2.0 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.6 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.5 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.4 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.3 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.2 lib/instrumental/rack/rails3.rb
instrumental_agent-0.1.0 lib/instrumental/rack/rails3.rb