pokemon_tcg_sdk 2.5.0 → 4.2.0

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.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +3 -0
  3. data/.gitignore +23 -24
  4. data/.travis.yml +15 -4
  5. data/CODE_OF_CONDUCT.md +48 -48
  6. data/Gemfile +4 -4
  7. data/LICENSE.txt +21 -21
  8. data/README.md +187 -155
  9. data/Rakefile +20 -10
  10. data/lib/pokemon_tcg_sdk.rb +38 -31
  11. data/lib/pokemon_tcg_sdk/ability.rb +14 -10
  12. data/lib/pokemon_tcg_sdk/ancient_trait.rb +13 -10
  13. data/lib/pokemon_tcg_sdk/attack.rb +16 -10
  14. data/lib/pokemon_tcg_sdk/card.rb +69 -42
  15. data/lib/pokemon_tcg_sdk/card_images.rb +13 -0
  16. data/lib/pokemon_tcg_sdk/configuration.rb +8 -8
  17. data/lib/pokemon_tcg_sdk/legalities.rb +14 -0
  18. data/lib/pokemon_tcg_sdk/query_builder.rb +63 -67
  19. data/lib/pokemon_tcg_sdk/rarity.rb +12 -0
  20. data/lib/pokemon_tcg_sdk/resistance.rb +14 -0
  21. data/lib/pokemon_tcg_sdk/rest_client.rb +43 -31
  22. data/lib/pokemon_tcg_sdk/set.rb +50 -40
  23. data/lib/pokemon_tcg_sdk/set_images.rb +13 -0
  24. data/lib/pokemon_tcg_sdk/subtype.rb +11 -11
  25. data/lib/pokemon_tcg_sdk/supertype.rb +11 -11
  26. data/lib/pokemon_tcg_sdk/tcgplayer.rb +44 -0
  27. data/lib/pokemon_tcg_sdk/type.rb +11 -11
  28. data/lib/pokemon_tcg_sdk/version.rb +3 -3
  29. data/lib/pokemon_tcg_sdk/weakness.rb +13 -0
  30. data/pokemon_tcg_sdk.gemspec +32 -34
  31. metadata +33 -61
  32. data/lib/pokemon_tcg_sdk/representers/ability_representer.rb +0 -11
  33. data/lib/pokemon_tcg_sdk/representers/ancient_trait_representer.rb +0 -10
  34. data/lib/pokemon_tcg_sdk/representers/attack_representer.rb +0 -13
  35. data/lib/pokemon_tcg_sdk/representers/card_representer.rb +0 -40
  36. data/lib/pokemon_tcg_sdk/representers/set_representer.rb +0 -17
  37. data/lib/pokemon_tcg_sdk/representers/type_value_representer.rb +0 -10
  38. data/lib/pokemon_tcg_sdk/type_value.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: aa73b62742bf325c68cc062c79de894df403958c
4
- data.tar.gz: db444bf8bbc1d4fb81a76e8bdc838895c64228c2
2
+ SHA256:
3
+ metadata.gz: 3e977885d8f2004da9c303adcc0a2a7ef7dc258089de75d44c6a41efba6261fd
4
+ data.tar.gz: 88d8387350aa7a29d33e26895d4531efaf8787116b0335be4190feff510dff95
5
5
  SHA512:
6
- metadata.gz: 8ae47f7b9425799510b57bba57e99023feb255fb0f2e96db62a4de9520a217ac02988203971c8a62e848f0dd870a31046598223aa41f415c74160d8477bf4b41
7
- data.tar.gz: 0f6f15852265e2ed2c19562ed2af4f1eaa24cde6a87c2c1237b360497992cfe34d44f488c4dc7db30893f6425528e34bce9b1dbea05540735bc4fc8b1483f4e4
6
+ metadata.gz: f7702e77d1aa11789704fa93932177f273ddebf90ff27272fce447e1aa5d8d326a6abe3b6d600a2f888362b45bca5597a2b03a6fd98188dc37b6f32bd3a87d13
7
+ data.tar.gz: d081c1c24143b10d571be748b633b31dd8b15e5f593494c2bd1f875d732f1eb0ed433b6f5db8f0dee7da03677148cecc7f0344faf4ea45301aa79c297c17b2c2
data/.editorconfig ADDED
@@ -0,0 +1,3 @@
1
+ [*.rb]
2
+ indent_size = 2
3
+ indent_style = space
data/.gitignore CHANGED
@@ -1,25 +1,24 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- test/fixtures
18
- coverage
19
- tmp
20
- *.bundle
21
- *.so
22
- *.o
23
- *.a
24
- mkmf.log
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ coverage
18
+ tmp
19
+ *.bundle
20
+ *.so
21
+ *.o
22
+ *.a
23
+ mkmf.log
25
24
  .vscode
