eezee 1.0.13 → 1.0.14

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: 26e0b5f2a8e9d41185e65ccbf53602ab25570deaf81e69283a52e4785b2f5694
4
- data.tar.gz: 0c0c693f105197d788972e2465af65995de21a212b1195dbdda47ef4ed4969ee
3
+ metadata.gz: 1b7c682c3a866eb358e65f38a97f231cdb94fff7f09fdd390d354d7b1345fd0f
4
+ data.tar.gz: a265ae175efd2676f61437347501821ae7dde110df4405f7166e509cb740c2ef
5
5
  SHA512:
6
- metadata.gz: 661361d14056a28f812cc26b49198dc844081aa281570fdaccfd604eb119ec8afe382ffb849a58354029bea607c00ec13a59d2c71fb796c0a8c9ad80d9d496db
7
- data.tar.gz: 980bfb3dcda96ecd42b07754c0cb904d4825920a4298cbe975d01ce679d71867ebcf624265c11a158ee025fad5b76bd83237aa5c1536379205e39095cbf86cbb
6
+ metadata.gz: c6f92103ef4b0673c71080b52389c1587f2714b6825117bfc27c3b4e03f14b81378e765ff17d1c5a019d9e31fb8fbaae8c5eaee5b1f513914a37983bd403ea59
7
+ data.tar.gz: 5344e9609432588e8ef717bf528b11017765fdee25957a0034cac4bd1a4b71d4bb3cb0e24e6f4c7bbd109d123bcb97b943732a394c17dc0eac09fb5bb213d716
@@ -0,0 +1,4 @@
1
+ ### 1.0.14
2
+
3
+ * Add ddtrace support
4
+ * Add changelog
data/README.md CHANGED
@@ -180,7 +180,7 @@ Here are the list of available options and about them:
180
180
  | `logger` | No | `false` | If you want to log the request, response, and error | `true` |
181
181
  | `url_encoded` | No | `false` | If you want to send request body as form_url_encoded | `true` |
182
182
  | `preserve_url_params` | No | `false` | The query params will be preserved if the url or path has a nested param like `:character_id` this value will be not replaced | `true` |
183
-
183
+ | `ddtrace` | No | `nil` | Support for [DataDog apm](http://gems.datadoghq.com/trace/docs/#Faraday) | `{}` |
184
184
 
185
185
  ### Services
186
186
 
@@ -72,14 +72,19 @@ module Eezee
72
72
 
73
73
  def build_faraday_client(request)
74
74
  Faraday.new(request.uri) do |config|
75
- config.request :url_encoded if request.url_encoded
76
- config.use(Faraday::Response::RaiseError) if request.raise_error
77
- config.headers = request.headers if request.headers
78
- config.options[:open_timeout] = request.open_timeout if request.open_timeout
79
- config.options[:timeout] = request.timeout if request.timeout
80
- config.adapter(Faraday.default_adapter)
75
+ faraday_client_options!(config, request)
81
76
  end
82
77
  end
78
+
79
+ def faraday_client_options!(config, request)
80
+ config.request :url_encoded if request.url_encoded
81
+ config.use(Faraday::Response::RaiseError) if request.raise_error
82
+ config.headers = request.headers if request.headers
83
+ config.options[:open_timeout] = request.open_timeout if request.open_timeout
84
+ config.options[:timeout] = request.timeout if request.timeout
85
+ config.adapter(Faraday.default_adapter)
86
+ config.use(:ddtrace, request.ddtrace) if request.ddtrace.any?
87
+ end
83
88
  end
84
89
  end
85
90
  end
@@ -17,6 +17,7 @@ module Eezee
17
17
  url
18
18
  url_encoded
19
19
  preserve_url_params
20
+ ddtrace
20
21
  ].freeze
21
22
 
22
23
  DEFAULT = {
@@ -26,7 +27,8 @@ module Eezee
26
27
  payload: {},
27
28
  raise_error: false,
28
29
  url_encoded: false,
29
- preserve_url_params: false
30
+ preserve_url_params: false,
31
+ ddtrace: {}
30
32
  }.freeze
31
33
 
32
34
  attr_accessor(*(ACCESSORS | %i[uri method]))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Eezee
4
- VERSION = '1.0.13'
4
+ VERSION = '1.0.14'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eezee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - linqueta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2020-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -233,6 +233,7 @@ executables: []
233
233
  extensions: []
234
234
  extra_rdoc_files: []
235
235
  files:
236
+ - CHANGELOG.md
236
237
  - MIT-LICENSE
237
238
  - README.md
238
239
  - lib/eezee.rb