setsuzoku 0.14.2 → 0.14.6
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/Gemfile.lock +17 -18
- data/lib/setsuzoku/service/web_service/api_strategies/rest_strategy.rb +8 -2
- data/lib/setsuzoku/service/web_service/api_strategy.rb +4 -2
- data/lib/setsuzoku/service/web_service/credentials/uses_credential_token.rb +2 -2
- data/lib/setsuzoku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e8e7e3727f9c6f55d217d5f6945aaf9b0dd70e1e7623df1bff9ce401bfe895c
|
4
|
+
data.tar.gz: 7ec126f92ad83120308ce9656c4b7b71c37c2bfe9f984a49b733a3f4337652f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a75e9f454f3f9bf3f2527e05aee8655d03ce29a5cb4c7fca264bbfb98cc16e95a8f5b1a18c645f2c77fd5fd92482b98ac33fd18be12271b073e8c64e8c059c
|
7
|
+
data.tar.gz: 3418e1e71f783fa0c5161cbd2ef9a7633ead4f5a8c4c1195c933b7c80ae691eb1f2b0df85eca7af9e750761cb56c919c97cbfa2ed4fc43e4750220c0a618734c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
setsuzoku (0.14.
|
4
|
+
setsuzoku (0.14.6)
|
5
5
|
activesupport (>= 5.0, < 7)
|
6
6
|
faraday (~> 0.11)
|
7
7
|
nokogiri (~> 1.10)
|
@@ -10,29 +10,29 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
activesupport (6.
|
13
|
+
activesupport (6.1.4)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
-
i18n (>=
|
16
|
-
minitest (
|
17
|
-
tzinfo (~>
|
18
|
-
zeitwerk (~> 2.
|
15
|
+
i18n (>= 1.6, < 2)
|
16
|
+
minitest (>= 5.1)
|
17
|
+
tzinfo (~> 2.0)
|
18
|
+
zeitwerk (~> 2.3)
|
19
19
|
addressable (2.7.0)
|
20
20
|
public_suffix (>= 2.0.2, < 5.0)
|
21
|
-
concurrent-ruby (1.1.
|
21
|
+
concurrent-ruby (1.1.9)
|
22
22
|
crack (0.4.3)
|
23
23
|
safe_yaml (~> 1.0.0)
|
24
24
|
diff-lcs (1.4.2)
|
25
|
-
faraday (0.17.
|
25
|
+
faraday (0.17.4)
|
26
26
|
multipart-post (>= 1.2, < 3)
|
27
27
|
hashdiff (1.0.1)
|
28
|
-
i18n (1.8.
|
28
|
+
i18n (1.8.10)
|
29
29
|
concurrent-ruby (~> 1.0)
|
30
|
-
|
31
|
-
minitest (5.14.2)
|
30
|
+
minitest (5.14.4)
|
32
31
|
multipart-post (2.1.1)
|
33
|
-
nokogiri (1.
|
34
|
-
|
32
|
+
nokogiri (1.11.7-x86_64-darwin)
|
33
|
+
racc (~> 1.4)
|
35
34
|
public_suffix (4.0.5)
|
35
|
+
racc (1.5.2)
|
36
36
|
rake (10.5.0)
|
37
37
|
rspec (3.8.0)
|
38
38
|
rspec-core (~> 3.8.0)
|
@@ -50,16 +50,15 @@ GEM
|
|
50
50
|
safe_yaml (1.0.5)
|
51
51
|
sorbet (0.5.5675)
|
52
52
|
sorbet-static (= 0.5.5675)
|
53
|
-
sorbet-runtime (0.5.
|
53
|
+
sorbet-runtime (0.5.6497)
|
54
54
|
sorbet-static (0.5.5675-universal-darwin-14)
|
55
|
-
|
56
|
-
|
57
|
-
thread_safe (~> 0.1)
|
55
|
+
tzinfo (2.0.4)
|
56
|
+
concurrent-ruby (~> 1.0)
|
58
57
|
webmock (3.8.0)
|
59
58
|
addressable (>= 2.3.6)
|
60
59
|
crack (>= 0.3.2)
|
61
60
|
hashdiff (>= 0.4.0, < 2.0.0)
|
62
|
-
zeitwerk (2.4.
|
61
|
+
zeitwerk (2.4.2)
|
63
62
|
|
64
63
|
PLATFORMS
|
65
64
|
ruby
|
@@ -122,9 +122,15 @@ module Setsuzoku
|
|
122
122
|
def formulate_request(request_properties = {}, request_options = {})
|
123
123
|
request_format = request_properties.dig(:request_format).to_s
|
124
124
|
params = request_properties[:req_params].merge(request_options.except(:headers))
|
125
|
-
|
126
|
-
|
125
|
+
if request_properties[:request_method] == :get
|
126
|
+
# Faraday expects get requests params to be a hash
|
127
127
|
params
|
128
|
+
elsif request_properties[:req_params].empty?
|
129
|
+
if request_properties[:request_method] == :put
|
130
|
+
params.to_json # Faraday doesn't support an empty hash for PUT requests
|
131
|
+
else
|
132
|
+
params # Faraday supports empty hashes for other request types...
|
133
|
+
end
|
128
134
|
else
|
129
135
|
# if the header or request format include urlencoded return the body as a hash
|
130
136
|
if request_format.include?('urlencoded')
|
@@ -81,7 +81,8 @@ module Setsuzoku
|
|
81
81
|
def parse_response(response:, **options)
|
82
82
|
case options[:response_type]
|
83
83
|
when :json
|
84
|
-
JSON.parse(response.body)
|
84
|
+
resp = JSON.parse(response.body)
|
85
|
+
resp.is_a?(Hash) ? resp.deep_symbolize_keys : resp
|
85
86
|
when :xml
|
86
87
|
convert_xml_to_hash(response.body)
|
87
88
|
when :html
|
@@ -97,7 +98,8 @@ module Setsuzoku
|
|
97
98
|
# t.rewind
|
98
99
|
# t
|
99
100
|
else
|
100
|
-
JSON.parse(response.body)
|
101
|
+
resp = JSON.parse(response.body)
|
102
|
+
resp.is_a?(Hash) ? resp.deep_symbolize_keys : resp
|
101
103
|
end
|
102
104
|
end
|
103
105
|
|
@@ -59,8 +59,8 @@ module Setsuzoku
|
|
59
59
|
# @param attrs [Hash] additional attrs to be passed to super if desired.
|
60
60
|
#
|
61
61
|
# @return [Hash] the attributes to assign to the credential.
|
62
|
-
sig { abstract.params(resp: Setsuzoku::ApiResponse, attrs: T::Hash[Symbol, T.untyped]).void }
|
63
|
-
def set_token
|
62
|
+
sig { abstract.params(resp: Setsuzoku::ApiResponse, attrs: T.nilable(T::Hash[Symbol, T.untyped])).void }
|
63
|
+
def set_token!(resp, attrs); end
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
data/lib/setsuzoku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: setsuzoku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.14.
|
4
|
+
version: 0.14.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Stadtler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|