dor-services-client 1.9.2 → 1.10.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: 2a48f9bc77cb02db66a08eaa41309841727192efb7c2845b4680c06567e65b24
4
- data.tar.gz: e591f3962b3dda5b511cc8c8266780ceba9e33fd9a7211f5435988aab7d1a402
3
+ metadata.gz: 9eb1dd2a0cc68a36000e3d29254a9c35078ba8b6745282b09c07031e7a9ad0ba
4
+ data.tar.gz: '02549f42301be4c3bb57534ea025e930e60cb4f8753aa9eae8ae1564d8aa27c9'
5
5
  SHA512:
6
- metadata.gz: e3b1805a43d508e006cd9cab1aa7a568674c5037438dab73d60c34d71f79e6188ddbb081a319ee6a5a80b354865d9dff41182d8bc6782408f4b18a0c20e173ce
7
- data.tar.gz: 3b07a481c35476560dc8be135352acc6cdf3c19a067435cdbe8b70de292ac73c40da2e8da15736f557c7e86ddad7c3de7746a20b134b0c41fa2016561b651610
6
+ metadata.gz: 20d3b410f88c8272d668ac26252c955bb2c152ebfde9105a33212a8f9bf5eee69260a0df81217f6300265068876db14d6a1bf252fc81346f59c9834375b2b3e1
7
+ data.tar.gz: 24638809a238ecbe7ec7c387d26e9f2890a542627c91356a9a96592bd6c75268848d7ac0c95fe152185a5bde5687354579ae7e61a873ec3ef691519c70a477b1
data/README.md CHANGED
@@ -80,7 +80,10 @@ object_client.sdr.metadata(datastream: dsid)
80
80
  object_client.sdr.signature_catalog
81
81
 
82
82
  object_client.workflow.create(wf_name: workflow_name_string)
83
+
84
+ # Create and remove workspaces
83
85
  object_client.workspace.create(source: object_path_string)
86
+ object_client.workspace.cleanup
84
87
 
85
88
  # For retrieving a workflow template
86
89
  workflows_client = Dor::Services::Client.workflows
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '1.9.2'
6
+ VERSION = '1.10.0'
7
7
  end
8
8
  end
9
9
  end
@@ -17,14 +17,28 @@ module Dor
17
17
  # @return nil
18
18
  def create(source:)
19
19
  resp = connection.post do |req|
20
- req.url "#{api_version}/objects/#{object_identifier}/initialize_workspace"
20
+ req.url workspace_path
21
21
  req.params['source'] = source
22
22
  end
23
23
  raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
24
24
  end
25
25
 
26
+ # Cleans up a workspace
27
+ # @raises [UnexpectedResponse] if the request is unsuccessful.
28
+ # @return nil
29
+ def cleanup
30
+ resp = connection.delete do |req|
31
+ req.url workspace_path
32
+ end
33
+ raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
34
+ end
35
+
26
36
  private
27
37
 
38
+ def workspace_path
39
+ "#{api_version}/objects/#{object_identifier}/workspace"
40
+ end
41
+
28
42
  attr_reader :object_identifier
29
43
  end
30
44
  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: 1.9.2
4
+ version: 1.10.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: 2019-05-24 00:00:00.000000000 Z
12
+ date: 2019-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport