finapps_core 3.0.3 → 3.0.5

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: 667bf4a0e449ab97932da02752a7d3547f79c596
4
- data.tar.gz: fe5718a3dcaa96c2bb76b93080caaccad4d02082
3
+ metadata.gz: d84b8723e6a578eb0d3b9acc147b244bed2b1bf5
4
+ data.tar.gz: 376f447016bc6a972ff845d1690a9f1b7b1929c3
5
5
  SHA512:
6
- metadata.gz: e57b661641b3573c2d0e1adbe5c368a1f2871b30cdf2e99a9a0e88243ad92999f64f7b23833a922ed774cb52ae208ac4158e0453c4b18178e404ea40d0f54ae4
7
- data.tar.gz: 480516ce8fc5053a9746c1a616605c4bae2537b185c82b45fb5c61d6e08183e9d7de26a2038ef57b49c325be4caeff0183ee3df71002af5245c4b4fa39cf74d1
6
+ metadata.gz: c8b80765b6c9f266bbfe7647266635851a179905f624590ebe4661213e116fe96831d7bb4aca06f7c8e855bf468d8a55f225f4eb7da498eb4e096fa4dcfae64a
7
+ data.tar.gz: fcefa24b01aaa13b250acd19b13e0cdaeb6fceac96a26a35add3520e5f47b2bdf1048ea366526baa018e4f364da42b11cdd8f32cb9a277b78b5484e1c57dda5f
@@ -21,12 +21,17 @@ module FinAppsCore
21
21
  def call(env)
22
22
  debug "#{self.class.name}##{__method__} => URL: #{env.method.upcase} #{env.url}"
23
23
  debug "#{self.class.name}##{__method__} => Request Headers: #{dump env.request_headers}"
24
+ if env[:body] && log_body?(:request)
25
+ debug "#{self.class.name}##{__method__} => Request Response: #{dump env[:body]}"
26
+ end
24
27
  super
25
28
  end
26
29
 
27
30
  def on_complete(env)
28
31
  debug "#{self.class.name}##{__method__} => Response Headers: #{dump env.response_headers}"
29
- debug "#{self.class.name}##{__method__} => Response Body: #{dump env.body}" if env.body
32
+ if env.body && log_body?(:response)
33
+ debug "#{self.class.name}##{__method__} => Response Body: #{dump env.body}"
34
+ end
30
35
  end
31
36
 
32
37
  private
@@ -36,6 +41,15 @@ module FinAppsCore
36
41
  s.nil? ? 'NO-CONTENT' : s.to_json
37
42
  end
38
43
 
44
+ def log_body?(type)
45
+ case @options[:bodies]
46
+ when Hash then
47
+ @options[:bodies][type]
48
+ else
49
+ @options[:bodies]
50
+ end
51
+ end
52
+
39
53
  def new_logger
40
54
  logger = Logger.new(STDOUT)
41
55
  logger.level = FinAppsCore::REST::Defaults::DEFAULTS[:log_level]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FinAppsCore
4
- VERSION = '3.0.3'
4
+ VERSION = '3.0.5'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-22 00:00:00.000000000 Z
11
+ date: 2018-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -337,20 +337,20 @@ signing_key:
337
337
  specification_version: 4
338
338
  summary: FinApps REST API ruby client - Core.
339
339
  test_files:
340
- - spec/middleware/response/raise_error_spec.rb
341
- - spec/middleware/request/user_agent_spec.rb
342
- - spec/middleware/request/no_encoding_basic_authentication_spec.rb
343
- - spec/middleware/request/request_id_spec.rb
344
- - spec/middleware/request/tenant_authentication_spec.rb
345
- - spec/middleware/request/accept_json_spec.rb
346
- - spec/rest/credentials_spec.rb
347
- - spec/rest/configuration_spec.rb
348
340
  - spec/rest/defaults_spec.rb
349
341
  - spec/rest/base_client_spec.rb
342
+ - spec/rest/credentials_spec.rb
343
+ - spec/rest/configuration_spec.rb
350
344
  - spec/rest/resources_spec.rb
345
+ - spec/support/fake_api.rb
351
346
  - spec/utils/parameter_filter_spec.rb
352
347
  - spec/utils/validatable_spec.rb
353
- - spec/support/fake_api.rb
348
+ - spec/spec_helpers/client.rb
354
349
  - spec/spec_helper.rb
355
350
  - spec/core_extensions/object/is_integer_spec.rb
356
- - spec/spec_helpers/client.rb
351
+ - spec/middleware/request/no_encoding_basic_authentication_spec.rb
352
+ - spec/middleware/request/user_agent_spec.rb
353
+ - spec/middleware/request/tenant_authentication_spec.rb
354
+ - spec/middleware/request/accept_json_spec.rb
355
+ - spec/middleware/request/request_id_spec.rb
356
+ - spec/middleware/response/raise_error_spec.rb