dor-services-client 5.1.0 → 5.2.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: 456668a1280fa0e7dd4423a81dcc50d1273dadd0dba808928927941638c15ac7
4
- data.tar.gz: 31f9cb181859491b26e0192abbdf559bc49326c2086f1267f8aab04e6b3a1279
3
+ metadata.gz: 2e4f4e37c948a87f72cc1ae3708727d86cb1cfab13f82afdcd1f4358c206a3e6
4
+ data.tar.gz: 4b07de1e7b108bc4da9b90797b70a0715e7c9c1d2f7131a2b8a72a9e37465bfb
5
5
  SHA512:
6
- metadata.gz: 2c06f5c320d447f4b5b7b53659a71c1836c19b6b7d456344fc6442a2d4c4c91ea6d2d9a176a1f3921a8732283d9390a7c78b24b03966ba0bbd6b58324fed575a
7
- data.tar.gz: 52e84748ee08d4e663c5b2851133ab59aeb2229e04bab863733be7fd3d70a15238ff470d7569d7c8271208139196ddddd274124416a59811b2b971b77802fbf2
6
+ metadata.gz: afe38b752b640ba83c70d6b713acabb3c29c6639d8bc6c5145912d8d82de59ed21683b2032f459968af71b724d7dbc788d8a96863c2d4b5365335305429e78f8
7
+ data.tar.gz: 4f31aa52e6f7d9316f0c0e641b9092dcba333f23da86a202fb5096352ccbb445855412012d7399fcbcdfe5c8a68c9e5f6a0877c0ddb581e141b91c231c2ddfc4
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.3
4
+ TargetRubyVersion: 2.5
5
5
 
6
6
  Metrics/BlockLength:
7
7
  Exclude:
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-02-13 15:40:30 -0800 using RuboCop version 0.61.1.
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
- Exclude:
12
- - 'lib/dor/services/client/marcxml.rb'
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: 256
22
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
31
+ # Offense count: 334
32
+ # Cop supports --auto-correct.
33
+ # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
23
34
  # URISchemes: http, https
24
- Metrics/LineLength:
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
- publish_path = "#{object_path}/publish"
89
- publish_path = "#{publish_path}?workflow=#{workflow}" if workflow
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
 
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '5.1.0'
6
+ VERSION = '5.2.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: 5.1.0
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-03-31 00:00:00.000000000 Z
12
+ date: 2020-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport