httprb-opentracing 0.1.0 → 0.2.0

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
  SHA1:
3
- metadata.gz: 3a402047a11ea48f47ccdc2b0ad5c15bcd2e2b2c
4
- data.tar.gz: 07e4acf0d06b22952a05ea252b5a0bb0b279f148
3
+ metadata.gz: 9bf38fad046ca78c97615669a37e476a608c2ee3
4
+ data.tar.gz: c4dc61191f5b0ecf7c7d14e1e8d3175dc6b46c6a
5
5
  SHA512:
6
- metadata.gz: 5a5932e89e67034612dfa45b0e1fe828fbffd933e82642605f0b8f8b0f835ab3537d8d0517d79833bc7c543ef64f7e29205e5105ac20ac41fc5110cdd4375fae
7
- data.tar.gz: aefcb10500fb23cb1e4dff049cd387d63de8e7b267f053cbbed2c7c9feee5ffc0069ac0222535d8d7e7f7de9dd8ea6b5a61e9ca4955e0ed84bb815057e12fd05
6
+ metadata.gz: b93df493c30cda2e24f31c1e6f0f280e3c279a334076833e712ff54691340abbe8865bed95ae59bd8873d7415b00f53731b2a1bde6a336011d4023a18d91c9ed
7
+ data.tar.gz: 91bbae677fcfb5c3afa3dc86411107bff2edfa7f16321e0420663278ca6f2c7345af94731168e6f807edb262fcf3f75d4b261836449ac48411448a3b525847e3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ ## 0.2.0 08/19/2019
5
+ * Allow use of instrumentation library without using httprb gem
6
+
4
7
  ## 0.1.0 08/01/2019
5
8
  * Instrumention for open tracing using the HTTP client request api
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httprb-opentracing (0.1.0)
5
- http (> 0.1.0)
4
+ httprb-opentracing (0.2.0)
6
5
  opentracing (~> 0.5.0)
7
6
 
8
7
  GEM
@@ -59,6 +58,7 @@ PLATFORMS
59
58
  DEPENDENCIES
60
59
  bundler (~> 2.0)
61
60
  byebug
61
+ http (> 0.1.0)
62
62
  httprb-opentracing!
63
63
  opentracing_test_tracer (~> 0.1)
64
64
  rake (~> 10.0)
data/lib/http/tracer.rb CHANGED
@@ -11,11 +11,22 @@ module HTTP
11
11
  IngoreRequest = ->(_verb, _uri, _opts) { false }
12
12
 
13
13
  def instrument(tracer: OpenTracing.global_tracer, ignore_request: IngoreRequest)
14
+ begin
15
+ require 'http'
16
+ rescue LoadError
17
+ return
18
+ end
19
+ raise IncompatibleGemVersion unless compatible_version?
20
+
14
21
  @ignore_request = ignore_request
15
22
  @tracer = tracer
16
23
  patch_request
17
24
  end
18
25
 
26
+ def compatible_version?
27
+ Gem::Version.new(HTTP::VERSION) >= Gem::Version.new("0.1.0")
28
+ end
29
+
19
30
  def remove
20
31
  return unless ::HTTP::Client.method_defined?(:request_original)
21
32
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module HTTP
4
4
  module Tracer
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
  spec.require_paths = ["lib"]
38
38
 
39
39
  spec.add_dependency "opentracing", "~> 0.5.0"
40
- spec.add_dependency "http", "> 0.1.0"
40
+ spec.add_development_dependency "http", "> 0.1.0"
41
41
  spec.add_development_dependency "bundler", "~> 2.0"
42
42
  spec.add_development_dependency "rake", "~> 10.0"
43
43
  spec.add_development_dependency "rspec", "~> 3.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httprb-opentracing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Fischer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-16 00:00:00.000000000 Z
11
+ date: 2019-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentracing
@@ -31,7 +31,7 @@ dependencies:
31
31
  - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 0.1.0
34
- type: :runtime
34
+ type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements: