swd 2.0.0 → 2.0.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/CHANGELOG.md +9 -0
- data/VERSION +1 -1
- data/lib/swd/resource.rb +7 -2
- data/lib/swd.rb +1 -1
- data/spec/helpers/webmock_helper.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f164e9a3d921dd3fdbdb8c6434009fb2f6cecbf890f063c39556b67f3d53c0b9
|
|
4
|
+
data.tar.gz: 9f20b02b225c291827dcb8febc2f8ffa753b7756d6c2a50c7a687354c542352f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 80cf26293c25f96156b10ef5e9767ca49972ca273f94ab8a7e14bd4f2eb90bbb54d80b0465d70d2a800875cbd55127d0b6877ef833edacdafb61a62b7eb38a21
|
|
7
|
+
data.tar.gz: b0ebd777be47eae0e0c52a695885ddc09e0316385b16326f378148e0abea064337c3d9c1c39904cd5069ba8b0a7df75f0888c15f22e437b6eabb1012464256a9
|
data/CHANGELOG.md
ADDED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.
|
|
1
|
+
2.0.2
|
data/lib/swd/resource.rb
CHANGED
|
@@ -38,12 +38,12 @@ module SWD
|
|
|
38
38
|
if redirect = json[:SWD_service_redirect]
|
|
39
39
|
redirect_to redirect[:location], redirect[:expires]
|
|
40
40
|
else
|
|
41
|
-
|
|
41
|
+
to_response_object json
|
|
42
42
|
end
|
|
43
43
|
rescue Faraday::Error => e
|
|
44
44
|
case e.response_status
|
|
45
45
|
when nil
|
|
46
|
-
raise e
|
|
46
|
+
raise Exception.new e
|
|
47
47
|
when 400
|
|
48
48
|
raise BadRequest.new('Bad Request', e.response_body)
|
|
49
49
|
when 401
|
|
@@ -57,6 +57,11 @@ module SWD
|
|
|
57
57
|
end
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
+
# NOTE: overwritten in openid_connect gem.
|
|
61
|
+
def to_response_object(json)
|
|
62
|
+
Response.new json
|
|
63
|
+
end
|
|
64
|
+
|
|
60
65
|
def redirect_to(location, expires)
|
|
61
66
|
uri = URI.parse(location)
|
|
62
67
|
@host, @path, @port = uri.host, uri.path, uri.port
|
data/lib/swd.rb
CHANGED
|
@@ -56,7 +56,7 @@ module SWD
|
|
|
56
56
|
faraday.response :raise_error
|
|
57
57
|
faraday.response :json
|
|
58
58
|
faraday.response :follow_redirects
|
|
59
|
-
faraday.response :logger,
|
|
59
|
+
faraday.response :logger, SWD.logger if debugging?
|
|
60
60
|
faraday.adapter Faraday.default_adapter
|
|
61
61
|
http_config.try(:call, faraday)
|
|
62
62
|
end
|
|
@@ -25,7 +25,7 @@ module WebMockHelper
|
|
|
25
25
|
def response_for(response_file, options = {})
|
|
26
26
|
response = {}
|
|
27
27
|
response[:headers] = {
|
|
28
|
-
'Content-Type'
|
|
28
|
+
'Content-Type': 'application/json'
|
|
29
29
|
}
|
|
30
30
|
response[:body] = File.new(File.join(File.dirname(__FILE__), '../mock_json', "#{response_file}.json"))
|
|
31
31
|
if options[:status]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: swd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- nov matake
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-10-
|
|
11
|
+
date: 2022-10-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -148,6 +148,7 @@ files:
|
|
|
148
148
|
- ".gitignore"
|
|
149
149
|
- ".rspec"
|
|
150
150
|
- ".travis.yml"
|
|
151
|
+
- CHANGELOG.md
|
|
151
152
|
- Gemfile
|
|
152
153
|
- LICENSE
|
|
153
154
|
- README.rdoc
|
|
@@ -172,7 +173,7 @@ files:
|
|
|
172
173
|
homepage: https://github.com/nov/swd
|
|
173
174
|
licenses: []
|
|
174
175
|
metadata: {}
|
|
175
|
-
post_install_message:
|
|
176
|
+
post_install_message:
|
|
176
177
|
rdoc_options: []
|
|
177
178
|
require_paths:
|
|
178
179
|
- lib
|
|
@@ -187,8 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
187
188
|
- !ruby/object:Gem::Version
|
|
188
189
|
version: '0'
|
|
189
190
|
requirements: []
|
|
190
|
-
rubygems_version: 3.
|
|
191
|
-
signing_key:
|
|
191
|
+
rubygems_version: 3.3.7
|
|
192
|
+
signing_key:
|
|
192
193
|
specification_version: 4
|
|
193
194
|
summary: SWD (Simple Web Discovery) Client Library
|
|
194
195
|
test_files:
|