dor-services-client 5.1.0 → 5.2.0
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 +4 -4
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +17 -6
- data/README.md +3 -3
- data/lib/dor/services/client/object.rb +16 -7
- data/lib/dor/services/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e4f4e37c948a87f72cc1ae3708727d86cb1cfab13f82afdcd1f4358c206a3e6
|
4
|
+
data.tar.gz: 4b07de1e7b108bc4da9b90797b70a0715e7c9c1d2f7131a2b8a72a9e37465bfb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afe38b752b640ba83c70d6b713acabb3c29c6639d8bc6c5145912d8d82de59ed21683b2032f459968af71b724d7dbc788d8a96863c2d4b5365335305429e78f8
|
7
|
+
data.tar.gz: 4f31aa52e6f7d9316f0c0e641b9092dcba333f23da86a202fb5096352ccbb445855412012d7399fcbcdfe5c8a68c9e5f6a0877c0ddb581e141b91c231c2ddfc4
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,15 +1,25 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2020-
|
3
|
+
# on 2020-04-21 15:28:36 -0400 using RuboCop version 0.82.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
9
|
# Offense count: 2
|
10
|
+
# Configuration parameters: IgnoredMethods.
|
10
11
|
Metrics/AbcSize:
|
11
|
-
|
12
|
-
|
12
|
+
Max: 20
|
13
|
+
|
14
|
+
# Offense count: 1
|
15
|
+
# Configuration parameters: CountComments.
|
16
|
+
Metrics/ClassLength:
|
17
|
+
Max: 103
|
18
|
+
|
19
|
+
# Offense count: 1
|
20
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
21
|
+
Metrics/MethodLength:
|
22
|
+
Max: 11
|
13
23
|
|
14
24
|
# Offense count: 1
|
15
25
|
Style/Documentation:
|
@@ -18,8 +28,9 @@ Style/Documentation:
|
|
18
28
|
- 'test/**/*'
|
19
29
|
- 'lib/dor/services/client.rb'
|
20
30
|
|
21
|
-
# Offense count:
|
22
|
-
#
|
31
|
+
# Offense count: 334
|
32
|
+
# Cop supports --auto-correct.
|
33
|
+
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
23
34
|
# URISchemes: http, https
|
24
|
-
|
35
|
+
Layout/LineLength:
|
25
36
|
Max: 164
|
data/README.md
CHANGED
@@ -85,16 +85,16 @@ marcxml_client.marcxml(catkey: '987654321')
|
|
85
85
|
object_client = Dor::Services::Client.object(object_identifier)
|
86
86
|
|
87
87
|
# Publish an object (push to PURL)
|
88
|
-
object_client.publish(workflow: 'releaseWF')
|
88
|
+
object_client.publish(workflow: 'releaseWF', lane_id: 'low')
|
89
89
|
|
90
90
|
# Shelve an object (push to Stacks)
|
91
|
-
object_client.shelve
|
91
|
+
object_client.shelve(lane_id: 'low')
|
92
92
|
|
93
93
|
# Start accessioning an object (initialize assemblyWF or specified workflow, and version object if needed)
|
94
94
|
object_client.accession.start(**versioning_params)
|
95
95
|
|
96
96
|
# Preserve an object (push to SDR)
|
97
|
-
object_client.preserve
|
97
|
+
object_client.preserve(lane_id: 'low')
|
98
98
|
|
99
99
|
# Update the MARC record (used in the releaseWF)
|
100
100
|
object_client.update_marc_record
|
@@ -83,10 +83,15 @@ module Dor
|
|
83
83
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
84
84
|
# @raise [UnexpectedResponse] when the response is not successful.
|
85
85
|
# @param [String] workflow ('accessionWF') which workflow to callback to.
|
86
|
+
# @param [String] lane_id for prioritization (default or low)
|
86
87
|
# @return [boolean] true on success
|
87
|
-
def publish(workflow: nil)
|
88
|
-
|
89
|
-
|
88
|
+
def publish(workflow: nil, lane_id: nil)
|
89
|
+
query_params = [].tap do |params|
|
90
|
+
params << "workflow=#{workflow}" if workflow
|
91
|
+
params << "lane-id=#{lane_id}" if lane_id
|
92
|
+
end
|
93
|
+
query_string = query_params.any? ? "?#{query_params.join('&')}" : ''
|
94
|
+
publish_path = "#{object_path}/publish#{query_string}"
|
90
95
|
resp = connection.post do |req|
|
91
96
|
req.url publish_path
|
92
97
|
end
|
@@ -98,10 +103,12 @@ module Dor
|
|
98
103
|
# Preserve an object (send to SDR)
|
99
104
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
100
105
|
# @raise [UnexpectedResponse] when the response is not successful.
|
106
|
+
# @param [String] lane_id for prioritization (default or low)
|
101
107
|
# @return [String] URL from Location response header if no errors
|
102
|
-
def preserve
|
108
|
+
def preserve(lane_id: nil)
|
109
|
+
query_string = lane_id ? "?lane-id=#{lane_id}" : ''
|
103
110
|
resp = connection.post do |req|
|
104
|
-
req.url "#{object_path}/preserve"
|
111
|
+
req.url "#{object_path}/preserve#{query_string}"
|
105
112
|
end
|
106
113
|
return resp.headers['Location'] if resp.success?
|
107
114
|
|
@@ -111,10 +118,12 @@ module Dor
|
|
111
118
|
# Shelve an object (send to Stacks)
|
112
119
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
113
120
|
# @raise [UnexpectedResponse] when the response is not successful.
|
121
|
+
# @param [String] lane_id for prioritization (default or low)
|
114
122
|
# @return [boolean] true on success
|
115
|
-
def shelve
|
123
|
+
def shelve(lane_id: nil)
|
124
|
+
query_string = lane_id ? "?lane-id=#{lane_id}" : ''
|
116
125
|
resp = connection.post do |req|
|
117
|
-
req.url "#{object_path}/shelve"
|
126
|
+
req.url "#{object_path}/shelve#{query_string}"
|
118
127
|
end
|
119
128
|
return resp.headers['Location'] if resp.success?
|
120
129
|
|
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: 5.
|
4
|
+
version: 5.2.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: 2020-
|
12
|
+
date: 2020-04-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|