data/.travis.yml CHANGED
@@ -1,4 +1,15 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.0
4
- before_install: gem install bundler -v 1.12.5
1
+ env:
2
+ global:
3
+ - CC_TEST_REPORTER_ID=c14dfc2c8a10a029ac3706d2c2c86f63f663a1445df6213e013a42cbc9a55e74
4
+ language: ruby
5
+ rvm:
6
+ - 2.7.0
7
+ before_install: gem install bundler -v 2.1.4
8
+ before_script:
9
+ - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
10
+ - chmod +x ./cc-test-reporter
11
+ - ./cc-test-reporter before-build
12
+ script:
13
+ - rake test
14
+ after_script:
15
+ - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,49 +1,49 @@
1
- # Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, and in the interest of
4
- fostering an open and welcoming community, we pledge to respect all people who
5
- contribute through reporting issues, posting feature requests, updating
6
- documentation, submitting pull requests or patches, and other activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, ethnicity, age, religion, or nationality.
12
-
13
- Examples of unacceptable behavior by participants include:
14
-
15
- * The use of sexualized language or imagery
16
- * Personal attacks
17
- * Trolling or insulting/derogatory comments
18
- * Public or private harassment
19
- * Publishing other's private information, such as physical or electronic
20
- addresses, without explicit permission
21
- * Other unethical or unprofessional conduct
22
-
23
- Project maintainers have the right and responsibility to remove, edit, or
24
- reject comments, commits, code, wiki edits, issues, and other contributions
25
- that are not aligned to this Code of Conduct, or to ban temporarily or
26
- permanently any contributor for other behaviors that they deem inappropriate,
27
- threatening, offensive, or harmful.
28
-
29
- By adopting this Code of Conduct, project maintainers commit themselves to
30
- fairly and consistently applying these principles to every aspect of managing
31
- this project. Project maintainers who do not follow or enforce the Code of
32
- Conduct may be permanently removed from the project team.
33
-
34
- This code of conduct applies both within project spaces and in public spaces
35
- when an individual is representing the project or its community.
36
-
37
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
- reported by contacting a project maintainer at backes.andrew@gmail.com. All
39
- complaints will be reviewed and investigated and will result in a response that
40
- is deemed necessary and appropriate to the circumstances. Maintainers are
41
- obligated to maintain confidentiality with regard to the reporter of an
42
- incident.
43
-
44
- This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
- version 1.3.0, available at
46
- [http://contributor-covenant.org/version/1/3/0/][version]
47
-
48
- [homepage]: http://contributor-covenant.org
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at backes.andrew@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
49
  [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in pokemon_tcg_sdk.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pokemon_tcg_sdk.gemspec
4
+ gemspec
data/LICENSE.txt CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2016 Andrew Backes
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Andrew Backes
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md CHANGED
@@ -1,155 +1,187 @@
1
- # Pokémon TCG SDK
2
-
3
- [![Gem Version](https://badge.fury.io/rb/pokemon_tcg_sdk.svg)](https://badge.fury.io/rb/pokemon_tcg_sdk)
4
- [![Build Status](https://travis-ci.org/PokemonTCG/pokemon-tcg-sdk-ruby.svg?branch=master)](https://travis-ci.org/PokemonTCG/pokemon-tcg-sdk-ruby)
5
- [![Dependency Status](https://gemnasium.com/badges/github.com/PokemonTCG/pokemon-tcg-sdk-ruby.svg)](https://gemnasium.com/github.com/PokemonTCG/pokemon-tcg-sdk-ruby)
6
- [![Code Climate](https://codeclimate.com/github/PokemonTCG/pokemon-tcg-sdk-ruby/badges/gpa.svg)](https://codeclimate.com/github/PokemonTCG/pokemon-tcg-sdk-ruby)
7
- [![Coverage Status](https://coveralls.io/repos/github/PokemonTCG/pokemon-tcg-sdk-ruby/badge.svg?branch=master)](https://coveralls.io/github/PokemonTCG/pokemon-tcg-sdk-ruby?branch=master)
8
-
9
- This is the Pokémon TCG SDK Ruby implementation. It is a wrapper around the Pokémon TCG API of [pokemontcg.io](http://pokemontcg.io/).
10
-
11
- ## Installation
12
-
13
- Add this line to your application's Gemfile:
14
-
15
- gem 'pokemon_tcg_sdk'
16
-
17
- And then execute:
18
-
19
- $ bundle
20
-
21
- Or install it yourself as:
22
-
23
- $ gem install pokemon_tcg_sdk
24
-
25
- ## Usage
26
-
27
- To change the API version (currently defaults to version 1)
28
-
29
- Pokemon.configure do |config|
30
- config.api_version = 2
31
- end
32
-
33
- ### Classes
34
-
35
- Card
36
- Set
37
- Type
38
- Supertype
39
- Subtype
40
- Ability
41
- AncientTrait
42
- Attack
43
- TypeValue
44
-
45
- ### Properties Per Class
46
-
47
- #### Card
48
-
49
- id
50
- name
51
- national_pokedex_number
52
- image_url
53
- image_url_hi_res
54
- subtype
55
- supertype
56
- ability
57
- ancient_trait
58
- hp
59
- number
60
- artist
61
- rarity
62
- series
63
- set
64
- set_code
65
- retreat_cost
66
- text
67
- types
68
- attacks
69
- weaknesses
70
- resistances
71
- evolves_from
72
-
73
- #### Set
74
-
75
- code
76
- name
77
- series
78
- total_cards
79
- standard_legal
80
- expanded_legal
81
- release_date
82
-
83
- #### Ability
84
-
85
- name
86
- text
87
- type
88
-
89
- #### AncientTrait
90
-
91
- name
92
- text
93
-
94
- #### Attack
95
-
96
- cost
97
- name
98
- text
99
- damage
100
- converted_energy_cost
101
-
102
- #### TypeValue
103
-
104
- type
105
- value
106
-
107
- ### Functions Available
108
-
109
- #### Find a card by id
110
-
111
- card = Pokemon::Card.find('xy1-1')
112
-
113
- #### Filter Cards via query parameters
114
-
115
- cards = Pokemon::Card.where(set: 'generations').where(supertype: 'pokemon').all
116
-
117
- #### Find all cards (will take awhile)
118
-
119
- cards = Pokemon::Card.all
120
-
121
- #### Get all cards, but only a specific page of data
122
-
123
- cards = Pokemon::Card.where(page: 5).where(pageSize: 100).all
124
-
125
- #### Find a set by code
126
-
127
- set = Pokemon::Set.find('base1')
128
-
129
- #### Filter sets via query parameters
130
-
131
- sets = Pokemon::Set.where(standardLegal: true).all
132
-
133
- #### Get all Sets
134
-
135
- sets = Pokemon::Set.all
136
-
137
- #### Get all Types
138
-
139
- types = Pokemon::Type.all
140
-
141
- #### Get all Subtypes
142
-
143
- subtypes = Pokemon::Subtype.all
144
-
145
- #### Get all Supertypes
146
-
147
- supertypes = Pokemon::Supertype.all
148
-
149
- ## Contributing
150
-
151
- 1. Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-ruby/fork )
152
- 2. Create your feature branch (`git checkout -b my-new-feature`)
153
- 3. Commit your changes (`git commit -am 'Add some feature'`)
154
- 4. Push to the branch (`git push origin my-new-feature`)
155
- 5. Create a new Pull Request
1
+ # Pokémon TCG SDK
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/pokemon_tcg_sdk.svg)](https://badge.fury.io/rb/pokemon_tcg_sdk)
4
+ [![Build Status](https://travis-ci.org/PokemonTCG/pokemon-tcg-sdk-ruby.svg?branch=master)](https://travis-ci.org/PokemonTCG/pokemon-tcg-sdk-ruby)
5
+ [![Dependency Status](https://gemnasium.com/badges/github.com/PokemonTCG/pokemon-tcg-sdk-ruby.svg)](https://gemnasium.com/github.com/PokemonTCG/pokemon-tcg-sdk-ruby)
6
+ [![Code Climate](https://codeclimate.com/github/PokemonTCG/pokemon-tcg-sdk-ruby/badges/gpa.svg)](https://codeclimate.com/github/PokemonTCG/pokemon-tcg-sdk-ruby)
7
+ [![Test Coverage](https://api.codeclimate.com/v1/badges/ee9d7d6ee5f8276729bc/test_coverage)](https://codeclimate.com/github/PokemonTCG/pokemon-tcg-sdk-ruby/test_coverage)
8
+
9
+ ### Now supporting Version 2 of the Pokémon TCG API!
10
+
11
+ This is the Pokémon TCG SDK Ruby implementation. It is a wrapper around the Pokémon TCG API of [pokemontcg.io](http://pokemontcg.io/).
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ gem 'pokemon_tcg_sdk'
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install pokemon_tcg_sdk
26
+
27
+ ## Usage
28
+
29
+ To configure your API Key:
30
+
31
+ Pokemon.configure do |config|
32
+ config.api_key = "xxxxxxxxx"
33
+ end
34
+
35
+ ### Classes
36
+
37
+ Card
38
+ Set
39
+ Type
40
+ Supertype
41
+ Subtype
42
+ Ability
43
+ AncientTrait
44
+ Attack
45
+ Resistance
46
+ Weakness
47
+ Legalities
48
+ Rarity
49
+ SetImages
50
+ CardImages
51
+ Tcgplayer
52
+
53
+ ### Properties Per Class
54
+
55
+ #### Card
56
+
57
+ id
58
+ name
59
+ supertype
60
+ subtypes
61
+ level
62
+ hp
63
+ types
64
+ evolves_from
65
+ evolves_to
66
+ rules
67
+ ancient_trait
68
+ abilities
69
+ weaknesses
70
+ resistances
71
+ retreat_cost
72
+ converted_retreat_cost
73
+ set
74
+ number
75
+ artist
76
+ rarity
77
+ national_pokedex_numbers
78
+ legalities
79
+ tcgplayer
80
+ images
81
+ flavor_text
82
+
83
+ #### Set
84
+
85
+ id
86
+ name
87
+ series
88
+ printedTotal
89
+ total
90
+ legalities
91
+ ptcgo_code
92
+ release_date
93
+ updated_at
94
+ images
95
+
96
+ #### Ability
97
+
98
+ name
99
+ text
100
+ type
101
+
102
+ #### AncientTrait
103
+
104
+ name
105
+ text
106
+
107
+ #### Attack
108
+
109
+ cost
110
+ name
111
+ text
112
+ damage
113
+ converted_energy_cost
114
+
115
+ #### Weakness
116
+
117
+ type
118
+ value
119
+
120
+ #### Resistance
121
+
122
+ type
123
+ value
124
+
125
+ #### CardImages
126
+
127
+ small
128
+ large
129
+
130
+ #### SetImages
131
+
132
+ logo
133
+ symbol
134
+
135
+ ### Functions Available
136
+
137
+ #### Find a card by id
138
+
139
+ card = Pokemon::Card.find('xy1-1')
140
+
141
+ #### Filter Cards via query parameters
142
+
143
+ cards = Pokemon::Card.where(q: 'set.name:generations subtypes:mega')
144
+
145
+ #### Find all cards (will take awhile)
146
+
147
+ cards = Pokemon::Card.all
148
+
149
+ #### Get all cards, but only a specific page of data
150
+
151
+ cards = Pokemon::Card.where(page: 5, pageSize: 100)
152
+
153
+ #### Find a set by code
154
+
155
+ set = Pokemon::Set.find('base1')
156
+
157
+ #### Filter sets via query parameters
158
+
159
+ sets = Pokemon::Set.where(q: 'legalities.standard:legal')
160
+
161
+ #### Get all Sets
162
+
163
+ sets = Pokemon::Set.all
164
+
165
+ #### Get all Types
166
+
167
+ types = Pokemon::Type.all
168
+
169
+ #### Get all Subtypes
170
+
171
+ subtypes = Pokemon::Subtype.all
172
+
173
+ #### Get all Supertypes
174
+
175
+ supertypes = Pokemon::Supertype.all
176
+
177
+ #### Get all Rarities
178
+
179
+ supertypes = Pokemon::Rarity.all
180
+
181
+ ## Contributing
182
+
183
+ 1. Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-ruby/fork )
184
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
185
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
186
+ 4. Push to the branch (`git push origin my-new-feature`)
187
+ 5. Create a new Pull Request