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 +4 -4
- data/.rubocop_todo.yml +1 -1
- data/dor-services-client.gemspec +1 -1
- data/lib/dor/services/client/object.rb +14 -2
- data/lib/dor/services/client/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17f90f597dabb405cf4771be6fd03f6ae80e8caf8180ff6a2bb6680e0ff32454
|
4
|
+
data.tar.gz: da5d8d68d8d81516e49908e3d50c192a362a6f8a18ccb46db0ea38ac874af0bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdaaa313ac9f5dfde5bbc1b9073de7c872aa1cb7870bdf89577d1031c5337fa5e214c1b943e0137024893691a2632c87992fa0eb205637ea0eab5ecfada7c7cf
|
7
|
+
data.tar.gz: a8702c0a9a0a7594bd27edc89051720b791dbeaac01be210021891b3e47e1822c789fbb63b4fd2d1a7d79fc60efac78628b32558a2d8dc2d6bc72a9c94ff2ed2
|
data/.rubocop_todo.yml
CHANGED
data/dor-services-client.gemspec
CHANGED
@@ -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.
|
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
|
-
|
69
|
+
model = Cocina::Models.build(JSON.parse(resp.body))
|
60
70
|
|
61
|
-
|
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
|
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.
|
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-
|
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.
|
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.
|
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.
|
270
|
+
rubygems_version: 3.1.2
|
271
271
|
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: A client for dor-services-app
|