faraday-honeycomb 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69a9537a084d8d08f71c54c49e9e8db4347b73fa0974615c16e032f75e3a5ac3
4
- data.tar.gz: 122840928e932c72be907a32fdfc5517fe54b77bfc920e87cf139c64d9b61b09
3
+ metadata.gz: 540f228bab59da3cb1fd0fe6f9d78742f8de6201c327637aff03ef38bfeddab8
4
+ data.tar.gz: 7e973e706ef49733be242f4437f03c31203337ae66e2b96bba760f0a5d28c5bb
5
5
  SHA512:
6
- metadata.gz: 717264783477c05669074225412310ecd1ccdbc249948a38dcdca660929d08d5dba745f4ce94025c4a9a6c145b931bd3ed874a0e2784ed28f604e279aa606e73
7
- data.tar.gz: e09780b7ca46231a3f4c7fd88719da3e97cc25b2ed1dfd562ea3701e01197000605ec4f70608b220d77b846640e50d5c36fe4db3473b0ab05262c71d3bde870b
6
+ metadata.gz: 692dc42dca8604f1e9a8d92f8296682248890f3225245e3d053625c9b3ea5a5a31c7beee58217ca448d0b87d9b18e391066cf270a58726dd6e5aaf4402d71d68
7
+ data.tar.gz: d91e396292fc619b9025bbac3b7cdb387767d80b5b7725c3f963949188e2ad8e8640b9a23c9af5b60a6ea20a764a31eff896d22a03a6d423ee90a3530109956e
@@ -1,7 +1,7 @@
1
1
  module Faraday
2
2
  module Honeycomb
3
3
  GEM_NAME = 'faraday-honeycomb'
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.2'
5
5
 
6
6
  MIN_FARADAY_VERSION = '0.8'
7
7
  end
@@ -4,9 +4,13 @@ module Faraday
4
4
  module Honeycomb
5
5
  module AutoInstall
6
6
  class << self
7
- def available?(**_)
8
- gem 'faraday', ">= #{::Faraday::Honeycomb::MIN_FARADAY_VERSION}"
9
- rescue Gem::LoadError
7
+ def available?(logger: nil)
8
+ constraint = ">= #{::Faraday::Honeycomb::MIN_FARADAY_VERSION}"
9
+ gem 'faraday', constraint
10
+ logger.debug "#{self.name}: detected Faraday #{constraint}, okay to autoinitialise" if logger
11
+ true
12
+ rescue Gem::LoadError => e
13
+ logger.debug "Didn't detect Faraday #{constraint} (#{e.class}: #{e.message}), not autoinitialising faraday-honeycomb" if logger
10
14
  false
11
15
  end
12
16
 
@@ -17,18 +21,19 @@ module Faraday
17
21
  Faraday::Connection.extend(Module.new do
18
22
  define_method :new do |*args, &orig_block|
19
23
  block = if orig_block
20
- proc do |b|
21
- b.use :honeycomb, client: honeycomb_client
22
- orig_block.call(b)
23
- end
24
- else
25
- proc do |b|
26
- b.use :honeycomb, client: honeycomb_client
27
- b.adapter Faraday.default_adapter
28
- end
29
- end
30
- super(*args, &block).tap do
24
+ proc do |b|
25
+ logger.debug "Adding Faraday::Honeycomb::Middleware in #{self}.new{}" if logger
26
+ b.use :honeycomb, client: honeycomb_client
27
+ orig_block.call(b)
28
+ end
29
+ else
30
+ proc do |b|
31
+ logger.debug "Adding Faraday::Honeycomb::Middleware in #{self}.new" if logger
32
+ b.use :honeycomb, client: honeycomb_client
33
+ b.adapter Faraday.default_adapter
34
+ end
31
35
  end
36
+ super(*args, &block)
32
37
  end
33
38
  end)
34
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-honeycomb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stokes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-24 00:00:00.000000000 Z
11
+ date: 2018-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libhoney