blizzard_api 0.2.9 → 0.3.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: e053e270f32f8b4b3f5ef31dd081652ac643c2108ec2505a8ccd4684b392b233
4
- data.tar.gz: 658b55408c9aff58ba82e9f425d737d577bcbb2eead1080fb8ccc654180be81e
3
+ metadata.gz: 1d9e981de12146c8fa8c57320363113050ff5415e7b6ae41422ec945f113b560
4
+ data.tar.gz: 8f262b1cc6376a60f1dc8705a49b6dd0dc2b6ce295e24b563a269ce55a24aaf4
5
5
  SHA512:
6
- metadata.gz: 7b003416b1ce96f0312a4c05002940bdac6a8ee5f82c638cde5627a6bff5a3a4ebc616c4a242f2beb0e4004e7a5c5314b94db360673b33dc3e0c35eb1530d3c4
7
- data.tar.gz: 67c2413bc2cbf9f3192aa7d8187e9b5ec67eb0699b2ca5f6f0ef6f92ce7589f6008eb4edc78d825c0bf0cdbae64fc8c58f450fd7f45914cdff7ae12b7ff29150
6
+ metadata.gz: 3eb0e63dea5d778a83264ac54b45acfa664e13ce695495e91238b98e169c8e18c9ab69f72cb12a2a25aad5c633c788a66ad8843e721a7a51fec63c013a144cbc
7
+ data.tar.gz: a952007d42101fedaea6f22cc1ed0e148bec4fc5f890803121e27c178c4563c13414760d8910e627476e2e30c650aa2eb257421ed555a71fa6704946f63f9c6e
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  Please view this file on the master branch, otherwise it may be outdated
2
2
 
3
+ **Version 0.3.0**
4
+
5
+ https://us.forums.blizzard.com/en/blizzard/t/starcraft-ii-community-api-update/2652
6
+
7
+ Removed all Starcraft II related code.
8
+
3
9
  **Version 0.2.9**
4
- * Added new character endpoints:
10
+
11
+ https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-api-update-collections-hunter-pets-and-reputations/757
12
+ * Added new character endpoints:
5
13
  * reputations
6
14
  * hunter-pets
7
15
  * collections
@@ -12,6 +20,8 @@ Please view this file on the master branch, otherwise it may be outdated
12
20
  * reputation-tiers
13
21
  * reputation-faction
14
22
 
23
+ * Marked all WoW community endpoints as deprecated: https://us.forums.blizzard.com/en/blizzard/t/world-of-warcraft-community-api-migration/767
24
+
15
25
  **Version 0.2.8**
16
26
  * Added the new character status endpoint
