pokegem 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -2
- data/lib/pokegem.rb +1 -1
- data/lib/pokegem/version.rb +1 -1
- data/pokegem.gemspec +3 -0
- metadata +39 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61c082b1d5711726becb5d07dd006c105daa184c
|
4
|
+
data.tar.gz: cfd40f06af1bbd819c5db75ffe4ec60b73ed620b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d5211bae231067a8010dba52e315f51ff9ffef5b40f0bb48bb25c7b193d2c646e42d56168c7193c16c93e6da46f4cca3e289ab477a75ff9f178b1fd40c5f9d4
|
7
|
+
data.tar.gz: 4bc2d0da10c6c9ea326487105b28086f075c7cde79cb083b3a32af4fe4a5c97baceae7ad6499f707fc0647428e3cae32b28de4310c142cebe2b3276448ea6eb8
|
data/README.md
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
http://pokeapi.co/
|
4
4
|
|
5
|
-
Simple to use wrapper for the pokeapi, with basic caching
|
5
|
+
Simple to use wrapper for the pokeapi v1, with basic caching
|
6
6
|
|
7
7
|
Resources:
|
8
8
|
```
|
9
|
-
pokedex, pokemon,
|
9
|
+
pokedex, pokemon, move, ability, type, egg, description, sprite, game
|
10
10
|
```
|
11
11
|
|
12
12
|
## Usage
|
@@ -15,6 +15,17 @@ Pokegem.get resource, number # => JSON Response
|
|
15
15
|
Pokegem.get_obj resource, number # => OpenStruct from Response
|
16
16
|
```
|
17
17
|
|
18
|
+
## Examples
|
19
|
+
```
|
20
|
+
Pokegem.get "pokemon", 25 # => JSON Response containing Pikachu's data
|
21
|
+
Pokegem.get_obj "type", 10 # => Object containing Fire type's data
|
22
|
+
```
|
23
|
+
|
24
|
+
## Pokéapi v2
|
25
|
+
According to Pokéapi's creator, Paul Hallet, v1 will be deprecated in January 2015 (http://phalt.co/if-you-have-data-they-will-consume-it/).
|
26
|
+
|
27
|
+
After release of v2, this gem will be updated to match the new API.
|
28
|
+
|
18
29
|
## Contributing
|
19
30
|
|
20
31
|
1. Fork it ( http://github.com/baweaver/pokegem/fork )
|
data/lib/pokegem.rb
CHANGED
@@ -5,7 +5,7 @@ require 'json'
|
|
5
5
|
module Pokegem
|
6
6
|
class << self
|
7
7
|
BASE_URL = 'http://pokeapi.co/api/v1'
|
8
|
-
RESOURCES = %w(pokedex pokemon
|
8
|
+
RESOURCES = %w(pokedex pokemon move ability type egg description sprite game)
|
9
9
|
|
10
10
|
def init_hash; RESOURCES.reduce({}) { |h, r| h.merge! r => {} } end
|
11
11
|
|
data/lib/pokegem/version.rb
CHANGED
data/pokegem.gemspec
CHANGED
@@ -17,6 +17,9 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
+
spec.add_runtime_dependency "typhoeus"
|
21
|
+
spec.add_runtime_dependency "json"
|
22
|
+
|
20
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
21
24
|
spec.add_development_dependency "rake"
|
22
25
|
end
|
metadata
CHANGED
@@ -1,41 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pokegem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Weaver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: typhoeus
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: bundler
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
|
-
- - ~>
|
45
|
+
- - "~>"
|
18
46
|
- !ruby/object:Gem::Version
|
19
47
|
version: '1.5'
|
20
48
|
type: :development
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
|
-
- - ~>
|
52
|
+
- - "~>"
|
25
53
|
- !ruby/object:Gem::Version
|
26
54
|
version: '1.5'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rake
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- -
|
59
|
+
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
61
|
version: '0'
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
|
-
- -
|
66
|
+
- - ">="
|
39
67
|
- !ruby/object:Gem::Version
|
40
68
|
version: '0'
|
41
69
|
description:
|
@@ -45,7 +73,7 @@ executables: []
|
|
45
73
|
extensions: []
|
46
74
|
extra_rdoc_files: []
|
47
75
|
files:
|
48
|
-
- .gitignore
|
76
|
+
- ".gitignore"
|
49
77
|
- Gemfile
|
50
78
|
- LICENSE.txt
|
51
79
|
- README.md
|
@@ -63,18 +91,19 @@ require_paths:
|
|
63
91
|
- lib
|
64
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- -
|
94
|
+
- - ">="
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
69
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
98
|
requirements:
|
71
|
-
- -
|
99
|
+
- - ">="
|
72
100
|
- !ruby/object:Gem::Version
|
73
101
|
version: '0'
|
74
102
|
requirements: []
|
75
103
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.2.2
|
77
105
|
signing_key:
|
78
106
|
specification_version: 4
|
79
107
|
summary: Simple Ruby Wrapper for the PokeAPI
|
80
108
|
test_files: []
|
109
|
+
has_rdoc:
|