aptible-api 0.4.3 → 0.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b89501289703ff5b2b99d93ea965c3fbb4b69c22
4
- data.tar.gz: 07e6d2fa80f42503fbc3855b06ab4c7876439999
3
+ metadata.gz: 4c774e10f821b26ab78c7eeccf051c95a03e916a
4
+ data.tar.gz: b864ee0b17047f0f44429f17923c5bcc8759507e
5
5
  SHA512:
6
- metadata.gz: 7b9f6920b3d1345a45c47474131b1f5ba5beb23c174564311b380d11472932f8075c83baf90bc078b571d50dff025c28a254166b0f0ef1d44ee4796bea21e98b
7
- data.tar.gz: 644e417a2a68506d1867bcd8bcd90f40eb113b9d9ceac0c4e13636d75f4951b14d05656a7332b6827beb41f9f3c433471e632992e637c7936c965e2ef780040f
6
+ metadata.gz: 893fa1a9ec6a8933be486363134656dd5b8b557c230d6f45d52223d8c3f024fdebc834348dff740d60a03b6543a0c05524e6d397a574cd892ecd5675f913784d
7
+ data.tar.gz: 1ba6d451ac6b92c2ba8f7195fe6912e1df21f8cb9d0b52d444b821729a49096f9d1831c289dc43a1e420bfcec3d234df902270ce79f0957109b411d9c7902fbe
@@ -6,7 +6,7 @@ require 'English'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'aptible-api'
9
- spec.version = '0.4.3'
9
+ spec.version = '0.4.4'
10
10
  spec.authors = ['Frank Macreery']
11
11
  spec.email = ['frank@macreery.com']
12
12
  spec.description = %q(Ruby client for api.aptible.com)
@@ -22,6 +22,7 @@ module Aptible
22
22
 
23
23
  def self.all(options = {})
24
24
  resource = find_by_url(collection_url, options)
25
+ return [] unless resource
25
26
  resource.send(basename).entries
26
27
  end
27
28
 
@@ -32,9 +33,12 @@ module Aptible
32
33
  def self.find_by_url(url, options = {})
33
34
  # REVIEW: Should exception be raised if return type mismatch?
34
35
  new(options).find_by_url(url)
35
- rescue
36
- # REVIEW: Should only 404 exceptions be nil?
37
- nil
36
+ rescue HyperResource::ClientError => e
37
+ if e.response.status == 404
38
+ return nil
39
+ else
40
+ raise e
41
+ end
38
42
  end
39
43
 
40
44
  def self.create(options)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-22 00:00:00.000000000 Z
11
+ date: 2014-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_config