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 +4 -4
- data/lib/dor/services/client/objects.rb +13 -0
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client.rb +8 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b45f21acc65f3b29c81ebf03e4512ee40c5003a315ff47feae0996d15d29d595
|
|
4
|
+
data.tar.gz: 2b2097c966dedfa7a0fc48d1b6833dd7ce635404e881672b92068d4dcd25eb6b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/dor/services/client.rb
CHANGED
|
@@ -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.
|
|
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-
|
|
12
|
+
date: 2018-12-19 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|