pokeapi 0.3.0 → 0.3.1

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: fbf266aef125f77a8a4356e82548283942c15130
4
- data.tar.gz: d2800adcc1840164e3cdf136a36b4d2640141663
3
+ metadata.gz: 5ce31956958b03dcb46a520215f7298713ea9dba
4
+ data.tar.gz: f92288037b0ea5358f77fac29d18f6e448fdba89
5
5
  SHA512:
6
- metadata.gz: ab2950b33993bb2015664ea16378c22dab640b86e0c0a94d2aed63edfb9585683d22b367cac0a99e82d1140ddbb637a3925bf763402e3dea6ffb1d275ab4e283
7
- data.tar.gz: 131d86886a7a65b67ec507575099e87edb8bac7ca92e826ce36bb10bd0150d18a5717192668ca7f24b297f1e09942ff09e31a475f2f3a1d63593199cc0e41c28
6
+ metadata.gz: 16b062d8e53c4e2860df1241212d4b1d461ba5c0779a24300026397bc3ce854e8ab8d7e7d10fea2c94aae309aaa814e3dc21076e2752c1993df23637d0f74645
7
+ data.tar.gz: 65ab56da86dc3cba93e0cd2b1c804f3ff7663d9dd623ef15960c64f26d7557534ab5ca3d81ae7abef219ed09a69f384e924d4cea2bbff9963f5afb85d8a12561
@@ -4,6 +4,7 @@ module PokeAPI
4
4
  class Requester
5
5
  NotFoundError = Class.new(StandardError)
6
6
  TimeoutError = Class.new(StandardError)
7
+ APIError = Class.new(StandardError)
7
8
 
8
9
  API_ENDPOINT = "https://pokeapi.co/api/v2/"
9
10
  POKEMON_ENDPOINT = "pokemon/"
@@ -30,6 +31,7 @@ module PokeAPI
30
31
  http = HTTP.get("#{API_ENDPOINT}#{path}/")
31
32
  fail NotFoundError if http.code == 404
32
33
  fail TimeoutError if http.code == 504
34
+ fail APIError if http.code == 500
33
35
  JSON.parse(http.to_s, symbolize_names: true)
34
36
  end
35
37
  end
@@ -1,3 +1,3 @@
1
1
  module PokeAPI
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pokeapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edgar Ortega
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-02 00:00:00.000000000 Z
11
+ date: 2016-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http