dor-services-client 0.2.0 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4cc04584524185c77cc51392ebe2d26cdd52c62811bdefcec67c34823c7f2c77
4
- data.tar.gz: 66c0e4f1c3bc51f9e5ac0236a4d08fa7e10b4a5dcec95323a791a8c9556f1dce
3
+ metadata.gz: b45f21acc65f3b29c81ebf03e4512ee40c5003a315ff47feae0996d15d29d595
4
+ data.tar.gz: 2b2097c966dedfa7a0fc48d1b6833dd7ce635404e881672b92068d4dcd25eb6b
5
5
  SHA512:
6
- metadata.gz: 552b9071818b8ea4705176e2bcb52feb695d932c836e5e3ea65698a81e9cfc0e42e228de5ab05a115eb29cb1fa72c14a23593ea226365c25bad89305e4aaf750
7
- data.tar.gz: 88f1e631dc93a138cd8747fb25c16914011ff89be2d992d44f0660c39cc8989ced643785e4bb49446523ac3dfa57a3e1b41499342366976704a4c5b3ccf65c5a
6
+ metadata.gz: 96db3a5aa59b83229cd041a1940fdc04e0a288b956913bafb0ba5ea00c6bbab2647d4fb5d8d6cd96c5a4f1f82ec7a74e1d7621f37bd9900503a550f7b3d08762
7
+ data.tar.gz: d1943ff6479e2cc78a482fea8b51cc532ed6b96ea62db2ee9f1ff76effe23b0cf52c0045715b3bc9115fe4be6f5166f37839f9c4e5900058b9451fcb00d381cb
@@ -25,6 +25,19 @@ module Dor
25
25
 
26
26
  JSON.parse(resp.body).with_indifferent_access
27
27
  end
28
+
29
+ # Publish a new object
30
+ # @param object [String] the pid for the object
31
+ # @raise [Error] when the response is not successful.
32
+ # @return [boolean] true on success
33
+ def publish(object:)
34
+ resp = connection.post do |req|
35
+ req.url "v1/objects/#{object}/publish"
36
+ end
37
+ raise Error, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
38
+
39
+ true
40
+ end
28
41
  end
29
42
  end
30
43
  end
@@ -3,7 +3,7 @@
3
3
  module Dor
4
4
  module Services
5
5
  class Client
6
- VERSION = '0.2.0'
6
+ VERSION = '0.3.0'
7
7
  end
8
8
  end
9
9
  end
@@ -89,6 +89,14 @@ module Dor
89
89
  instance.release_tags.create(object: object, release: release, what: what, to: to, who: who)
90
90
  end
91
91
 
92
+ # Publish a new object
93
+ # @param object [String] the pid for the object
94
+ # @raise [Error] when the response is not successful.
95
+ # @return [boolean] true on success
96
+ def self.publish(object:)
97
+ instance.objects.publish(object: object)
98
+ end
99
+
92
100
  attr_writer :url
93
101
 
94
102
  private
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: 0.2.0
4
+ version: 0.3.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: 2018-12-18 00:00:00.000000000 Z
12
+ date: 2018-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport