faraday 2.7.9 → 2.7.10

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: 83ff6180688a921d25648a542c61ed892a45073f0847c7596e3758c3e0840736
4
- data.tar.gz: 074e9f49f201d6ac82317775e5afcbacebdb1fa82314e31945fb2ca7f2382640
3
+ metadata.gz: e4aa57af93476ba31117b14ed37bea950bf9b677d4dcca13ca1296a3ac2c3ff7
4
+ data.tar.gz: 98b3cb7b7c5c08eba9f58ad96181757d6cd7fc7431ac47ae19e8c95a25de12f9
5
5
  SHA512:
6
- metadata.gz: a54d949779bac334681a0d860f6ada434bb48ff9497b2388fb75dd3e1686b9b4fe0fd203d79e7fb5c88dfa16a824c24feee29595914ed9ecdeff3119c4c1e7f3
7
- data.tar.gz: 70d759d4b358898746df53e29e9b2cb4d05466bc158f6d433e26fde3471123295a46c3f53da3214bfe992680e28db5cdd5c418c1a1fc3e05b45417bd09436036
6
+ metadata.gz: 28f98f568e844799353a00d5ff49511f7bdb759a50edd3de2d4194fbb348dc14d1ef0294d854016ccdcbec915546225ebb2cf6dec354d6e7fbbf707b00cfc170
7
+ data.tar.gz: 3506cebb9ad1fbd1dd38c1804e18cfd7d7352796d11fa564cde9ce0eee1b1a8ba6d07acda4b179662e5b6eb23baf6f70173240cf8a6b69834d2db9c740a80e25
@@ -13,25 +13,26 @@ module Faraday
13
13
 
14
14
  def initialize(logger:, options:)
15
15
  @logger = logger
16
- @filter = []
17
16
  @options = DEFAULT_OPTIONS.merge(options)
17
+ unless %i[debug info warn error fatal].include?(@options[:log_level])
18
+ @options[:log_level] = :info
19
+ end
20
+ @filter = []
18
21
  end
19
22
 
20
23
  def_delegators :@logger, :debug, :info, :warn, :error, :fatal
21
24
 
22
25
  def request(env)
23
- request_log = proc do
26
+ public_send(log_level, 'request') do
24
27
  "#{env.method.upcase} #{apply_filters(env.url.to_s)}"
25
28
  end
26
- public_send(log_level, 'request', &request_log)
27
29
 
28
30
  log_headers('request', env.request_headers) if log_headers?(:request)
29
31
  log_body('request', env[:body]) if env[:body] && log_body?(:request)
30
32
  end
31
33
 
32
34
  def response(env)
33
- status = proc { "Status #{env.status}" }
34
- public_send(log_level, 'response', &status)
35
+ public_send(log_level, 'response') { "Status #{env.status}" }
35
36
 
36
37
  log_headers('response', env.response_headers) if log_headers?(:response)
37
38
  log_body('response', env[:body]) if env[:body] && log_body?(:response)
@@ -40,8 +41,7 @@ module Faraday
40
41
  def exception(exc)
41
42
  return unless log_errors?
42
43
 
43
- error_log = proc { exc.full_message }
44
- public_send(log_level, 'error', &error_log)
44
+ public_send(log_level, 'error') { exc.full_message }
45
45
 
46
46
  log_headers('error', exc.response_headers) if exc.respond_to?(:response_headers) && log_headers?(:error)
47
47
  return unless exc.respond_to?(:response_body) && exc.response_body && log_body?(:error)
@@ -103,21 +103,15 @@ module Faraday
103
103
  end
104
104
 
105
105
  def log_level
106
- unless %i[debug info warn error fatal].include?(@options[:log_level])
107
- return :info
108
- end
109
-
110
106
  @options[:log_level]
111
107
  end
112
108
 
113
109
  def log_headers(type, headers)
114
- headers_log = proc { apply_filters(dump_headers(headers)) }
115
- public_send(log_level, type, &headers_log)
110
+ public_send(log_level, type) { apply_filters(dump_headers(headers)) }
116
111
  end
117
112
 
118
113
  def log_body(type, body)
119
- body_log = proc { apply_filters(dump_body(body)) }
120
- public_send(log_level, type, &body_log)
114
+ public_send(log_level, type) { apply_filters(dump_body(body)) }
121
115
  end
122
116
  end
123
117
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Faraday
4
- VERSION = '2.7.9'
4
+ VERSION = '2.7.10'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.9
4
+ version: 2.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - "@technoweenie"
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-06-30 00:00:00.000000000 Z
13
+ date: 2023-07-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: faraday-net_http
@@ -131,7 +131,7 @@ licenses:
131
131
  - MIT
132
132
  metadata:
133
133
  homepage_uri: https://lostisland.github.io/faraday
134
- changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.9
134
+ changelog_uri: https://github.com/lostisland/faraday/releases/tag/v2.7.10
135
135
  source_code_uri: https://github.com/lostisland/faraday
136
136
  bug_tracker_uri: https://github.com/lostisland/faraday/issues
137
137
  post_install_message: