audiosocket 0.3.0 → 0.3.1

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.
data/.gitignore CHANGED
@@ -15,3 +15,4 @@ spec/reports
15
15
  test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
+ .idea
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.name = "audiosocket"
11
11
  gem.require_paths = ["lib"]
12
12
  gem.test_files = `git ls-files -- test/*`.split "\n"
13
- gem.version = "0.3.0"
13
+ gem.version = "0.3.1"
14
14
 
15
15
  gem.required_ruby_version = ">= 1.9.2"
16
16
 
@@ -40,9 +40,11 @@ module Audiosocket
40
40
  def handle res
41
41
  case res.status
42
42
  when 200..299, 422 then JSON.parse res.body
43
- when 404 then nil
44
- when 401 then raise Audiosocket::Unauthorized
45
- else raise "#{res.status}: #{res.body}"
43
+ when 401, 403 then raise Audiosocket::Unauthorized
44
+ when 404 then nil
45
+
46
+ else
47
+ raise "Unexpected response (#{res.status}) from the API:\n#{res.body}"
46
48
  end
47
49
  end
48
50
 
@@ -54,8 +56,8 @@ module Audiosocket
54
56
 
55
57
  # Send a PUT to the API, handling the response.
56
58
 
57
- def put *args, &block
58
- handle @conn.put *args, &block
59
+ def put *args
60
+ handle @conn.put *args
59
61
  end
60
62
 
61
63
  def to_s
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.3.0
4
+ version: 0.3.1
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-12-10 00:00:00.000000000Z
12
+ date: 2012-01-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
16
- requirement: &70226158123540 !ruby/object:Gem::Requirement
16
+ requirement: &70358170796420 !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: *70226158123540
24
+ version_requirements: *70358170796420
25
25
  description: An authentication client for the Audiosocket API.
26
26
  email:
27
27
  - tech@audiosocket.com
@@ -57,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  version: '0'
58
58
  requirements: []
59
59
  rubyforge_project:
60
- rubygems_version: 1.8.11
60
+ rubygems_version: 1.8.10
61
61
  signing_key:
62
62
  specification_version: 3
63
63
  summary: Helps authenticate users and generate Audiosocket API tokens.