pokemon_tcg_sdk 3.0.0 → 4.2.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.
Files changed (39) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +3 -0
  3. data/.github/workflows/test.yml +35 -0
  4. data/.gitignore +23 -24
  5. data/CODE_OF_CONDUCT.md +48 -48
  6. data/Gemfile +4 -4
  7. data/LICENSE.txt +21 -21
  8. data/README.md +184 -159
  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 +46 -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 -33
  31. metadata +34 -48
  32. data/.travis.yml +0 -15
  33. data/lib/pokemon_tcg_sdk/representers/ability_representer.rb +0 -11
  34. data/lib/pokemon_tcg_sdk/representers/ancient_trait_representer.rb +0 -10
  35. data/lib/pokemon_tcg_sdk/representers/attack_representer.rb +0 -13
  36. data/lib/pokemon_tcg_sdk/representers/card_representer.rb +0 -41
  37. data/lib/pokemon_tcg_sdk/representers/set_representer.rb +0 -19
  38. data/lib/pokemon_tcg_sdk/representers/type_value_representer.rb +0 -10
  39. data/lib/pokemon_tcg_sdk/type_value.rb +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7adbc58810fc030db16f7d4dd39b5e7b3b92436a
4
- data.tar.gz: 13f38896f518634a223ca1b24fb4bad02a5ae8b8
2
+ SHA256:
3
+ metadata.gz: 60b6d4cc3d9b6e2d724cd20cf3a071b97ebf29d798eec571ca5cf15f56d371f3
4
+ data.tar.gz: 8a193dc2a53be17d717989df61be54d2fd01afb2ae293782192062b2fa6127e0
5
5
  SHA512:
