bodhi-slam 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bodhi-slam/types.rb +35 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 927cbe7fce05186291e3a60f7d5db8080b76eb78
|
4
|
+
data.tar.gz: 91d7ae587744677ec6975d09e78d90857e589e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acc7b2b51d96c0846113bef0d4e55db377eb0e6e53e1ea85988a6701ae8903d9013ee20f8138e504bc487feaf4b8dbd83e171919e697829d0463147c1cc588ed
|
7
|
+
data.tar.gz: fe8081714579f87ee22c8981aa54e958cb2a73e9b3b36dd06fd0985dc5f1db50b43568b0eecb2d43c6332c00d8d17292f2eb79c50a631aae2d668d50fb8a3097
|
data/lib/bodhi-slam/types.rb
CHANGED
@@ -68,6 +68,41 @@ module Bodhi
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
+
def patch!(params)
|
72
|
+
result = bodhi_context.connection.patch do |request|
|
73
|
+
request.url "/#{bodhi_context.namespace}/types/#{name}"
|
74
|
+
request.headers['Content-Type'] = 'application/json'
|
75
|
+
request.headers[bodhi_context.credentials_header] = bodhi_context.credentials
|
76
|
+
request.body = params.to_json
|
77
|
+
end
|
78
|
+
|
79
|
+
if result.status != 204
|
80
|
+
raise Bodhi::ApiErrors.new(body: result.body, status: result.status), "status: #{result.status}, body: #{result.body}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def update!(params)
|
85
|
+
update_attributes(params)
|
86
|
+
|
87
|
+
if invalid?
|
88
|
+
return false
|
89
|
+
end
|
90
|
+
|
91
|
+
result = bodhi_context.connection.put do |request|
|
92
|
+
request.url "/#{bodhi_context.namespace}/types/#{name}"
|
93
|
+
request.headers['Content-Type'] = 'application/json'
|
94
|
+
request.headers[bodhi_context.credentials_header] = bodhi_context.credentials
|
95
|
+
request.body = attributes.to_json
|
96
|
+
end
|
97
|
+
|
98
|
+
if result.status != 204
|
99
|
+
raise Bodhi::ApiErrors.new(body: result.body, status: result.status), "status: #{result.status}, body: #{result.body}"
|
100
|
+
end
|
101
|
+
|
102
|
+
true
|
103
|
+
end
|
104
|
+
alias :update :update!
|
105
|
+
|
71
106
|
# Queries the Bodhi API for the given +type_name+ and
|
72
107
|
# returns a Bodhi::Type
|
73
108
|
#
|