dor-workflow-client 3.21.0 → 3.22.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: fa44370f3c08db522a5cfba8c511b44f096ea83cd6f3e55b209dc572a08b2922
4
- data.tar.gz: 5d59452a5abf0f368f53ed48d78799726c8127795c724773e33d0a77f66ebaa9
3
+ metadata.gz: 906e80e65d5472f448be536ba072ad4bcf1f3c8e626571ca4a8afc0261eded96
4
+ data.tar.gz: e0bce8bb182c03ad0da4ceb174d98f8a265a56099c0ad171d9fd9d4d81614ac8
5
5
  SHA512:
6
- metadata.gz: 1465b2aea82e56422aabb3193a0a9d70ae5d1cdd40d086d2369d73c67e477eb0cff7f6ffb92937d59dc5f123b0ad906e8c1ab5f95ff9ef3c9a41532e193797d1
7
- data.tar.gz: '095ab0801c5fddda8c554d32f0a537b38bc04dca3c97e50ff1aa396770aee56f2140a9e97d0e1e584b9b5269535649357eeed8be4207d12d0087dced540a8f16'
6
+ metadata.gz: 82d97ffa31566dedc9d1c63b729751b83b0b0bc0212fd3e619dce05fa01d0ee285480984db1dabe0c49087e062a07e26603d2d59bbaa788972f7b8d9456b82f6
7
+ data.tar.gz: 382673d588f6b67e46bb3610d12d48cc51fd076872835d3326693705106fa18f67d1e8360593da7548330105249520eb7f02bc7e634a2ea8cadc18a2781d46e1
@@ -2,4 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- ## Was the usage documentation (e.g. wiki, README) updated?
5
+ ## How was this change tested?
6
+
7
+
8
+
9
+ ## Which documentation and/or configurations were updated?
10
+
11
+
12
+
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Workflow
5
5
  class Client
6
- VERSION = '3.21.0'
6
+ VERSION = '3.22.0'
7
7
  end
8
8
  end
9
9
  end
@@ -278,9 +278,16 @@ module Dor
278
278
  # @param [String] repo The repository the object resides in. The service recoginzes "dor" and "sdr" at the moment
279
279
  # @param [String] druid The id of the object to delete the workflow from
280
280
  # @param [String] workflow The name of the workflow to be deleted
281
+ # @param [Integer] version The version of the workflow to delete
281
282
  # @return [Boolean] always true
282
- def delete_workflow(repo, druid, workflow)
283
- requestor.request "#{repo}/objects/#{druid}/workflows/#{workflow}", 'delete'
283
+ def delete_workflow(repo, druid, workflow, version: nil)
284
+ qs_args = if version
285
+ "?version=#{version}"
286
+ else
287
+ Deprecation.warn(self, 'Calling delete_workflow without passing version is deprecated and will result in an error in dor-workflow-client 4.0')
288
+ ''
289
+ end
290
+ requestor.request "#{repo}/objects/#{druid}/workflows/#{workflow}#{qs_args}", 'delete'
284
291
  true
285
292
  end
286
293
 
@@ -723,17 +723,29 @@ RSpec.describe Dor::Workflow::Client do
723
723
  end
724
724
 
725
725
  describe '#delete_workflow' do
726
- let(:url) { "/objects/#{@druid}/workflows/accessionWF" }
727
-
728
726
  let(:stubs) do
729
727
  Faraday::Adapter::Test::Stubs.new do |stub|
730
728
  stub.delete(url) { |_env| [202, {}, ''] }
731
729
  end
732
730
  end
733
731
 
734
- it 'sends a delete request to the workflow service' do
735
- expect(mock_http_connection).to receive(:delete).with(url).and_call_original
736
- client.delete_workflow(nil, @druid, 'accessionWF')
732
+ context 'without a version' do
733
+ let(:url) { "/objects/#{@druid}/workflows/accessionWF" }
734
+
735
+ it 'sends a delete request to the workflow service' do
736
+ expect(Deprecation).to receive(:warn)
737
+ expect(mock_http_connection).to receive(:delete).with(url).and_call_original
738
+ client.delete_workflow(nil, @druid, 'accessionWF')
739
+ end
740
+ end
741
+
742
+ context 'with a version' do
743
+ let(:url) { "/objects/#{@druid}/workflows/accessionWF?version=5" }
744
+
745
+ it 'sends a delete request to the workflow service' do
746
+ expect(mock_http_connection).to receive(:delete).with(url).and_call_original
747
+ client.delete_workflow(nil, @druid, 'accessionWF', version: 5)
748
+ end
737
749
  end
738
750
  end
739
751
 
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.21.0
4
+ version: 3.22.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-04-03 00:00:00.000000000 Z
12
+ date: 2020-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.1.2
259
+ rubygems_version: 3.0.3
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Provides convenience methods to work with the DOR Workflow Service