17
27
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blizzard_api (0.2.7)
4
+ blizzard_api (0.3.0)
5
5
  redis (~> 4.1, >= 4.1.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -15,8 +15,7 @@ This gem allow you to interface with the new blizzard api (2018) using the OAuth
15
15
  4. [Available endpoints](#4-available-endpoints)
16
16
  - 4.1. [World of Warcraft endpoints](#41-world-of-warcraft-endpoints)
17
17
  - 4.2. [Diablo III endpoints](#42-diablo-iii-endpoints)
18
- - 4.3. [Starcraft II endpoints](#43-starcraft-ii-endpoints)
19
- - 4.4. [Hearthstone endpoints](#44-hearthstone-endpoints)
18
+ - 4.3. [Hearthstone endpoints](#43-hearthstone-endpoints)
20
19
 
21
20
  ## 1. Installation
22
21
 
@@ -273,26 +272,8 @@ Most **data** endpoints will have always 3 methods available `index`, `get` and
273
272
  - hero :battletag, :oauth_token, :hero_id
274
273
  - hero_items :battletag, :oauth_token, :hero_id
275
274
  - hero_follower_items :battletag, :oauth_token, :hero_id
276
-
277
- ### 4.3. Starcraft II endpoints
278
-
279
- Every endpoint requiring a *region_id* parameter will accepts either the integer representation of the region described in the api docs or a symbol: `:US`, `:EU`, `:KO` or `:TW`
280
-
281
- * BlizzardApi::Starcraft::League
282
- - get :season_id, :queue_id, :team_type, :league_id
283
- * BlizzardApi::Starcraft::Profile
284
- - static :region_id
285
- - metadata :region_id, :realm_id, :profile_id
286
- - profile :region_id, :realm_id, :profile_id
287
- - ladder_summary :region_id, :realm_id, :profile_id
288
- - ladder :region_id, :realm_id, :profile_id, :ladder_id
289
- * BlizzardApi::Starcraft::Ladder
290
- - grandmaster :region_id, :options
291
- - season :region_id
292
- * BlizzardApi::Starcraft::Account
293
- - player :account_id
294
-
295
- ### 4.4. Hearthstone endpoints
275
+
276
+ ### 4.3. Hearthstone endpoints
296
277
 
297
278
  * BlizzardApi::Hearthstone::Card
298
279
  - index
data/lib/blizzard_api.rb CHANGED
@@ -6,7 +6,6 @@ require_relative 'blizzard_api/exception'
6
6
  require_relative 'blizzard_api/version'
7
7
  require_relative 'blizzard_api/wow'
8
8
  require_relative 'blizzard_api/diablo'
9
- require_relative 'blizzard_api/starcraft'
10
9
  require_relative 'blizzard_api/hearthstone'
11
10
 
12
11
  # Blizzard namespace
@@ -2,5 +2,5 @@
2
2
 
3
3
  module BlizzardApi
4
4
  # Gem version
5
- VERSION = '0.2.9'
5
+ VERSION = '0.3.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blizzard_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Schiavo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-02 00:00:00.000000000 Z
11
+ date: 2020-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis
@@ -83,7 +83,6 @@ files:
83
83
  - ".gitlab-ci.yml"
84
84
  - ".rubocop.yml"
85
85
  - ".rubocop_todo.yml"
86
- - ".travis.yml"
87
86
  - CHANGELOG.md
88
87
  - Gemfile
89
88
  - Gemfile.lock
@@ -115,12 +114,6 @@ files:
115
114
  - lib/blizzard_api/hearthstone/game_data/metadata.rb
116
115
  - lib/blizzard_api/hearthstone/request.rb
117
116
  - lib/blizzard_api/request.rb
118
- - lib/blizzard_api/starcraft.rb
119
- - lib/blizzard_api/starcraft/community/account.rb
120
- - lib/blizzard_api/starcraft/community/ladder.rb
121
- - lib/blizzard_api/starcraft/community/profile.rb
122
- - lib/blizzard_api/starcraft/game_data/league.rb
123
- - lib/blizzard_api/starcraft/request.rb
124
117
  - lib/blizzard_api/version.rb
125
118
  - lib/blizzard_api/wow.rb
126
119
  - lib/blizzard_api/wow/community/auction.rb
@@ -181,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
174
  - !ruby/object:Gem::Version
182
175
  version: '0'
183
176
  requirements: []
184
- rubygems_version: 3.0.2
177
+ rubygems_version: 3.0.6
185
178
  signing_key:
186
179
  specification_version: 4
187
180
  summary: Unofficial Ruby client for Blizzard Entertainment API
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.5.3
7
- before_install: gem install bundler -v 1.17.3
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlizzardApi
4
- # Starcraft II related classes
5
- module Starcraft
6
- require_relative 'starcraft/request'
7
-
8
- # Starcraft II data api
9
- require_relative 'starcraft/game_data/league'
10
-
11
- ##
12
- # @return {League}
13
- def league
14
- BlizzardApi::Starcraft::League.new
15
- end
16
-
17
- # Starcraft community api
18
- require_relative 'starcraft/community/profile'
19
- require_relative 'starcraft/community/ladder'
20
- require_relative 'starcraft/community/account'
21
-
22
- ##
23
- # @return {Profile}
24
- def profile
25
- BlizzardApi::Starcraft::Profile.new
26
- end
27
-
28
- ##
29
- # @return {Ladder}
30
- def ladder
31
- BlizzardApi::Starcraft::Ladder.new
32
- end
33
-
34
- ##
35
- # @return {Account}
36
- def account
37
- BlizzardApi::Starcraft::Account.new
38
- end
39
- end
40
- end
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlizzardApi
4
- module Starcraft
5
- ##
6
- # This class allows access to Starcraft II league data
7
- #
8
- # @see https://develop.battle.net/documentation/api-reference/starcraft-2-game-data-api
9
- #
10
- # You can get an instance of this class using the default region as follows:
11
- # api_instance = BlizzardApi::Starcraft.account
12
- class Account < Starcraft::Request
13
- ##
14
- # Returns information about a player account
15
- #
16
- # @param [Integer] account_id Account ID
17
- # @!macro request_options
18
- def player(account_id, options = {})
19
- api_request "#{base_url(:community)}/player/#{account_id}", { ttl: CACHE_DAY }.merge(options)
20
- end
21
- end
22
- end
23
- end
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlizzardApi
4
- module Starcraft
5
- ##
6
- # This class allows access to Starcraft II ladder data
7
- #
8
- # @see https://develop.battle.net/documentation/api-reference/starcraft-2-game-data-api
9
- #
10
- # You can get an instance of this class using the default region as follows:
11
- # api_instance = BlizzardApi::Starcraft.ladder
12
- class Ladder < Starcraft::Request
13
- ##
14
- # Grandmaster endpoint
15
- #
16
- # @!macro sc2_regions
17
- # @!macro request_options
18
- def grandmaster(region_id, options = {})
19
- reg = resolve_region(region_id)
20
- api_request "#{base_url(:community)}/ladder/grandmaster/#{reg}", { ttl: CACHE_DAY }.merge(options)
21
- end
22
-
23
- ##
24
- # Season endpoint
25
- #
26
- # @!macro sc2_regions
27
- # @!macro request_options
28
- def season(region_id, options = {})
29
- reg = resolve_region(region_id)
30
- api_request "#{base_url(:community)}/ladder/season/#{reg}", { ttl: CACHE_DAY }.merge(options)
31
- end
32
- end
33
- end
34
- end
@@ -1,76 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlizzardApi
4
- module Starcraft
5
- ##
6
- # This class allows access to Starcraft II profile data
7
- #
8
- # @see https://develop.battle.net/documentation/api-reference/starcraft-2-game-data-api
9
- #
10
- # You can get an instance of this class using the default region as follows:
11
- # api_instance = BlizzardApi::Starcraft.profile
12
- class Profile < Starcraft::Request
13
- ##
14
- # Static profile data
15
- #
16
- # @!macro sc2_regions
17
- # @!macro request_options
18
- def static(region_id, options = {})
19
- reg = resolve_region(region_id)
20
- api_request "#{base_url(:community)}/static/profile/#{reg}", { ttl: CACHE_DAY }.merge(options)
21
- end
22
-
23
- ##
24
- # Metadata
25
- #
26
- # @!macro sc2_regions
27
- # @param [Integer] realm_id Realm ID
28
- # @param [Integer] profile_id Profile ID
29
- # @!macro request_options
30
- def metadata(region_id, realm_id, profile_id, options = {})
31
- reg = resolve_region(region_id)
32
- opts = { ttl: CACHE_DAY }.merge(options)
33
- api_request "#{base_url(:community)}/metadata/profile/#{reg}/#{realm_id}/#{profile_id}", opts
34
- end
35
-
36
- ##
37
- # Profile data
38
- #
39
- # @!macro sc2_regions
40
- # @param [Integer] realm_id Realm ID
41
- # @param [Integer] profile_id Profile ID
42
- # @!macro request_options
43
- def profile(region_id, realm_id, profile_id, options = {})
44
- reg = resolve_region(region_id)
45
- opts = { ttl: CACHE_DAY }.merge(options)
46
- api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}", opts
47
- end
48
-
49
- ##
50
- # Ladder summary
51
- #
52
- # @!macro sc2_regions
53
- # @param [Integer] realm_id Realm ID
54
- # @param [Integer] profile_id Profile ID
55
- # @!macro request_options
56
- def ladder_summary(region_id, realm_id, profile_id, options = {})
57
- reg = resolve_region(region_id)
58
- opts = { ttl: CACHE_DAY }.merge(options)
59
- api_request "#{base_url(:community)}profile/#{reg}/#{realm_id}/#{profile_id}/ladder/summary ", opts
60
- end
61
-
62
- ##
63
- # Ladder data
64
- #
65
- # @!macro sc2_regions
66
- # @param [Integer] realm_id Realm ID
67
- # @param [Integer] profile_id Profile ID
68
- # @!macro request_options
69
- def ladder(region_id, realm_id, profile_id, ladder_id, options = {})
70
- reg = resolve_region(region_id)
71
- opts = { ttl: CACHE_DAY }.merge(options)
72
- api_request "#{base_url(:community)}/profile/#{reg}/#{realm_id}/#{profile_id}/ladder/#{ladder_id}", opts
73
- end
74
- end
75
- end
76
- end
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module BlizzardApi
4
- module Starcraft
5
- ##
6
- # This class allows access to Starcraft II league data
7
- #
8
- # @see https://develop.battle.net/documentation/api-reference/starcraft-2-game-data-api
9
- #
10
- # You can get an instance of this class using the default region as follows:
11
- # api_instance = BlizzardApi::Starcraft.league
12
- class League < Starcraft::Request
13
- ##
14
- # Return information about league
15
- #
16
- # @param [Integer] season_id Season id
17
- # @param [Integer] queue_id Queue id
18
- # @param [Integer] team_type Team type
19
- # @param [Integer] league_id League id
20
- # @!macro request_options
21
- def get(season_id, queue_id, team_type, league_id, options = {})
22
- opts = { ttl: CACHE_DAY }.merge(options)
23
- api_request "#{base_url(:game_data)}/league/#{season_id}/#{queue_id}/#{team_type}/#{league_id}", opts
24
- end
25
- end
26
- end
27
- end
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- # @!macro [new] sc2_regions
5
- # @param {Symbol} region_id One of the valid Starcraft II regions *:US*, *:EU*, *:KO*, and *:TW*
6
- # @note This gem do not support nor will support China endpoints
7
-
8
- module BlizzardApi
9
- module Starcraft
10
- ##
11
- # Starcraft requests
12
- class Request < BlizzardApi::Request
13
- # Possible regions for the SC II API (Except China)
14
- SC_REGION = { US: 1, EU: 2, KO: 3, TW: 3 }.freeze
15
-
16
- ##
17
- # @!macro regions
18
- def initialize(region = nil)
19
- super region
20
- @game = 'sc2'
21
- end
22
-
23
- private
24
-
25
- ##
26
- # Helper method to find a region_id by its symbol
27
- def resolve_region(region_arg)
28
- return region_arg if region_arg.is_a? Integer
29
-
30
- return SC_REGION[region_arg] if region_arg.is_a? Symbol
31
-
32
- raise ArgumentError, 'Invalid region, please read the documentation'
33
- end
34
- end
35
- end
36
- end