stupeflix 0.0.5 → 0.0.6

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.
@@ -1,3 +1,3 @@
1
1
  module Stupeflix
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
data/lib/stupeflix.rb CHANGED
@@ -21,14 +21,16 @@ module Stupeflix
21
21
 
22
22
  def definition= d
23
23
  params, headers = req('PUT', d, 'text/xml', Time.now.to_i, url = "#{self.url}/definition/")
24
- self.class.put url, query: params, headers: headers, body: d
24
+ r = self.class.put url, query: params, headers: headers, body: d
25
+ raise RuntimeError("Invalid response: #{r.response.code}") unless r.response.code.to_i == 200
25
26
  end
26
27
 
27
28
  # TODO make this an array or..?
28
29
  def profiles= profiles_xml
29
30
  params, headers = req('POST', body = "ProfilesXML=#{::CGI::escape profiles_xml}",
30
31
  'application/x-www-form-urlencoded', Time.now.to_i, url = "#{self.url}/")
31
- self.class.post url, query: params, headers: headers, body: body
32
+ r = self.class.post url, query: params, headers: headers, body: body
33
+ raise RuntimeError("Invalid response: #{r.response.code}") unless r.response.code.to_i == 200
32
34
  end
33
35
 
34
36
  def status
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stupeflix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: