faraday 1.10.1 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/faraday/connection.rb +10 -10
- data/lib/faraday/dependency_loader.rb +3 -1
- 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 +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a35b8ef069416d74f46cbe1f9b14b9d28e8b141bed4143d2c97ac137b766f18
|
4
|
+
data.tar.gz: cdbb3768e4aa6d316e2216ec7fdf2a93b5141abe83dd82b3ffa522002b01523c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 743727fca5013eb1bd1f005c334d171fc59a5cb56687395b3d14a48911ee4b7fef5da00e64ac6dbe15b75cc76edcb26d400b4d748e9676d9cdb12e8d2d8ee7b7
|
7
|
+
data.tar.gz: 203527c8adc2828334b74e97a33041ed9127548b91905d15331ff627c5f20d679c3d2ccd0b3102c0de35e011c5f15f2bac50b8aa4eccaeafaf1551611ca020e1
|
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.
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'ruby2_keywords'
|
4
|
+
|
3
5
|
module Faraday
|
4
6
|
# DependencyLoader helps Faraday adapters and middleware load dependencies.
|
5
7
|
module DependencyLoader
|
@@ -13,7 +15,7 @@ module Faraday
|
|
13
15
|
self.load_error = e
|
14
16
|
end
|
15
17
|
|
16
|
-
def new(*)
|
18
|
+
ruby2_keywords def new(*)
|
17
19
|
unless loaded?
|
18
20
|
raise "missing dependency for #{self}: #{load_error.message}"
|
19
21
|
end
|
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.3
|
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:
|
13
|
+
date: 2023-01-18 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.3
|
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:
|
@@ -287,7 +287,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
- !ruby/object:Gem::Version
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
|
-
rubygems_version: 3.
|
290
|
+
rubygems_version: 3.1.6
|
291
291
|
signing_key:
|
292
292
|
specification_version: 4
|
293
293
|
summary: HTTP/REST API client library.
|