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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/bodhi-slam/types.rb +35 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e9af8f3a60f5c928cc39a0f5df65c46e47eb3b0
4
- data.tar.gz: 81a7a28bf4cac68fc93e54fc99ed7bc6f7a7e29b
3
+ metadata.gz: 927cbe7fce05186291e3a60f7d5db8080b76eb78
4
+ data.tar.gz: 91d7ae587744677ec6975d09e78d90857e589e14
5
5
  SHA512:
6
- metadata.gz: ecf075fc21d0d3b801b702466ec8d2d6b9d4b127bdd2b139e53fcbae092ca420f6c1772251fb41645466699238d02725207bf4c96d367004e8ab9930a2f84dd0
7
- data.tar.gz: 9e1b586f781e53677d2703f0f6d209f9b70d7389ee5ef5fb21be256e7452ea59433599b96c5160ddc03c2b9d9e2277aa8a43d7add262da67d2dbe49741524676
6
+ metadata.gz: acc7b2b51d96c0846113bef0d4e55db377eb0e6e53e1ea85988a6701ae8903d9013ee20f8138e504bc487feaf4b8dbd83e171919e697829d0463147c1cc588ed
7
+ data.tar.gz: fe8081714579f87ee22c8981aa54e958cb2a73e9b3b36dd06fd0985dc5f1db50b43568b0eecb2d43c6332c00d8d17292f2eb79c50a631aae2d668d50fb8a3097
@@ -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
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bodhi-slam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.5
4
+ version: 0.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - willdavis