pokemon_tcg_sdk 4.1.1 → 4.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f12cf7ba81e0c3b566bb948861955378c57ab658a689f1257d70b33d706d2609
4
- data.tar.gz: c504e366a60269890dbd19af6452260d5f8172d92a6334364c89bffe54fb9fd6
3
+ metadata.gz: 4045cfb16dc32873cac32c81fa1d5ee10be5d53a7fbe71a186861c6a7a583d68
4
+ data.tar.gz: 63868f383de5dd6cb501bcd18d894b444145679177753ab2954d40e2ef78b44f
5
5
  SHA512:
6
- metadata.gz: ec896b1aef63d500243c5d9ef05286cb15b5f46d6a509f47bb4c329871e2f7ae73506f90bc26776d7eeadbee5ee14cc51be8582ab507196b88a7409244936977
7
- data.tar.gz: e66271ffcc62ffbcfdd16a7a306f7235f12eb4dc6cbb8e77e781ab36e23f2ae934bea598948d7fe9b82db2cebcb32495eb6d4033d7fff8be74f8bf9bb63b3a9e
6
+ metadata.gz: 3c0f85a3102d88cc649562e3c0469a696f98fc94241a1d09a8af6ad89bc7af678eb1b6a2b69c11c9de07d8c53bd2889434f2f4f08bb233095ba8c5b3c3056b7b
7
+ data.tar.gz: 0fc2c81f7310c8093ee3d38c211cc22549b63cae492484928d3f1e6ae5f3729dfb842ab7dbf8d120142dfbe5be118fd9155a869bedd643ca900385b7c0733f98
@@ -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/README.md CHANGED
@@ -1,10 +1,7 @@
1
1
  # Pokémon TCG SDK
2
2
 
