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 +4 -4
- data/lib/faraday/honeycomb/version.rb +1 -1
- data/lib/faraday-honeycomb/auto_install.rb +19 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 540f228bab59da3cb1fd0fe6f9d78742f8de6201c327637aff03ef38bfeddab8
|
4
|
+
data.tar.gz: 7e973e706ef49733be242f4437f03c31203337ae66e2b96bba760f0a5d28c5bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 692dc42dca8604f1e9a8d92f8296682248890f3225245e3d053625c9b3ea5a5a31c7beee58217ca448d0b87d9b18e391066cf270a58726dd6e5aaf4402d71d68
|
7
|
+
data.tar.gz: d91e396292fc619b9025bbac3b7cdb387767d80b5b7725c3f963949188e2ad8e8640b9a23c9af5b60a6ea20a764a31eff896d22a03a6d423ee90a3530109956e
|
@@ -4,9 +4,13 @@ module Faraday
|
|
4
4
|
module Honeycomb
|
5
5
|
module AutoInstall
|
6
6
|
class << self
|
7
|
-
def available?(
|
8
|
-
|
9
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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.
|
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-
|
11
|
+
date: 2018-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: libhoney
|