dor-services-client 6.21.0 → 6.26.0.beta.1

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: 0cf34acb05205be91c759053db908f76136656b018529728e7ead0ee8952f3d0
4
- data.tar.gz: 764644cf409ac487323681c0b10d27555d8fcb02a3021b43e613d5ce4d7c490f
3
+ metadata.gz: a49955ced1894bfcf308683a6337deaa59aeab7fd405db834451d1431134c764
4
+ data.tar.gz: 30bdb02fd296c0263ef3632bf7b3c19263c865eecd5a4c0a261b1024eb9eadcd
5
5
  SHA512:
6
- metadata.gz: 80b3ac93704b0307ac224d6be8dcfb901779855179d8ece7202b90606cebf4138138cd455ce4a18ebec58cac473a43a493f9afbe8a9dd3531289e3ba1a39ad85
7
- data.tar.gz: 99ba77e8b712597f8f37dafd1cfbec5164347293369682eb37ed2cf0259d883d6aaf40e030b24511da2381ae18c9466e1e3cf7981af3fd391394e79406985144
6
+ metadata.gz: 11f6a583325eb9913df2860f014ea0a23e4c7d89b9d13374970a0eb83497e9b73d419dd503966723a5e8b15cdc35c62a8d8df941c016fb7f20e57dcdb775fdba
7
+ data.tar.gz: 792cb313a59b7e83c8f3469b585cb87315171e47634b9bc8bb8d62aad975dc363014b73bd92a1e41473cd34896a1bf3e23fa6b4f6056277b610a8768cd9bb02f
data/.rubocop_todo.yml CHANGED
@@ -14,7 +14,7 @@ Metrics/AbcSize:
14
14
  # Offense count: 1
15
15
  # Configuration parameters: CountComments.
16
16
  Metrics/ClassLength:
17
- Max: 113
17
+ Max: 115
18
18
 
19
19
  # Offense count: 1
20
20
  # Configuration parameters: CountComments, ExcludedMethods.
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.require_paths = ['lib']
24
24
 
25
25
  spec.add_dependency 'activesupport', '>= 4.2', '< 7'
26
- spec.add_dependency 'cocina-models', '~> 0.49.0' # leave pinned to patch level until cocina-models hits 1.0
26
+ spec.add_dependency 'cocina-models', '~> 0.54.0.beta' # leave pinned to patch level until cocina-models hits 1.0
27
27
  spec.add_dependency 'deprecation', '>= 0'
28
28
  spec.add_dependency 'faraday', '>= 0.15', '< 2'
29
29
  spec.add_dependency 'moab-versioning', '~> 4.0'
@@ -52,13 +52,25 @@ module Dor
52
52
  # @raise [UnexpectedResponse] when the response is not successful.
53
53
  # @return [Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy] the returned model
54
54
  def find
55
+ find_with_metadata.first
56
+ end
57
+
58
+ # Retrieves the Cocina model and response metadata
59
+ # @raise [NotFoundResponse] when the response is a 404 (object not found)
60
+ # @raise [UnexpectedResponse] when the response is not successful.
61
+ # @return [Array<Cocina::Models::DRO,Cocina::Models::Collection,Cocina::Models::AdminPolicy,Hash>] a tuple where
62
+ # the first is the model and the second is a hash of metadata
63
+ def find_with_metadata
55
64
  resp = connection.get do |req|
56
65
  req.url object_path
57
66
  end
67
+ raise_exception_based_on_response!(resp) unless resp.success?
58
68
 
59
- return Cocina::Models.build(JSON.parse(resp.body)) if resp.success?
69
+ model = Cocina::Models.build(JSON.parse(resp.body))
60
70
 
61
- raise_exception_based_on_response!(resp)
71
+ # Don't use #slice here as Faraday will downcase the keys.
72
+ metadata = { 'Last-Modified' => resp.headers['Last-Modified'] }
73
+ [model, metadata]
62
74
  end
63
75
 
64
76
  # Updates the object
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '6.21.0'
6
+ VERSION = '6.26.0.beta.1'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.21.0
4
+ version: 6.26.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  - Michael Giarlo
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-26 00:00:00.000000000 Z
12
+ date: 2021-03-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -37,14 +37,14 @@ dependencies:
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.49.0
40
+ version: 0.54.0.beta
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.49.0
47
+ version: 0.54.0.beta
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -205,7 +205,7 @@ dependencies:
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
- description:
208
+ description:
209
209
  email:
210
210
  - jcoyne@justincoyne.com
211
211
  - leftwing@alumni.rutgers.edu
@@ -252,7 +252,7 @@ files:
252
252
  homepage: https://github.com/sul-dlss/dor-services-client
253
253
  licenses: []
254
254
  metadata: {}
255
- post_install_message:
255
+ post_install_message:
256
256
  rdoc_options: []
257
257
  require_paths:
258
258
  - lib
@@ -263,12 +263,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  requirements:
266
- - - ">="
266
+ - - ">"
267
267
  - !ruby/object:Gem::Version
268
- version: '0'
268
+ version: 1.3.1
269
269
  requirements: []
270
- rubygems_version: 3.0.3
271
- signing_key:
270
+ rubygems_version: 3.0.6
271
+ signing_key:
272
272
  specification_version: 4
273
273
  summary: A client for dor-services-app
274
274
  test_files: []