audiosocket 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ require "audiosocket/errors"
1
2
  require "faraday"
2
3
  require "json"
3
4
 
@@ -40,6 +41,7 @@ module Audiosocket
40
41
  case res.status
41
42
  when 200..299, 422 then JSON.parse res.body
42
43
  when 404 then nil
44
+ when 401 then raise Audiosocket::Unauthorized
43
45
  else raise "#{res.status}: #{res.body}"
44
46
  end
45
47
  end
@@ -0,0 +1,3 @@
1
+ module Audiosocket
2
+ class Unauthorized < StandardError; end
3
+ end
@@ -1,3 +1,3 @@
1
1
  module Audiosocket
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audiosocket
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-02 00:00:00.000000000Z
12
+ date: 2011-11-28 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
- requirement: &70115962937120 !ruby/object:Gem::Requirement
16
+ requirement: &70214736066680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0.7'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70115962937120
24
+ version_requirements: *70214736066680
25
25
  description: An authentication client for the Audiosocket API.
26
26
  email:
27
27
  - it@audiosocket.com
@@ -36,6 +36,7 @@ files:
36
36
  - audiosocket.gemspec
37
37
  - lib/audiosocket.rb
38
38
  - lib/audiosocket/client.rb
39
+ - lib/audiosocket/errors.rb
39
40
  - lib/audiosocket/version.rb
40
41
  homepage: https://github.com/audiosocket/ruby-client
41
42
  licenses: []