arena 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
data/lib/arena/client.rb CHANGED
@@ -39,7 +39,7 @@ module Arena
39
39
  end
40
40
 
41
41
  def error?(response)
42
- !response['status']['code'].nil?
42
+ response.code != 200
43
43
  end
44
44
 
45
45
  def error_message(response)
@@ -47,11 +47,12 @@ module Arena
47
47
  end
48
48
 
49
49
  def request(method, path, options)
50
- response = JSON.parse self.class.send(method, "http://#{@base_domain}/#{@api_version}#{path}", options).body
51
-
52
- raise Arena::Error.new(error_message(response)) if error?(response)
50
+ response = self.class.send(method, "http://#{@base_domain}/#{@api_version}#{path}", options)
51
+ parsed = JSON.parse(response.body)
52
+
53
+ raise Arena::Error.new(error_message(parsed)) if error?(response)
53
54
 
54
- return response
55
+ return parsed
55
56
 
56
57
  rescue JSON::ParserError, TypeError
57
58
  nil
data/lib/arena/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Arena
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arena
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: