swd 2.0.1 → 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/VERSION +1 -1
- data/lib/swd/resource.rb +7 -2
- data/spec/helpers/webmock_helper.rb +1 -1
- metadata +6 -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/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
|
|
@@ -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
|
|
@@ -173,7 +173,7 @@ files:
|
|
|
173
173
|
homepage: https://github.com/nov/swd
|
|
174
174
|
licenses: []
|
|
175
175
|
metadata: {}
|
|
176
|
-
post_install_message:
|
|
176
|
+
post_install_message:
|
|
177
177
|
rdoc_options: []
|
|
178
178
|
require_paths:
|
|
179
179
|
- lib
|
|
@@ -188,8 +188,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
188
188
|
- !ruby/object:Gem::Version
|
|
189
189
|
version: '0'
|
|
190
190
|
requirements: []
|
|
191
|
-
rubygems_version: 3.
|
|
192
|
-
signing_key:
|
|
191
|
+
rubygems_version: 3.3.7
|
|
192
|
+
signing_key:
|
|
193
193
|
specification_version: 4
|
|
194
194
|
summary: SWD (Simple Web Discovery) Client Library
|
|
195
195
|
test_files:
|