dor-workflow-client 3.17.1 → 3.18.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd89b591f6e8e7790a80edd752f75c07fb26c229e66573d33a56622d776e354
|
4
|
+
data.tar.gz: 77fac4390044b85befcecde8fdbd4189881684b3ad525bed2532867cfdd7f763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee811c6387d9e647a3a6862d0f10d9f6136ccbd655c24d28664c0359c5c9925693388e95fab83fad0177049e627ffb690238b999a5b9c1c6bcddc6be4f0f469e
|
7
|
+
data.tar.gz: 0feec909ffb877f8e2dc5c4d57195c076853c4c1eda6f2a4cc5ba30923cf5f9270412f06f27b416cda226d5c88964b063b8adf8052de6916a1d2591af7f033fc
|
@@ -14,7 +14,7 @@ module Dor
|
|
14
14
|
# - completes the versioningWF:submit-version and versioningWF:start-accession steps
|
15
15
|
# - initiates accesssionWF
|
16
16
|
#
|
17
|
-
# @param [String] repo The repository the object resides in.
|
17
|
+
# @param [String] repo The repository the object resides in. This parameter is deprecated
|
18
18
|
# @param [String] druid The id of the object to delete the workflow from
|
19
19
|
# @param [Boolean] create_accession_wf Option to create accessionWF when closing a version. Defaults to true
|
20
20
|
# rubocop:disable Metrics/MethodLength
|
@@ -37,7 +37,9 @@ module Dor
|
|
37
37
|
raise ArgumentError, 'wrong number of arguments, must be 1-3'
|
38
38
|
end
|
39
39
|
|
40
|
-
|
40
|
+
Deprecation.warn(self, 'passing the repo parameter to close_version is no longer necessary. This will raise an error in dor-workflow-client version 4') if repo
|
41
|
+
|
42
|
+
requestor.request(construct_url(druid, version, create_accession_wf), 'post', '')
|
41
43
|
true
|
42
44
|
end
|
43
45
|
# rubocop:enable Metrics/MethodLength
|
@@ -46,8 +48,8 @@ module Dor
|
|
46
48
|
|
47
49
|
attr_reader :requestor
|
48
50
|
|
49
|
-
def construct_url(
|
50
|
-
url = "
|
51
|
+
def construct_url(druid, version, create_accession_wf)
|
52
|
+
url = "objects/#{druid}/versionClose"
|
51
53
|
|
52
54
|
qs_args = []
|
53
55
|
qs_args << "version=#{version}" if version
|
@@ -19,40 +19,53 @@ RSpec.describe Dor::Workflow::Client::VersionRoutes do
|
|
19
19
|
|
20
20
|
it 'calls the versionClose endpoint with druid' do
|
21
21
|
routes.close_version(repo, druid)
|
22
|
-
expect(Deprecation).to have_received(:warn)
|
22
|
+
expect(Deprecation).to have_received(:warn).twice
|
23
23
|
end
|
24
24
|
|
25
25
|
it 'optionally prevents creation of accessionWF' do
|
26
26
|
routes.close_version(repo, druid, false)
|
27
27
|
expect(mock_requestor).to have_received(:request)
|
28
|
-
.with('
|
29
|
-
expect(Deprecation).to have_received(:warn)
|
28
|
+
.with('objects/druid:123/versionClose?create-accession=false', 'post', '')
|
29
|
+
expect(Deprecation).to have_received(:warn).twice
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
context 'with kwargs' do
|
34
34
|
it 'calls the versionClose endpoint' do
|
35
|
-
routes.close_version(
|
35
|
+
routes.close_version(druid: druid)
|
36
36
|
expect(mock_requestor).to have_received(:request)
|
37
|
-
.with('
|
37
|
+
.with('objects/druid:123/versionClose', 'post', '')
|
38
|
+
end
|
39
|
+
|
40
|
+
context 'with deprecated repo arg' do
|
41
|
+
before do
|
42
|
+
allow(Deprecation).to receive(:warn)
|
43
|
+
end
|
44
|
+
|
45
|
+
it 'calls the versionClose endpoint' do
|
46
|
+
routes.close_version(repo: repo, druid: druid)
|
47
|
+
expect(mock_requestor).to have_received(:request)
|
48
|
+
.with('objects/druid:123/versionClose', 'post', '')
|
49
|
+
expect(Deprecation).to have_received(:warn)
|
50
|
+
end
|
38
51
|
end
|
39
52
|
|
40
53
|
it 'optionally prevents creation of accessionWF' do
|
41
|
-
routes.close_version(
|
54
|
+
routes.close_version(druid: druid, create_accession_wf: false)
|
42
55
|
expect(mock_requestor).to have_received(:request)
|
43
|
-
.with('
|
56
|
+
.with('objects/druid:123/versionClose?create-accession=false', 'post', '')
|
44
57
|
end
|
45
58
|
|
46
59
|
it 'optionally passes version' do
|
47
|
-
routes.close_version(
|
60
|
+
routes.close_version(druid: druid, version: 3)
|
48
61
|
expect(mock_requestor).to have_received(:request)
|
49
|
-
.with('
|
62
|
+
.with('objects/druid:123/versionClose?version=3', 'post', '')
|
50
63
|
end
|
51
64
|
|
52
65
|
it 'optionally prevents creation of accessionWF and passes version' do
|
53
|
-
routes.close_version(
|
66
|
+
routes.close_version(druid: druid, create_accession_wf: false, version: 3)
|
54
67
|
expect(mock_requestor).to have_received(:request)
|
55
|
-
.with('
|
68
|
+
.with('objects/druid:123/versionClose?version=3&create-accession=false', 'post', '')
|
56
69
|
end
|
57
70
|
end
|
58
71
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-workflow-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Willy Mene
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-01-
|
12
|
+
date: 2020-01-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -253,7 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
|
-
rubygems_version: 3.
|
256
|
+
rubygems_version: 3.0.3
|
257
257
|
signing_key:
|
258
258
|
specification_version: 4
|
259
259
|
summary: Provides convenience methods to work with the DOR Workflow Service
|