6
- metadata.gz: 67e70378fbc2f402d255c666d3ab24df6a8e06145e057b31582f9c5f8cd376768fdc071e249e28a38a4d6c2907dc440315f7f9ada3acc8c500d9629bf11004af
7
- data.tar.gz: c62805025b350dfcf4ad80c92e76ea5456fdafd9ebdbe51695bd6938a9546ebb714d9e6dd411bd847fbf0c3ba2ef2bb24776cd3fa7d6801834668f058250bc16
6
+ metadata.gz: bfd9c8d0ee496a21a65322dcd8c497b5eaa850f0f70fd686ad89027cc859bb2a70ebc7215a6b64609079a5d72cb026e9b6baffa7c74de130ca1ec98f54539998
7
+ data.tar.gz: c4efab91945f943c3a83be792bf08c36ce7a234e3567e9340d451c803720646a17059c46503de45cd25ea5f7b5f08319f2a10da7404ca1187b135e205680feb3
data/.editorconfig ADDED
@@ -0,0 +1,3 @@
1
+ [*.rb]
2
+ indent_size = 2
3
+ indent_style = space
@@ -0,0 +1,35 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Test
9
+
10
+ on:
11
+ push:
12
+ branches: [ master ]
13
+ pull_request:
14
+ branches: [ master ]
15
+
16
+ jobs:
17
+ test:
18
+
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: ['2.6', '2.7', '3.0']
23
+
24
+ steps:
25
+ - uses: actions/checkout@v2
26
+ - name: Set up Ruby
27
+ # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
28
+ # change this to (see https://github.com/ruby/setup-ruby#versioning):
29
+ # uses: ruby/setup-ruby@v1
30
+ uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
31
+ with:
32
+ ruby-version: ${{ matrix.ruby-version }}
33
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34
+ - name: Run tests
35
+ run: bundle exec rake test
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/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,159 +1,184 @@
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
- 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
- converted_retreat_cost
67
- text
68
- types
69
- attacks
70
- weaknesses
71
- resistances
72
- evolves_from
73
-
74
- #### Set
75
-
76
- code
77
- name
78
- series
79
- total_cards
80
- symbol_url
81
- logo_url
82
- standard_legal
83
- expanded_legal
84
- release_date
85
- updated_at
86
-
87
- #### Ability
88
-
89
- name
90
- text
91
- type
92
-
93
- #### AncientTrait
94
-
95
- name
96
- text
97
-
98
- #### Attack
99
-
100
- cost
101
- name
102
- text
103
- damage
104
- converted_energy_cost
105
-
106
- #### TypeValue
107
-
108
- type
109
- value
110
-
111
- ### Functions Available
112
-
113
- #### Find a card by id
114
-
115
- card = Pokemon::Card.find('xy1-1')
116
-
117
- #### Filter Cards via query parameters
118
-
119
- cards = Pokemon::Card.where(set: 'generations', supertype: 'pokemon')
120
-
121
- #### Find all cards (will take awhile)
122
-
123
- cards = Pokemon::Card.all
124
-
125
- #### Get all cards, but only a specific page of data
126
-
127
- cards = Pokemon::Card.where(page: 5, pageSize: 100)
128
-
129
- #### Find a set by code
130
-
131
- set = Pokemon::Set.find('base1')
132
-
133
- #### Filter sets via query parameters
134
-
135
- sets = Pokemon::Set.where(standardLegal: true)
136
-
137
- #### Get all Sets
138
-
139
- sets = Pokemon::Set.all
140
-
141
- #### Get all Types
142
-
143
- types = Pokemon::Type.all
144
-
145
- #### Get all Subtypes
146
-
147
- subtypes = Pokemon::Subtype.all
148
-
149
- #### Get all Supertypes
150
-
151
- supertypes = Pokemon::Supertype.all
152
-
153
- ## Contributing
154
-
155
- 1. Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-ruby/fork )
156
- 2. Create your feature branch (`git checkout -b my-new-feature`)
157
- 3. Commit your changes (`git commit -am 'Add some feature'`)
158
- 4. Push to the branch (`git push origin my-new-feature`)
159
- 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://github.com/PokemonTCG/pokemon-tcg-sdk-ruby/actions/workflows/test.yml/badge.svg)
5
+
6
+ ### Now supporting Version 2 of the Pokémon TCG API!
7
+
8
+ 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/).
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'pokemon_tcg_sdk'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install pokemon_tcg_sdk
23
+
24
+ ## Usage
25
+
26
+ To configure your API Key:
27
+
28
+ Pokemon.configure do |config|
29
+ config.api_key = "xxxxxxxxx"
30
+ end
31
+
32
+ ### Classes
33
+
34
+ Card
35
+ Set
36
+ Type
37
+ Supertype
38
+ Subtype
39
+ Ability
40
+ AncientTrait
41
+ Attack
42
+ Resistance
43
+ Weakness
44
+ Legalities
45
+ Rarity
46
+ SetImages
47
+ CardImages
48
+ Tcgplayer
49
+
50
+ ### Properties Per Class
51
+
52
+ #### Card
53
+
54
+ id
55
+ name
56
+ supertype
57
+ subtypes
58
+ level
59
+ hp
60
+ types
61
+ evolves_from
62
+ evolves_to
63
+ rules
64
+ ancient_trait
65
+ abilities
66
+ weaknesses
67
+ resistances
68
+ retreat_cost
69
+ converted_retreat_cost
70
+ set
71
+ number
72
+ artist
73
+ rarity
74
+ national_pokedex_numbers
75
+ legalities
76
+ tcgplayer
77
+ images
78
+ flavor_text
79
+
80
+ #### Set
81
+
82
+ id
83
+ name
84
+ series
85
+ printedTotal
86
+ total
87
+ legalities
88
+ ptcgo_code
89
+ release_date
90
+ updated_at
91
+ images
92
+
93
+ #### Ability
94
+
95
+ name
96
+ text
97
+ type
98
+
99
+ #### AncientTrait
100
+
101
+ name
102
+ text
103
+
104
+ #### Attack
105
+
106
+ cost
107
+ name
108
+ text
109
+ damage
110
+ converted_energy_cost
111
+
112
+ #### Weakness
113
+
114
+ type
115
+ value
116
+
117
+ #### Resistance
118
+
119
+ type
120
+ value
121
+
122
+ #### CardImages
123
+
124
+ small
125
+ large
126
+
127
+ #### SetImages
128
+
129
+ logo
130
+ symbol
131
+
132
+ ### Functions Available
133
+
134
+ #### Find a card by id
135
+
136
+ card = Pokemon::Card.find('xy1-1')
137
+
138
+ #### Filter Cards via query parameters
139
+
140
+ cards = Pokemon::Card.where(q: 'set.name:generations subtypes:mega')
141
+
142
+ #### Find all cards (will take awhile)
143
+
144
+ cards = Pokemon::Card.all
145
+
146
+ #### Get all cards, but only a specific page of data
147
+
148
+ cards = Pokemon::Card.where(page: 5, pageSize: 100)
149
+
150
+ #### Find a set by code
151
+
152
+ set = Pokemon::Set.find('base1')
153
+
154
+ #### Filter sets via query parameters
155
+
156
+ sets = Pokemon::Set.where(q: 'legalities.standard:legal')
157
+
158
+ #### Get all Sets
159
+
160
+ sets = Pokemon::Set.all
161
+
162
+ #### Get all Types
163
+
164
+ types = Pokemon::Type.all
165
+
166
+ #### Get all Subtypes
167
+
168
+ subtypes = Pokemon::Subtype.all
169
+
170
+ #### Get all Supertypes
171
+
172
+ supertypes = Pokemon::Supertype.all
173
+
174
+ #### Get all Rarities
175
+
176
+ supertypes = Pokemon::Rarity.all
177
+
178
+ ## Contributing
179
+
180
+ 1. Fork it ( https://github.com/[my-github-username]/pokemon-tcg-sdk-ruby/fork )
181
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
182
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
183
+ 4. Push to the branch (`git push origin my-new-feature`)
184
+ 5. Create a new Pull Request