faraday 1.10.1 → 1.10.2
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 +4 -4
- data/lib/faraday/connection.rb +10 -10
- data/lib/faraday/deprecate.rb +4 -3
- data/lib/faraday/request.rb +3 -4
- data/lib/faraday/version.rb +1 -1
- data/spec/faraday/request_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04749d3979d4a9915c3370ec09dcf6155a2e8d4853d3678258224d77c99604d0'
|
4
|
+
data.tar.gz: 6a63e7608e50809a9d5fe4b1abefce9a0857a6095829bd5e631b893257899fae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a71c4649227869ac7f1b5fa6e59bac3587a8080011da3acf6ad5426e890d64be2809b0ad0a2d04bceb8bc08a0c4f2c1b20841429e0d6bde6f69dccf7a707ca5
|
7
|
+
data.tar.gz: 86f69b8d0c7af7ed0b37f0ce4accaf2a9b286489e70f175ffbdc7161c50126747fa32fb56a243b7cb38b8682164d7e9e14e8c3ee28b27dd8fc86a800054d15a7
|
data/lib/faraday/connection.rb
CHANGED
@@ -319,14 +319,14 @@ module Faraday
|
|
319
319
|
#
|
320
320
|
# @return [void]
|
321
321
|
def token_auth(token, options = nil)
|
322
|
-
warn <<~TEXT
|
323
|
-
WARNING: `Faraday::Connection#token_auth` is deprecated; it will be removed in version 2.0.
|
324
|
-
While initializing your connection, use `#request(:token_auth, ...)` instead.
|
325
|
-
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
|
326
|
-
TEXT
|
327
322
|
set_authorization_header(:token_auth, token, options)
|
328
323
|
end
|
329
324
|
|
325
|
+
deprecate :token_auth,
|
326
|
+
'#request(:token_auth, ...)',
|
327
|
+
'2.0',
|
328
|
+
'See https://lostisland.github.io/faraday/middleware/authentication for more usage info.'
|
329
|
+
|
330
330
|
# Sets up a custom Authorization header.
|
331
331
|
#
|
332
332
|
# @param type [String] authorization type
|
@@ -346,14 +346,14 @@ module Faraday
|
|
346
346
|
#
|
347
347
|
# @return [void]
|
348
348
|
def authorization(type, token)
|
349
|
-
warn <<~TEXT
|
350
|
-
WARNING: `Faraday::Connection#authorization` is deprecated; it will be removed in version 2.0.
|
351
|
-
While initializing your connection, use `#request(:authorization, ...)` instead.
|
352
|
-
See https://lostisland.github.io/faraday/middleware/authentication for more usage info.
|
353
|
-
TEXT
|
354
349
|
set_authorization_header(:authorization, type, token)
|
355
350
|
end
|
356
351
|
|
352
|
+
deprecate :authorization,
|
353
|
+
'#request(:authorization, ...)',
|
354
|
+
'2.0',
|
355
|
+
'See https://lostisland.github.io/faraday/middleware/authentication for more usage info.'
|
356
|
+
|
357
357
|
# Check if the adapter is parallel-capable.
|
358
358
|
#
|
359
359
|
# @yield if the adapter isn't parallel-capable, or if no adapter is set yet.
|
data/lib/faraday/deprecate.rb
CHANGED
@@ -76,9 +76,9 @@ module Faraday
|
|
76
76
|
# semver that it is planned to go away.
|
77
77
|
# @param name [Symbol] the method symbol to deprecate
|
78
78
|
# @param repl [#to_s, :none] the replacement to use, when `:none` it will
|
79
|
-
# alert the user that no
|
79
|
+
# alert the user that no replacement is present.
|
80
80
|
# @param ver [String] the semver the method will be removed.
|
81
|
-
def deprecate(name, repl, ver)
|
81
|
+
def deprecate(name, repl, ver, custom_message = nil)
|
82
82
|
class_eval do
|
83
83
|
gem_ver = Gem::Version.new(ver)
|
84
84
|
old = "_deprecated_#{name}"
|
@@ -95,7 +95,8 @@ module Faraday
|
|
95
95
|
msg = [
|
96
96
|
"NOTE: #{target_message} is deprecated",
|
97
97
|
repl == :none ? ' with no replacement' : "; use #{repl} instead. ",
|
98
|
-
"It will be removed in or after version #{gem_ver}",
|
98
|
+
"It will be removed in or after version #{gem_ver} ",
|
99
|
+
custom_message,
|
99
100
|
"\n#{target}#{name} called from #{Gem.location_of_caller.join(':')}"
|
100
101
|
]
|
101
102
|
warn "#{msg.join}." unless Faraday::Deprecate.skip
|
data/lib/faraday/request.rb
CHANGED
@@ -58,13 +58,12 @@ module Faraday
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def method
|
61
|
-
warn <<~TEXT
|
62
|
-
WARNING: `Faraday::Request##{__method__}` is deprecated; use `#http_method` instead. It will be removed in or after version 2.0.
|
63
|
-
`Faraday::Request##{__method__}` called from #{caller_locations(1..1).first}
|
64
|
-
TEXT
|
65
61
|
http_method
|
66
62
|
end
|
67
63
|
|
64
|
+
extend Faraday::Deprecate
|
65
|
+
deprecate :method, :http_method, '2.0'
|
66
|
+
|
68
67
|
# Replace params, preserving the existing hash type.
|
69
68
|
#
|
70
69
|
# @param hash [Hash] new params
|
data/lib/faraday/version.rb
CHANGED
@@ -25,7 +25,7 @@ RSpec.describe Faraday::Request do
|
|
25
25
|
describe 'deprecate method for HTTP method' do
|
26
26
|
let(:http_method) { :post }
|
27
27
|
let(:expected_warning) do
|
28
|
-
%r{
|
28
|
+
%r{NOTE: Faraday::Request#method is deprecated; use http_method instead\. It will be removed in or after version 2.0 \nFaraday::Request#method called from .+/spec/faraday/request_spec.rb:\d+.}
|
29
29
|
end
|
30
30
|
|
31
31
|
it { expect(subject.method).to eq(:post) }
|
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: 1.10.
|
4
|
+
version: 1.10.2
|
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: 2022-08-
|
13
|
+
date: 2022-08-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday-em_http
|
@@ -268,7 +268,7 @@ licenses:
|
|
268
268
|
- MIT
|
269
269
|
metadata:
|
270
270
|
homepage_uri: https://lostisland.github.io/faraday
|
271
|
-
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v1.10.
|
271
|
+
changelog_uri: https://github.com/lostisland/faraday/releases/tag/v1.10.2
|
272
272
|
source_code_uri: https://github.com/lostisland/faraday
|
273
273
|
bug_tracker_uri: https://github.com/lostisland/faraday/issues
|
274
274
|
post_install_message:
|