artirix_data_models 0.27.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f9cd1a03f99dc1e1c65f5da959e6a524f5b1c29
4
- data.tar.gz: 45204802a7e2a927035eb374c2b2e03b3c2bbf00
3
+ metadata.gz: b9c0fd21a6d73d7192b13f8262cbb949f921dbbe
4
+ data.tar.gz: e48528f6d18a14a23e69a9c24a608cd7416009b9
5
5
  SHA512:
6
- metadata.gz: 4b83155af3a24841fd99e5e57f2540d419a3bc66ddec372c5cfa0f84863eb3f9a0d44465a5b745cb21802036256978f6d7023e9ac226e7f8457fe4d078bef61f
7
- data.tar.gz: 314ddf060bd85630e896c1e86aaac76a0087f73ea84dc4ed6cb86e8f89206ce094fe80b6e60e110e11daea3926e12173f32b1c1edca023c88b59d585faa5cf63
6
+ metadata.gz: d4f146b9140763a7416be9347cabb7ac1471f22eb121b12b63c637557d096e245dfbee7659e7bffc6f7575f8d6e242e311c28f503cf3e1268437df9844300481
7
+ data.tar.gz: dd663c0dab73573230983c03438bb64a895ded3372cc88eda1b5e64a5a60e9202d1f9e5d2fca829d5f10f645ff750d6344d0cd865c0d5827fd271e6be60f82cc
data/README.md CHANGED
@@ -327,6 +327,19 @@ end
327
327
 
328
328
  ## Changes
329
329
 
330
+ ### 0.28.0
331
+ - receive `faraday_build_proc` argument in `ArtirixDataModels::DataGateway::ConnectionLoader.connection`. If present, it will be passed the faraday connection before adding any configuration
332
+ ```
333
+ Faraday.new(url: url, request: { params_encoder: Faraday::FlatParamsEncoder }) do |faraday|
334
+ if faraday_build_proc.present? && faraday_build_proc.respond_to?(:call)
335
+ faraday_build_proc.call faraday
336
+ end
337
+
338
+ #...
339
+ faraday.adapter Faraday.default_adapter
340
+ end
341
+ ```
342
+
330
343
  ### 0.27.0
331
344
  - Add settings to log requests and responses bodies: `log_body_request` and `log_body_response`. Added to the `DataGateway::ConectionLoader#connection` method, and to the same config that stores ```login``` and ```password``` settings.
332
345
 
@@ -258,7 +258,7 @@ class ArtirixDataModels::DataGateway
258
258
  connection config: ArtirixDataModels.configuration.send(config_key), **others
259
259
  end
260
260
 
261
- def connection(config: {}, url: nil, login: nil, password: nil, bearer_token: nil, token_hash: nil, log_body_request: nil, log_body_response: nil)
261
+ def connection(config: {}, url: nil, login: nil, password: nil, bearer_token: nil, token_hash: nil, log_body_request: nil, log_body_response: nil, faraday_build_proc: nil)
262
262
  url ||= config.try :url
263
263
  login ||= config.try :login
264
264
  password ||= config.try :password
@@ -270,6 +270,10 @@ class ArtirixDataModels::DataGateway
270
270
  raise InvalidConnectionError, 'no url given, nor is it present in `config.url`' unless url.present?
271
271
 
272
272
  Faraday.new(url: url, request: { params_encoder: Faraday::FlatParamsEncoder }) do |faraday|
273
+ if faraday_build_proc.present? && faraday_build_proc.respond_to?(:call)
274
+ faraday_build_proc.call faraday
275
+ end
276
+
273
277
  faraday.request :url_encoded # form-encode POST params
274
278
  # faraday.response :logger # log requests to STDOUT
275
279
  faraday.response :logger, ::Logger.new(STDOUT), bodies: { request: log_body_request, response: log_body_response }
@@ -1,3 +1,3 @@
1
1
  module ArtirixDataModels
2
- VERSION = '0.27.0'
2
+ VERSION = '0.28.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artirix_data_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo Turiño
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport