faraday 1.10.1 → 1.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/faraday/autoload.rb +8 -6
- 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: 41cebae56fde7ef704543fcb80cc60c1c69694e540489d03d3882d5b3776c056
|
4
|
+
data.tar.gz: 70069a1f1e36c058c982987914910fa6563dcbaad08a6278295d5bd754b72fee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbf15956af42768f1df10f6677b455e8c43def534d1510f85a4b5a6e9c32896f37cea2ce6d927f2cd84e4b26967d95705a71f05e6ae85f638f27a3487d44b596
|
7
|
+
data.tar.gz: 1eab4e96fe13971b7144121d93963fb49140ef16725987f5f778f64182bdaace0024742b24c6a6965b5d127d613e2992bc949256d0eacecd346275efe4dc4809
|
data/lib/faraday/autoload.rb
CHANGED
@@ -67,13 +67,14 @@ module Faraday
|
|
67
67
|
class Request
|
68
68
|
extend AutoloadHelper
|
69
69
|
autoload_all 'faraday/request',
|
70
|
-
UrlEncoded: 'url_encoded',
|
71
|
-
Multipart: 'multipart',
|
72
|
-
Retry: 'retry',
|
73
70
|
Authorization: 'authorization',
|
74
71
|
BasicAuthentication: 'basic_authentication',
|
72
|
+
Instrumentation: 'instrumentation',
|
73
|
+
Json: 'json',
|
74
|
+
Multipart: 'multipart',
|
75
|
+
Retry: 'retry',
|
75
76
|
TokenAuthentication: 'token_authentication',
|
76
|
-
|
77
|
+
UrlEncoded: 'url_encoded'
|
77
78
|
end
|
78
79
|
|
79
80
|
# Response represents the returned value of a sent Faraday request.
|
@@ -81,7 +82,8 @@ module Faraday
|
|
81
82
|
class Response
|
82
83
|
extend AutoloadHelper
|
83
84
|
autoload_all 'faraday/response',
|
84
|
-
|
85
|
-
Logger: 'logger'
|
85
|
+
Json: 'json',
|
86
|
+
Logger: 'logger',
|
87
|
+
RaiseError: 'raise_error'
|
86
88
|
end
|
87
89
|
end
|
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.4
|
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: 2024-09-20 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.4
|
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.
|