artirix_data_models 0.26.0 → 0.27.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/artirix_data_models/gateways/data_gateway.rb +10 -7
- data/lib/artirix_data_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f9cd1a03f99dc1e1c65f5da959e6a524f5b1c29
|
4
|
+
data.tar.gz: 45204802a7e2a927035eb374c2b2e03b3c2bbf00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b83155af3a24841fd99e5e57f2540d419a3bc66ddec372c5cfa0f84863eb3f9a0d44465a5b745cb21802036256978f6d7023e9ac226e7f8457fe4d078bef61f
|
7
|
+
data.tar.gz: 314ddf060bd85630e896c1e86aaac76a0087f73ea84dc4ed6cb86e8f89206ce094fe80b6e60e110e11daea3926e12173f32b1c1edca023c88b59d585faa5cf63
|
data/README.md
CHANGED
@@ -327,6 +327,9 @@ end
|
|
327
327
|
|
328
328
|
## Changes
|
329
329
|
|
330
|
+
### 0.27.0
|
331
|
+
- 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
|
+
|
330
333
|
### 0.26.0
|
331
334
|
- Expose cache configuration in case the app has config specific for `artirix_cache_service` that we want to use with `ArtirixDataModels.use_cache_service(artirix_cache_service)` where the argument is a `ArtirixCacheService::Service` object.
|
332
335
|
|
@@ -258,18 +258,21 @@ 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)
|
262
|
-
url
|
263
|
-
login
|
264
|
-
password
|
265
|
-
bearer_token
|
266
|
-
token_hash
|
261
|
+
def connection(config: {}, url: nil, login: nil, password: nil, bearer_token: nil, token_hash: nil, log_body_request: nil, log_body_response: nil)
|
262
|
+
url ||= config.try :url
|
263
|
+
login ||= config.try :login
|
264
|
+
password ||= config.try :password
|
265
|
+
bearer_token ||= config.try :bearer_token
|
266
|
+
token_hash ||= config.try :token_hash
|
267
|
+
log_body_request ||= log_body_request.nil? ? config.try(:log_body_request) : log_body_request
|
268
|
+
log_body_response ||= log_body_response.nil? ? config.try(:log_body_response) : log_body_response
|
267
269
|
|
268
270
|
raise InvalidConnectionError, 'no url given, nor is it present in `config.url`' unless url.present?
|
269
271
|
|
270
272
|
Faraday.new(url: url, request: { params_encoder: Faraday::FlatParamsEncoder }) do |faraday|
|
271
273
|
faraday.request :url_encoded # form-encode POST params
|
272
|
-
faraday.response :logger # log requests to STDOUT
|
274
|
+
# faraday.response :logger # log requests to STDOUT
|
275
|
+
faraday.response :logger, ::Logger.new(STDOUT), bodies: { request: log_body_request, response: log_body_response }
|
273
276
|
|
274
277
|
if login.present? || password.present?
|
275
278
|
faraday.basic_auth(login, password)
|
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.
|
4
|
+
version: 0.27.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-
|
11
|
+
date: 2016-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|