swd 2.0.0 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f60030386576c99f1d32d337056513f9a5e129eb12ffda22cb39e72e0497930
4
- data.tar.gz: d5919e42679f55337ada7688fb667f7c98c05ca55af5dd4493ab952e1f377c2f
3
+ metadata.gz: f164e9a3d921dd3fdbdb8c6434009fb2f6cecbf890f063c39556b67f3d53c0b9
4
+ data.tar.gz: 9f20b02b225c291827dcb8febc2f8ffa753b7756d6c2a50c7a687354c542352f
5
5
  SHA512:
6
- metadata.gz: b81930fdf6bb71c44c0eca8701cc1fa6c030b6434c43bfec6ea2786046f27f237c51894dcdc288ab0e9fdf2805f38e1c68cda8e8668a3ff769c943660e59c18b
7
- data.tar.gz: 1c68def1a77cf6aaf488aceb75f02e58260285982363c7b323fefe888b62061dff5ad917d04704bacab2f59de1b929ea24e9187a2b3352c0d8155412acf3a8ce
6
+ metadata.gz: 80cf26293c25f96156b10ef5e9767ca49972ca273f94ab8a7e14bd4f2eb90bbb54d80b0465d70d2a800875cbd55127d0b6877ef833edacdafb61a62b7eb38a21
7
+ data.tar.gz: b0ebd777be47eae0e0c52a695885ddc09e0316385b16326f378148e0abea064337c3d9c1c39904cd5069ba8b0a7df75f0888c15f22e437b6eabb1012464256a9
data/CHANGELOG.md ADDED
@@ -0,0 +1,9 @@
1
+ ## [2.0.0] - 2022-10-08
2
+
3
+ ### Added
4
+
5
+ - start recording CHANGELOG
6
+
7
+ ### Changed
8
+
9
+ - Switch from httpclient to faraday https://github.com/nov/SWD/pull/4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.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
- Response.new json
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, WebFinger.logger if debugging?
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' => 'application/json'
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.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-08 00:00:00.000000000 Z
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.1.6
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: