Sha256: 7f9600e21959370d82c4f3181d91f325f7d77862bc47ceca14b853d06b9b3047

Contents?: true

Size: 835 Bytes

Versions: 13

Compression:

Stored size: 835 Bytes

Contents

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

      def install_middleware
        Rails.configuration.middleware.use Instrumental::Middleware
      end

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

      def recognize_uri(request)
        params = ActionController::Routing::Routes.recognize_path(request.path, request.env.merge(:method => request.env["REQUEST_METHOD"].downcase.to_sym))
        ["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/rails23.rb
instrumental_agent-0.6.0 lib/instrumental/rack/rails23.rb
instrumental_agent-0.5.1 lib/instrumental/rack/rails23.rb
instrumental_agent-0.5.0 lib/instrumental/rack/rails23.rb
instrumental_agent-0.4.0 lib/instrumental/rack/rails23.rb
instrumental_agent-0.3.0 lib/instrumental/rack/rails23.rb
instrumental_agent-0.2.0 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.6 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.5 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.4 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.3 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.2 lib/instrumental/rack/rails23.rb
instrumental_agent-0.1.0 lib/instrumental/rack/rails23.rb