dor-services-client 6.20.0 → 6.25.0

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: e01febaafecac6b8a5cc2f2fecf3372eb4788c56657d5a9b614b1390457eedd5
4
- data.tar.gz: 0e16c92b2de228b981064999e9c579f2c15733717513e7ee02a010c22e2a0ba0
3
+ metadata.gz: 17f90f597dabb405cf4771be6fd03f6ae80e8caf8180ff6a2bb6680e0ff32454
4
+ data.tar.gz: da5d8d68d8d81516e49908e3d50c192a362a6f8a18ccb46db0ea38ac874af0bd
5
5
  SHA512:
6
- metadata.gz: 78b422a8b98a6d051a7ac6dddcdaaf73f6e6da1d38b6b34c364107b546895e793c95c24dfb22b4851c1e7ebd0e7ff67e4e1bcfb4746e0c35f43577b9fe2db19b
7
- data.tar.gz: 57c08bccf055398a2115b17d158971144efa39999409f37a3676e80cc61a17e2b44fee49f6287cde661706046862a00916801fa1407568df5aa7429d4666b47c
6
+ metadata.gz: cdaaa313ac9f5dfde5bbc1b9073de7c872aa1cb7870bdf89577d1031c5337fa5e214c1b943e0137024893691a2632c87992fa0eb205637ea0eab5ecfada7c7cf
7
+ data.tar.gz: a8702c0a9a0a7594bd27edc89051720b791dbeaac01be210021891b3e47e1822c789fbb63b4fd2d1a7d79fc60efac78628b32558a2d8dc2d6bc72a9c94ff2ed2
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.48.0' # leave pinned to patch level until cocina-models hits 1.0
26
+ spec.add_dependency 'cocina-models', '~> 0.53.0' # 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.20.0'
6
+ VERSION = '6.25.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dor-services-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.20.0
4
+ version: 6.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-02-24 00:00:00.000000000 Z
12
+ date: 2021-03-04 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.48.0
40
+ version: 0.53.0
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.48.0
47
+ version: 0.53.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: deprecation
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -267,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
267
267
  - !ruby/object:Gem::Version
268
268
  version: '0'
269
269
  requirements: []
270
- rubygems_version: 3.1.4
270
+ rubygems_version: 3.1.2
271
271
  signing_key:
272
272
  specification_version: 4
273
273
  summary: A client for dor-services-app