Sha256: 3531cc06f3b500cc3842c0af68c453e34bdd312d2d5de1d3c4096c468c9e5102

Contents?: true

Size: 899 Bytes

Versions: 51

Compression:

Stored size: 899 Bytes

Contents

module Skylight
  module Probes
    module Excon
      class Probe
        def install
          if defined?(::Excon::Middleware)
            # Don't require until installation since it depends on Excon being loaded
            require 'skylight/probes/excon/middleware'

            idx = ::Excon.defaults[:middlewares].index(::Excon::Middleware::Instrumentor)

            # TODO: Handle possibility of idx being nil
            ::Excon.defaults[:middlewares].insert(idx, Skylight::Probes::Excon::Middleware)
          else
            # Using $stderr here isn't great, but we don't have a logger accessible
            $stderr.puts "[SKYLIGHT] [#{Skylight::VERSION}] The installed version of Excon doesn't " \
                          "support Middlewares. The Excon probe will be disabled."
          end
        end
      end
    end

    register("Excon", "excon", Excon::Probe.new)
  end
end

Version data entries

51 entries across 51 versions & 2 rubygems

Version Path
skylight-1.4.0.beta lib/skylight/probes/excon.rb
skylight-1.3.1 lib/skylight/probes/excon.rb
skylight-1.3.0 lib/skylight/probes/excon.rb
skylight-1.2.2 lib/skylight/probes/excon.rb
skylight-1.2.1 lib/skylight/probes/excon.rb
skylight-1.2.0 lib/skylight/probes/excon.rb
skylight-1.1.0 lib/skylight/probes/excon.rb
skylight-1.0.1 lib/skylight/probes/excon.rb
skylight-1.0.0 lib/skylight/probes/excon.rb
skylight-0.10.6 lib/skylight/probes/excon.rb
skylight-1.0.0.beta5 lib/skylight/probes/excon.rb
skylight-0.10.5 lib/skylight/probes/excon.rb
skylight-0.10.4 lib/skylight/probes/excon.rb
skylight-1.0.0.beta4 lib/skylight/probes/excon.rb
skylight-1.0.0.beta3 lib/skylight/probes/excon.rb
skylight-0.10.3 lib/skylight/probes/excon.rb
skylight-0.10.2 lib/skylight/probes/excon.rb
skylight-1.0.0.beta2 lib/skylight/probes/excon.rb
skylight-0.10.0 lib/skylight/probes/excon.rb
skylight-0.9.4 lib/skylight/probes/excon.rb