swd 2.0.1 → 2.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 802d7dc7fb967e492dda5004d695ee437bf0fb6400c8c7b72abe1cc4e090f1f4
4
- data.tar.gz: 829212f3700375ed033b88ca6d68e2019a19a522347fc948a9d680e2ac884c9d
3
+ metadata.gz: ec5568cf1fe7901b0782a7de8d3f44f6c0efa0382e39f72ec9a6d43ea2c168b4
4
+ data.tar.gz: b05f2404383e789be4816d7ad002f4fce8e5eac7d64f7a7b16cf35b2fb988f6d
5
5
  SHA512:
6
- metadata.gz: 5bb5aae834c19cc552ceaa95a72baa902cb192675d9a82c581505c9a501d7a589a532d8b5ef8a5bb213b766bf9abd817f2c926bb4dbf11e8103bf44da1e3e348
7
- data.tar.gz: 75b8908967dba101ee24d6726caf1baa935722b0c06f85b6f432ea855e3bd98003fdf8a2b7022fbb7d5df4c4e20bd418afc1695cc728f3d88f38b2ce53404630
6
+ metadata.gz: c9989ce57ad5c568b69fbb9b8165f07b1946e1cdb6dfe39395455fb3ccf50e45fb618f17cda4ecb788aea568e847b5dc4e1b75722db7d42ecb02b785e43f0c9b
7
+ data.tar.gz: baa4361f32ee9127fb678fafe5b6b625cf69c63a093b4aad26a9f7d7f9697d4491f09653761cfe028d1c876ae73901c6fc9fd63b1f21654bf9d28e147acd7632
@@ -3,7 +3,7 @@ name: Spec
3
3
  on:
4
4
  push:
5
5
  branches:
6
- - master
6
+ - main
7
7
  pull_request:
8
8
 
9
9
  permissions:
@@ -13,12 +13,11 @@ jobs:
13
13
  spec:
14
14
  strategy:
15
15
  matrix:
16
- os: ['ubuntu-20.04']
17
- ruby-version: ['2.6', '2.7', '3.0', '3.1']
18
- # ubuntu 22.04 only supports ssl 3 and thus only ruby 3.1
16
+ os: ['ubuntu-20.04', 'ubuntu-22.04']
17
+ ruby-version: ['3.1', '3.2', '3.3']
19
18
  include:
20
- - os: 'ubuntu-22.04'
21
- ruby-version: '3.1'
19
+ - os: 'ubuntu-20.04'
20
+ ruby-version: '3.0'
22
21
  runs-on: ${{ matrix.os }}
23
22
 
24
23
  steps:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## [2.0.2] - 2022-10-09
2
+
3
+ ### Changed
4
+
5
+ * convert Faraday::Error to SWD::Exception https://github.com/nov/SWD/commit/a5bacba3c0fe740b1e36be220980b29dc50de095
6
+
7
+ ### Fixed
8
+
9
+ * SWD::Resource#to_response_object was needed for openid_connect gem https://github.com/nov/SWD/commit/c4d916d3cd8d4fe076bd27a64403d98dea9b00ef
10
+
11
+ ## [2.0.1] - 2022-10-08
12
+
13
+ ### Fixed
14
+
15
+ * typo https://github.com/nov/SWD/commit/3fd7a4fbe8fdf586824edc5d2b4222c43e7a9655
16
+
1
17
  ## [2.0.0] - 2022-10-08
2
18
 
3
19
  ### Added
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.0.3
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
@@ -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]
@@ -100,7 +100,7 @@ describe SWD::Resource do
100
100
  context 'when Faraday::Error without response' do
101
101
  it do
102
102
  expect(SWD.http_client).to receive(:get).and_raise(Faraday::Error)
103
- expect { res = resource.discover! }.to raise_error Faraday::Error
103
+ expect { res = resource.discover! }.to raise_error SWD::Exception
104
104
  end
105
105
  end
106
106
 
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.1
4
+ version: 2.0.3
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: 2023-12-27 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.1.6
192
- signing_key:
191
+ rubygems_version: 3.4.10
192
+ signing_key:
193
193
  specification_version: 4
194
194
  summary: SWD (Simple Web Discovery) Client Library
195
195
  test_files: