aptible-auth 0.4.1 → 0.4.2

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: a9972ac88acb79b1567af431d5abe065c244396a
4
- data.tar.gz: aa781a1ea825c0c74719afbfab15225fd9718cad
3
+ metadata.gz: 43d3b3d8495d9fa28087f251c458b515abbe30b9
4
+ data.tar.gz: 39012d00859e3399cb74e143bcfceb1da538b34c
5
5
  SHA512:
6
- metadata.gz: dd1f40b07be31c444b2ea20f91aaef59dec7464abf09fc289a4ed99f5e3c65eb31ac3786d536c9dbec4cc0c249cb53b9985e46a5aebc31714bdbcc01b6179f73
7
- data.tar.gz: 2efeaebb4b2af55d8606c19aa338138e693ca46f55ab2aa8bee10f5000671bc50737baa177bd726a7e7b22048685d4ea95c7e28860d1436dc9d861e720ca7062
6
+ metadata.gz: 236005d58bd5fbe2852c82115dbdfa5a8ede1fbc676c63768cf2ff65c9fac4d0c05650583832236237d091c006ae11f92149371565ffd1547c515c324f66bf54
7
+ data.tar.gz: ac7ebe93e7342b4a87820ae5aaf843c6dda08116b8860f5451e5b04c4f5a12e5617a64ff067ab1bfb86742412e15e87712e46a1303453be5f4e30a52e0ed3551
data/aptible-auth.gemspec CHANGED
@@ -6,7 +6,7 @@ require 'English'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'aptible-auth'
9
- spec.version = '0.4.1'
9
+ spec.version = '0.4.2'
10
10
  spec.authors = ['Frank Macreery']
11
11
  spec.email = ['frank@macreery.com']
12
12
  spec.description = 'Ruby client for auth.aptible.com'
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Adapter < HyperResource::Adapter::HAL_JSON
3
4
  class << self
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Client < Auth::Resource
3
4
  belongs_to :user
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Membership < Auth::Resource
3
4
  belongs_to :role
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Organization < Auth::Resource
3
4
  has_many :roles
@@ -1,5 +1,6 @@
1
1
  require 'active_support/inflector'
2
2
 
3
+ # rubocop:disable ClassAndModuleChildren
3
4
  module Aptible
4
5
  class Auth::Resource < Auth
5
6
  def self.basename
@@ -13,6 +14,7 @@ module Aptible
13
14
 
14
15
  def self.all(options = {})
15
16
  resource = find_by_url(collection_url, options)
17
+ return [] unless resource
16
18
  resource.send(basename).entries
17
19
  end
18
20
 
@@ -23,9 +25,12 @@ module Aptible
23
25
  def self.find_by_url(url, options = {})
24
26
  # REVIEW: Should exception be raised if return type mismatch?
25
27
  new(options).find_by_url(url)
26
- rescue
27
- # REVIEW: Should only 404 exceptions be nil?
28
- nil
28
+ rescue HyperResource::ClientError => e
29
+ if e.response.status == 404
30
+ return nil
31
+ else
32
+ raise e
33
+ end
29
34
  end
30
35
 
31
36
  def self.create(options)
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Role < Auth::Resource
3
4
  belongs_to :organization
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::Session < Auth::Resource
3
4
  belongs_to :user
@@ -1,5 +1,6 @@
1
1
  require 'oauth2'
2
2
 
3
+ # rubocop:disable ClassAndModuleChildren
3
4
  module Aptible
4
5
  class Auth::Token < Auth::Resource
5
6
  attr_accessor :access_token, :refresh_token, :expires_at
@@ -1,3 +1,4 @@
1
+ # rubocop:disable ClassAndModuleChildren
1
2
  module Aptible
2
3
  class Auth::User < Auth::Resource
3
4
  has_many :roles
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aptible-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-11 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