Sha256: f72370bba77b9b1410bdbd6c5960d19dcf6576275f4ad46a04532c5516fa3b00

Contents?: true

Size: 669 Bytes

Versions: 15

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true
module Excon
  class StandardInstrumentor
    def self.instrument(name, params = {}, &block)
      params = params.dup

      # reduce duplication/noise of output
      params.delete(:connection)
      params.delete(:stack)

      if params.has_key?(:headers) && params[:headers].has_key?('Authorization')
        params[:headers] = params[:headers].dup
        params[:headers]['Authorization'] = REDACTED
      end

      if params.has_key?(:password)
        params[:password] = REDACTED
      end

      $stderr.puts(name)
      Excon::PrettyPrinter.pp($stderr, params)

      if block_given?
        yield
      end
    end
  end
end

Version data entries

15 entries across 13 versions & 2 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/excon-0.62.0/lib/excon/instrumentors/standard_instrumentor.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/excon-0.62.0/lib/excon/instrumentors/standard_instrumentor.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/excon-0.62.0/lib/excon/instrumentors/standard_instrumentor.rb
excon-0.62.0 lib/excon/instrumentors/standard_instrumentor.rb
excon-0.61.0 lib/excon/instrumentors/standard_instrumentor.rb
excon-0.60.0 lib/excon/instrumentors/standard_instrumentor.rb
excon-0.59.0 lib/excon/standard_instrumentor.rb
excon-0.58.0 lib/excon/standard_instrumentor.rb
excon-0.57.1 lib/excon/standard_instrumentor.rb
excon-0.57.0 lib/excon/standard_instrumentor.rb
excon-0.56.0 lib/excon/standard_instrumentor.rb
excon-0.55.0 lib/excon/standard_instrumentor.rb
excon-0.54.0 lib/excon/standard_instrumentor.rb
excon-0.53.0 lib/excon/standard_instrumentor.rb
excon-0.52.0 lib/excon/standard_instrumentor.rb