3
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)
4
+ ![Build Status](https://github.com/PokemonTCG/pokemon-tcg-sdk-ruby/actions/workflows/test.yml/badge.svg)
8
5
 
9
6
  ### Now supporting Version 2 of the Pokémon TCG API!
10
7
 
@@ -76,7 +73,9 @@ To configure your API Key:
76
73
  rarity
77
74
  national_pokedex_numbers
78
75
  legalities
76
+ regulation_mark
79
77
  tcgplayer
78
+ cardmarket
80
79
  images
81
80
  flavor_text
82
81
 
@@ -4,7 +4,7 @@ module Pokemon
4
4
  class Card
5
5
  attr_accessor :id, :name, :supertype, :subtypes, :level, :hp, :types, :evolves_from, :evolves_to, :rules, :ancient_trait,
6
6
  :abilities, :attacks, :weaknesses, :resistances, :retreat_cost, :converted_retreat_cost, :set, :number, :artist, :rarity, :national_pokedex_numbers,
7
- :legalities, :tcgplayer, :images, :flavor_text
7
+ :legalities, :regulation_mark, :tcgplayer, :images, :flavor_text, :cardmarket
8
8
 
9
9
  def self.from_json(json)
10
10
  card = Card.new
@@ -32,7 +32,9 @@ module Pokemon
32
32
  card.flavor_text = json['flavorText']
33
33
  card.national_pokedex_numbers = json['nationalPokedexNumbers']
34
34
  card.legalities = Legalities.from_json(json['legalities']) if !json['legalities'].nil?
35
+ card.regulation_mark = json['regulationMark']
35
36
  card.tcgplayer = Tcgplayer.from_json(json['tcgplayer']) if !json['tcgplayer'].nil?
37
+ card.cardmarket = Cardmarket.from_json(json['cardmarket']) if !json['cardmarket'].nil?
36
38
  card.images = CardImages.from_json(json['images']) if !json['images'].nil?
37
39
  card
38
40
  end
@@ -0,0 +1,41 @@
1
+ module Pokemon
2
+ class Cardmarket
3
+ attr_accessor :url, :prices, :updated_at
4
+
5
+ def self.from_json(json)
6
+ cardmarket = Cardmarket.new
7
+ cardmarket.url = json['url']
8
+ cardmarket.updated_at = json['updatedAt']
9
+ cardmarket.prices = CardmarketPrices.from_json(json['prices']) if !json['prices'].nil?
10
+
11
+ cardmarket
12
+ end
13
+ end
14
+
15
+ class CardmarketPrices
16
+ attr_accessor :average_sell_price, :low_price, :trend_price, :german_pro_low, :suggested_price,
17
+ :reverse_holo_sell, :reverse_holo_low, :reverse_holo_trend, :low_price_ex_plus, :avg1, :avg7, :avg30,
18
+ :reverse_holo_avg1, :reverse_holo_avg7, :reverse_holo_avg30
19
+
20
+ def self.from_json(json)
21
+ price = CardmarketPrices.new
22
+ price.average_sell_price = json['averageSellPrice']
23
+ price.low_price = json['lowPrice']
24
+ price.trend_price = json['trendPrice']
25
+ price.german_pro_low = json['germanProLow']
26
+ price.suggested_price = json['suggestedPrice']
27
+ price.reverse_holo_sell = json['reverseHoloSell']
28
+ price.reverse_holo_low = json['reverseHoloLow']
29
+ price.reverse_holo_trend = json['reverseHoloTrend']
30
+ price.low_price_ex_plus = json['lowPriceExPlus']
31
+ price.avg1 = json['avg1']
32
+ price.avg7 = json['avg7']
33
+ price.avg30 = json['avg30']
34
+ price.reverse_holo_avg1 = json['reverseHoloAvg1']
35
+ price.reverse_holo_avg7 = json['reverseHoloAvg7']
36
+ price.reverse_holo_avg30 = json['reverseHoloAvg30']
37
+
38
+ price
39
+ end
40
+ end
41
+ end
@@ -51,7 +51,7 @@ module Pokemon
51
51
  if !fetch_all
52
52
  break
53
53
  else
54
- where(page: page += 1)
54
+ @query.merge!(page: page += 1)
55
55
  end
56
56
  else
57
57
  break
@@ -31,9 +31,12 @@ module Pokemon
31
31
  protected
32
32
 
33
33
  def self.client
34
+ headers = {'Content-Type' => 'application/json'}
35
+ headers['X-Api-Key'] = Pokemon.configuration.api_key unless Pokemon.configuration.api_key.nil?
36
+
34
37
  @client = Faraday.new(
35
38
  url: "#{API_URL}/v2",
36
- headers: {'Content-Type' => 'application/json', 'X-Api-Key' => Pokemon.configuration.api_key}
39
+ headers: headers
37
40
  )
38
41
  end
39
42
 
@@ -1,3 +1,3 @@
1
1
  module Pokemon
2
- VERSION = "4.1.1"
2
+ VERSION = "4.4.0"
3
3
  end
@@ -15,11 +15,12 @@ require "pokemon_tcg_sdk/legalities"
15
15
  require "pokemon_tcg_sdk/card_images"
16
16
  require "pokemon_tcg_sdk/set_images"
17
17
  require "pokemon_tcg_sdk/tcgplayer"
18
+ require "pokemon_tcg_sdk/cardmarket"
18
19
  require "pokemon_tcg_sdk/ancient_trait"
19
20
  require "pokemon_tcg_sdk/rarity"
20
21
 
21
22
  module Pokemon
22
- API_URL = 'https://beta.pokemontcg.io'
23
+ API_URL = 'https://api.pokemontcg.io'
23
24
 
24
25
  class << self
25
26
  attr_writer :configuration
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_development_dependency "bundler", "~> 2.1.4"
20
+ spec.add_development_dependency "bundler", "~> 2.2.11"
21
21
  spec.add_development_dependency "rake", "~> 13.0"
22
22
  spec.add_development_dependency "minitest", "~> 5.14.2"
23
23
  spec.add_development_dependency "vcr", "~> 6.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pokemon_tcg_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Backes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-02-04 00:00:00.000000000 Z
11
+ date: 2021-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.4
19
+ version: 2.2.11
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.4
26
+ version: 2.2.11
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -172,8 +172,8 @@ extensions: []
172
172
  extra_rdoc_files: []
173
173
  files:
174
174
  - ".editorconfig"
175
+ - ".github/workflows/test.yml"
175
176
  - ".gitignore"
176
- - ".travis.yml"
177
177
  - CODE_OF_CONDUCT.md
178
178
  - Gemfile
179
179
  - LICENSE.txt
@@ -185,6 +185,7 @@ files:
185
185
  - lib/pokemon_tcg_sdk/attack.rb
186
186
  - lib/pokemon_tcg_sdk/card.rb
187
187
  - lib/pokemon_tcg_sdk/card_images.rb
188
+ - lib/pokemon_tcg_sdk/cardmarket.rb
188
189
  - lib/pokemon_tcg_sdk/configuration.rb
189
190
  - lib/pokemon_tcg_sdk/legalities.rb
190
191
  - lib/pokemon_tcg_sdk/query_builder.rb
@@ -219,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
220
  - !ruby/object:Gem::Version
220
221
  version: '0'
221
222
  requirements: []
222
- rubygems_version: 3.1.4
223
+ rubygems_version: 3.2.22
223
224
  signing_key:
224
225
  specification_version: 4
225
226
  summary: Pokémon TCG SDK for pokemontcg.io
data/.travis.yml DELETED
@@ -1,15 +0,0 @@
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