boxspring 0.0.8 → 0.0.9

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
  SHA1:
3
- metadata.gz: 3f27bdf855383bae2c7badf7557dee3963b95ff5
4
- data.tar.gz: c0e90704af5a4e61b558b43166586e7bfe1fd59b
3
+ metadata.gz: e4d79505ec21a254c383e5374b5965fc564be603
4
+ data.tar.gz: 0f1377902122fe6f961474542a6290d56947096f
5
5
  SHA512:
6
- metadata.gz: 015be1a405c53348c9c4557acb8b0c03c84b904929efcfabb0f13d77dc42c817e20631d8c17481a56cae4ffc890ee33405249b5090db7c971d4da3079f964fd0
7
- data.tar.gz: 1ce1ac141a5d9705a21a463b4acb2a2678afe1a3a936775216c8977747b56814b02e4258a536b9d5a59a7a6d85605827ad898140c6d31b595e20d5c3ef9c0ffb
6
+ metadata.gz: 5f5d7cee56673bae333b6dab07be256e6fca1bbb3c649218719e27988632227d9ce19cf26d22491cb239d7f233423e9a1f1eeb5abb361794ea2c8edae0730efa
7
+ data.tar.gz: 8d1421646f86a83ee68742817c1417d8e18896bf9e7783c8f7527b6e35b7b1f06db80e2337129d46cf22d30d40ea5cf08c492e96d0ab67e3844e31a4733ac13e
@@ -17,15 +17,21 @@ module Boxspring
17
17
  parameters[ 'property_domain_name' ] = parameters.delete( 'domain_name' ) \
18
18
  if parameters.include?( 'domain_name' )
19
19
 
20
- # create and make the request; raise an error if one occurs
20
+ # create and make the request
21
21
  request = Request.new( parameters )
22
22
  response = request.get( '/configuration' )
23
- raise response.error if response.failure?
24
23
 
25
- # construct a property; retain the request an apu interface
26
- Property.new( response.content ).tap do | property |
27
- property.instance_variable_set( '@api_interface', request )
28
- end
24
+ # did the api request succeed
25
+ if ( response.success? )
26
+ # construct a property; assign it the api interface
27
+ Property.new( response.content ).tap do | property |
28
+ property.instance_variable_set( '@api_interface', request )
29
+ end
30
+ elsif ( response.code == '404' )
31
+ nil
32
+ else
33
+ raise response.error
34
+ end
29
35
 
30
36
  end
31
37
 
@@ -12,14 +12,14 @@ module Boxspring
12
12
  @content = decode_response_body( http_response )
13
13
  error = @content.respond_to?( :keys ) ? @content[ 'errors' ] : nil
14
14
 
15
- if @content.respond_to?( :include? ) && @content.include?( :errors )
15
+ if @content.respond_to?( :include? ) && @content.include?( 'errors' )
16
16
  @error =
17
17
  Boxspring::Error.new( @content[ 'errors' ][ 'message' ] )
18
18
  end
19
19
 
20
20
  @success =
21
21
  http_response.is_a?( Net::HTTPOK ) &&
22
- @content &&
22
+ @content.present? &&
23
23
  @error.nil?
24
24
 
25
25
  @error = Boxspring::Error.new( 'unknown' ) \
@@ -1,3 +1,3 @@
1
1
  module Boxspring
2
- VERSION = '0.0.8'
2
+ VERSION = '0.0.9'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxspring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristoph Cichocki-Romanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-09 00:00:00.000000000 Z
11
+ date: 2014-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable