bnet_api 0.1.3 → 0.1.4

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmZiYWQ0YWIwOWI2MGFkZWZmOWQxZDBmZmM2MWZhNzBmYzMyYzFiNA==
4
+ NTVkN2Y3N2RhNjUzYTBmYjJkNzRjYzEyODc3Nzg0ZjYxZmQyZDE3Yg==
5
5
  data.tar.gz: !binary |-
6
- Njc2Y2UwOTcyNWI4N2MyN2I1NWFlNDI2YWE4ZDVkNGM5ZWJlMzljYg==
6
+ M2VmMDM2ZmNlMmExODE5MDdlNGFhYTczYzc5Zjg2MDEyNjg1NjdlMQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjVhOTJmYmU3ODgwZDc1NTY1MTUzMzQyNzRlNDhkYzEwMjQwMjZlYjhhYjBk
10
- NDNjYjRhNGU0YmQzMmY4NzE3MTJiOTFlZTkzYjQwNTU4Mzg1OGE4YmMyZDBl
11
- NTg3MWM5NDQwNDA4NjA0YjE3MjNhZDI2OGM0MGM4YjU0NjFlMDA=
9
+ MGYyMGYwZDRjYTkzZGVkNTE2ZmJmMTNjOGM1N2YxZTE0ZmRjN2ZiZmIyYzE1
10
+ ZGU5NWY2ZWNlZWI5ZDIzOTI4MDkxZTZhNDQ0ZTUxMjkwMmU1ZGY3MDk3NTNm
11
+ OWE5OGU4OTIxNmNlZWViNTE0YTFlOWQ5YzA1NTEzZDAwNTA3NDU=
12
12
  data.tar.gz: !binary |-
13
- N2ZmNTAyZmFhYmYxYzIwMGQ5NDNkNTRmZTEyMzBhM2YwZTBiYTA1ZWI2OTdh
14
- MGIzZTRhZjkxNWNmMjVlN2E4Y2QzNjk0YjU2ZWI2NzM3MzAyOWZjMDRlYmI4
15
- MzExNmFhZTcxMWI4MWZmNWRhYzYyZWUzZWZlNzY4MzhhMTZjMjY=
13
+ YTc2MDc1M2U0MzAxMDAwMDA4MTk3NmM5NjBkYzgyY2VmNjBkNTU3YTI4M2Rh
14
+ MDNiZDE1YjViODZhMWI4YzgwZjJlNzI2ZjIzOWUxMzYzOGE3OGU0YWNhMjVm
15
+ YTYxNzU0OWQwZGQzOGYzNjAyMGZmNTE4NWIwZjE3MmViMzIzNTU=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.3
2
+
3
+ * Added Diablo III APIs
4
+
1
5
  # 0.1.2
2
6
 
3
7
  * Added OAuth Account API
data/Gemfile CHANGED
@@ -4,6 +4,7 @@ gem 'rake'
4
4
 
5
5
  group :test do
6
6
  gem 'coveralls'
7
+ gem 'simplecov'
7
8
  gem 'rspec', '>= 2.14'
8
9
  end
9
10
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bnet_api (0.1.1)
4
+ bnet_api (0.1.3)
5
5
  httparty (= 0.13.3)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -6,57 +6,9 @@
6
6
  [![Coverage Status](https://coveralls.io/repos/tconnolly/BnetApi/badge.png?branch=master)](https://coveralls.io/r/tconnolly/BnetApi?branch=master
7
7
  )[![Inline docs](http://inch-ci.org/github/tconnolly/bnetapi.svg?branch=master)](http://inch-ci.org/github/tconnolly/bnetapi)
8
8
 
9
- A Ruby wrapper for the Battle.net API
9
+ A Ruby wrapper for the Battle.net API.
10
10
 
11
- ## Current Version: 0.1.3
12
-
13
- ### Status
14
-
15
- API | Status
16
- ------------------|-----------------
17
- World of Warcraft | Implemented
18
- Diablo III | Implemented
19
- Starcraft II | Not implemented
20
- OAuth | Implemented
21
-
22
- <!-- START doctoc generated TOC please keep comment here to allow auto update -->
23
- <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
24
- **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*
25
-
26
- - [BnetApi](#bnetapi)
27
- - [Current Version: 0.1.3](#current-version-013)
28
- - [Status](#status)
29
- - [Installation](#installation)
30
- - [Configuration](#configuration)
31
- - [Regions](#regions)
32
- - [Locales](#locales)
33
- - [Examples](#examples)
34
- - [Achievement API](#achievement-api)
35
- - [Auction Data API](#auction-data-api)
36
- - [Sample Request](#sample-request)
37
- - [Sample Response](#sample-response)
38
- - [Battlepet API](#battlepet-api)
39
- - [Battlepet Abilities](#battlepet-abilities)
40
- - [Battlepet Species](#battlepet-species)
41
- - [Battlepet Stats](#battlepet-stats)
42
- - [Challenge Mode API](#challenge-mode-api)
43
- - [Realm](#realm)
44
- - [Region](#region)
45
- - [Character Profile API](#character-profile-api)
46
- - [Guild API](#guild-api)
47
- - [Item API](#item-api)
48
- - [PvP API](#pvp-api)
49
- - [Quest API](#quest-api)
50
- - [Realm Status API](#realm-status-api)
51
- - [Recipe API](#recipe-api)
52
- - [Spell API](#spell-api)
53
- - [OAuth APIs](#oauth-apis)
54
- - [Account ID](#account-id)
55
- - [Battletag](#battletag)
56
- - [Starcraft II Profile](#starcraft-ii-profile)
57
- - [World of Warcraft Profile](#world-of-warcraft-profile)
58
-
59
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
11
+ ## Current Version: 0.1.4
60
12
 
61
13
  ## Installation
62
14
 
@@ -102,259 +54,6 @@ eu | en_GB, es_ES, fr_FR, ru_RU, de_DE, pl_PL, pt_PT, it_IT
102
54
  kr | ko_KR
103
55
  tw | zh_TW
104
56
 
57
+ ## Usage
105
58
 
106
- ## Examples
107
-
108
- Each API method returns a hash containing the values returned from the API.
109
-
110
- For more detailed documentation on returned data visit the official documentation (https://dev.battle.net).
111
-
112
- ### Achievement API
113
-
114
- To get the data for an achievement:
115
-
116
- ```ruby
117
- BnetApi::WoW.achievement(2144)
118
- ```
119
-
120
- ### Auction Data API
121
-
122
- The Auction Data API returns the URL of a JSON file containing an auction data dump generated at the time of the `lastModified` return value.
123
-
124
- #### Sample Request
125
-
126
- ```ruby
127
- BnetApi::WoW.auction_data('REALM')
128
- ```
129
-
130
- #### Sample Response
131
-
132
- ```json
133
- {
134
- "files": [
135
- {
136
- "url": "http://eu.battle.net/auction-data/7181c5e54bd6d781d46bdadec17e3637/auctions.json",
137
- "lastModified": 1418050857000
138
- }
139
- ]
140
- }
141
- ```
142
-
143
- ### Battlepet API
144
-
145
- #### Battlepet Abilities
146
-
147
- To get a battlepet ability from the API:
148
-
149
- ```ruby
150
- BnetApi::WoW.battlepet_ability(640)
151
- ```
152
-
153
- #### Battlepet Species
154
-
155
- To get a battlepet species from the API:
156
-
157
- ```ruby
158
- BnetApi::WoW.battlepet_species(258)
159
- ```
160
-
161
- #### Battlepet Stats
162
-
163
- To get the default stats for a battlepet:
164
-
165
- ```ruby
166
- BnetApi::WoW.battlepet_stats(258)
167
- ```
168
-
169
- The Battlepet Stats API also has three optional parameters:
170
-
171
- * level
172
- * breedId
173
- * qualityId
174
-
175
- Any or all of these can be passed in as named parameters after the species ID:
176
-
177
- ```ruby
178
- BnetApi::WoW.battlepet_stats(258, level: 25, breedId: 5, qualityId: 4)
179
- ```
180
-
181
- ### Challenge Mode API
182
-
183
- #### Realm
184
-
185
- To get the challenge mode leaderboard for a realm:
186
-
187
- ```ruby
188
- BnetApi::WoW.challenge_mode_realm('REALM')
189
- ```
190
-
191
- #### Region
192
-
193
- To get the challenge mode leaderboard for the region:
194
-
195
- ```ruby
196
- BnetApi::WoW.challenge_mode_region
197
- ```
198
-
199
- ### Character Profile API
200
-
201
- To get the basic data for a character:
202
-
203
- ```ruby
204
- BnetApi::WoW.character('REALM', 'CHARACTER_NAME')
205
- ```
206
-
207
- To get any additional data fields, pass them in as extra symbol values:
208
-
209
- ```ruby
210
- BnetApi::WoW.character('REALM', 'CHARACTER_NAME', :achievements, :quests)
211
- ```
212
-
213
- To get all additional data fields, pass in :all as the extra parameter:
214
-
215
- ```ruby
216
- BnetApi::WoW.character('REALM', 'CHARACTER_NAME', :all)
217
- ```
218
-
219
- Available optional fields:
220
-
221
- * achievements
222
- * appearance
223
- * feed
224
- * guild
225
- * items
226
- * mounts
227
- * pets
228
- * petSlots
229
- * progression
230
- * pvp
231
- * quests
232
- * reputation
233
- * stats
234
- * talents
235
- * titles
236
- * audit
237
-
238
- ### Guild API
239
-
240
- To get the basic data for a guild:
241
-
242
- ```ruby
243
- BnetApi::WoW.guild('REALM', 'GUILD_NAME')
244
- ```
245
-
246
- To get any additional data fields, pass them in as extra symbol values:
247
-
248
- ```ruby
249
- BnetApi::WoW.guild('REALM', 'GUILD_NAME', :news, :achievements)
250
- ```
251
-
252
- To get all additional data fields, pass in :all as the extra parameter:
253
-
254
- ```ruby
255
- BnetApi::WoW.guild('REALM', 'GUILD_NAME', :all)
256
- ```
257
-
258
- Available optional fields:
259
-
260
- * members
261
- * achievements
262
- * news
263
- * challenge
264
-
265
- ### Item API
266
-
267
- To get the data for an item:
268
-
269
- ```ruby
270
- BnetApi::WoW.item(18803)
271
- ```
272
-
273
- To get the data for an item set:
274
-
275
- ```ruby
276
- BnetApi::WoW.item_set(1060)
277
- ```
278
-
279
- ### PvP API
280
-
281
- To get the PvP leaderboard for a bracket:
282
-
283
- ```ruby
284
- BnetApi::WoW.pvp('2v2')
285
- ```
286
-
287
- Available brackets:
288
-
289
- * 2v2
290
- * 3v3
291
- * 5v5
292
- * rbg
293
-
294
- ### Quest API
295
-
296
- To get the data for a quest:
297
-
298
- ```ruby
299
- BnetApi::WoW.quest(13146)
300
- ```
301
-
302
- ### Realm Status API
303
-
304
- To get the status of all realms in the region:
305
-
306
- ```ruby
307
- BnetApi::WoW.realm_status
308
- ```
309
-
310
- ### Recipe API
311
-
312
- To get the data for a recipe:
313
-
314
- ```ruby
315
- BnetApi::WoW.recipe(33994)
316
- ```
317
-
318
- ### Spell API
319
-
320
- To get the data for a spell:
321
-
322
- ```ruby
323
- BnetApi::WoW.spell(8056)
324
- ```
325
-
326
- ### OAuth APIs
327
-
328
- This library isn't concerned with the OAuth authentication, just retrieving data from the API.
329
-
330
- You can use the [OmniAuth Bnet](https://github.com/Blizzard/omniauth-bnet) or any other OAuth library to authenticate against the Battle.net OAuth service, and then just pass the user's OAuth Access Token to the OAuth API methods.
331
-
332
- #### Account ID
333
-
334
- To get the user's account ID:
335
-
336
- ```ruby
337
- BnetApi::OAuth.account_id('ACCESS_TOKEN')
338
- ```
339
-
340
- #### Battletag
341
-
342
- To get the user's battletag:
343
-
344
- ```ruby
345
- BnetApi::OAuth.battletag('ACCESS_TOKEN')
346
- ```
347
-
348
- #### Starcraft II Profile
349
-
350
- To get the user's Starcraft II profile:
351
-
352
- ```ruby
353
- BnetApi::OAuth.sc2_profile('ACCESS_TOKEN')
354
- ```
355
-
356
- #### World of Warcraft Profile
357
-
358
- ```ruby
359
- BnetApi::OAuth.wow_profile('ACCESS_TOKEN')
360
- ```
59
+ Documentation can be found in the [wiki](https://github.com/tconnolly/BnetApi/wiki)
data/lib/bnet_api.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'bnet_api/d3'
2
2
  require 'bnet_api/oauth'
3
+ require 'bnet_api/sc2'
3
4
  require 'bnet_api/wow'
4
5
  require 'bnet_api/wow_data'
5
6
  require 'bnet_api/version'
@@ -0,0 +1,31 @@
1
+ require 'uri'
2
+
3
+ module BnetApi
4
+ module SC2
5
+ extend self
6
+
7
+ def profile(id, region, name)
8
+ BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/")
9
+ end
10
+
11
+ def profile_ladders(id, region, name)
12
+ BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/ladders")
13
+ end
14
+
15
+ def match_history(id, region, name)
16
+ BnetApi.make_request("/sc2/profile/#{id}/#{region}/#{name}/matches")
17
+ end
18
+
19
+ def ladder(id)
20
+ BnetApi.make_request("/sc2/ladder/#{id}")
21
+ end
22
+
23
+ def achievements_data
24
+ BnetApi.make_request('/sc2/data/achievements')
25
+ end
26
+
27
+ def rewards_data
28
+ BnetApi.make_request('/sc2/data/rewards')
29
+ end
30
+ end
31
+ end
@@ -1,3 +1,3 @@
1
1
  module BnetApi
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
data/lib/bnet_api/wow.rb CHANGED
@@ -72,7 +72,7 @@ module BnetApi
72
72
  end
73
73
 
74
74
  def realm_status(*realms)
75
- if realms != nil
75
+ if realms.count > 0
76
76
  BnetApi.make_request_with_params("/wow/realm/status", { realms: realms.join(',') })
77
77
  else
78
78
  BnetApi.make_request("/wow/realm/status")
@@ -4,15 +4,15 @@ describe BnetApi do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
12
12
  it "sets up the configuration" do
13
13
  expect(BnetApi.config.region).to eq(:eu)
14
14
  expect(BnetApi.config.locale).to eq(:en_GB)
15
- expect(BnetApi.config.api_key).to eq(ENV['BNET_ID'])
16
- expect(BnetApi.config.api_secret).to eq(ENV['BNET_SECRET'])
15
+ expect(BnetApi.config.api_key).to eq(ENV['BNET_API_KEY'])
16
+ expect(BnetApi.config.api_secret).to eq(ENV['BNET_API_SECRET'])
17
17
  end
18
18
  end
@@ -4,8 +4,8 @@ describe BnetApi::D3 do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::OAuth do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -0,0 +1,65 @@
1
+ require 'spec_helper'
2
+
3
+ describe BnetApi::SC2 do
4
+
5
+ before :each do
6
+ BnetApi.configure do |config|
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
+ end
10
+ end
11
+
12
+ it "gets a profile from the API" do
13
+ profile = BnetApi::SC2.profile(4587449, 1, 'Ragwolf')
14
+
15
+ expect(profile['id']).to eq 4587449
16
+ expect(profile['realm']).to eq 1
17
+ expect(profile['displayName']).to eq 'Ragwolf'
18
+ expect(profile['profilePath']).to eq '/profile/4587449/1/Ragwolf/'
19
+ expect(profile['portrait']).not_to be_nil
20
+ expect(profile['career']).not_to be_nil
21
+ expect(profile['swarmLevels']).not_to be_nil
22
+ expect(profile['campaign']).not_to be_nil
23
+ expect(profile['season']).not_to be_nil
24
+ expect(profile['rewards']).not_to be_nil
25
+ expect(profile['achievements']).not_to be_nil
26
+ end
27
+
28
+ it "gets a profile's ladders from the API" do
29
+ ladders = BnetApi::SC2.profile_ladders(4587449, 1, 'Ragwolf')
30
+
31
+ expect(ladders['currentSeason']).not_to be_nil
32
+ expect(ladders['previousSeason']).not_to be_nil
33
+ expect(ladders['showcasePlacement']).not_to be_nil
34
+ end
35
+
36
+ it "gets a profile's match history from the API" do
37
+ history = BnetApi::SC2.match_history(4587449, 1, 'Ragwolf')
38
+
39
+ expect(history['matches']).not_to be_nil
40
+ end
41
+
42
+ it "gets a ladder from the API" do
43
+ ladder = BnetApi::SC2.ladder('grandmaster')
44
+
45
+ expect(ladder['ladderMembers']).not_to be_nil
46
+ end
47
+
48
+ it "gets achievements data from the API" do
49
+ achievements = BnetApi::SC2.achievements_data
50
+
51
+ expect(achievements['achievements']).not_to be_nil
52
+ end
53
+
54
+ it "gets rewards data from the API" do
55
+ rewards = BnetApi::SC2.rewards_data
56
+
57
+ expect(rewards['portraits']).not_to be_nil
58
+ expect(rewards['terranDecals']).not_to be_nil
59
+ expect(rewards['zergDecals']).not_to be_nil
60
+ expect(rewards['protossDecals']).not_to be_nil
61
+ expect(rewards['skins']).not_to be_nil
62
+ expect(rewards['animations']).not_to be_nil
63
+ end
64
+
65
+ end
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -6,8 +6,8 @@ describe BnetApi::WoW do
6
6
 
7
7
  before :each do
8
8
  BnetApi.configure do |config|
9
- config.api_key = ENV['BNET_ID']
10
- config.api_secret = ENV['BNET_SECRET']
9
+ config.api_key = ENV['BNET_API_KEY']
10
+ config.api_secret = ENV['BNET_API_SECRET']
11
11
  end
12
12
  end
13
13
 
@@ -98,7 +98,7 @@ describe BnetApi::WoW do
98
98
  expect(character['quests']).not_to be_nil
99
99
  end
100
100
 
101
- it "gets a character from the API with itemsreputation" do
101
+ it "gets a character from the API with reputation data" do
102
102
  character = BnetApi::WoW.character('Thunderhorn', 'Ragwolf', :reputation)
103
103
 
104
104
  expect(character['reputation']).not_to be_nil
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
@@ -4,8 +4,8 @@ describe BnetApi::WoW do
4
4
 
5
5
  before :each do
6
6
  BnetApi.configure do |config|
7
- config.api_key = ENV['BNET_ID']
8
- config.api_secret = ENV['BNET_SECRET']
7
+ config.api_key = ENV['BNET_API_KEY']
8
+ config.api_secret = ENV['BNET_API_SECRET']
9
9
  end
10
10
  end
11
11
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,14 @@
1
- require 'rspec'
2
- require 'bnet_api'
1
+ require 'simplecov'
3
2
  require 'coveralls'
4
3
 
5
- Coveralls.wear!
4
+ SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, Coveralls::SimpleCov::Formatter]
5
+
6
+ SimpleCov.start do
7
+ add_filter '/spec/'
8
+ minimum_coverage(99.61)
9
+ end
10
+
11
+ Coveralls.wear!
12
+
13
+ require 'rspec'
14
+ require 'bnet_api'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bnet_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Connolly
@@ -72,12 +72,14 @@ files:
72
72
  - lib/bnet_api.rb
73
73
  - lib/bnet_api/d3.rb
74
74
  - lib/bnet_api/oauth.rb
75
+ - lib/bnet_api/sc2.rb
75
76
  - lib/bnet_api/version.rb
76
77
  - lib/bnet_api/wow.rb
77
78
  - lib/bnet_api/wow_data.rb
78
79
  - spec/bnet_api/bnet_api_spec.rb
79
80
  - spec/bnet_api/d3_spec.rb
80
81
  - spec/bnet_api/oauth_spec.rb
82
+ - spec/bnet_api/sc2_spec.rb
81
83
  - spec/bnet_api/wow/wow_achievement_spec.rb
82
84
  - spec/bnet_api/wow/wow_auction_data_spec.rb
83
85
  - spec/bnet_api/wow/wow_battlepet_spec.rb
@@ -120,6 +122,7 @@ test_files:
120
122
  - spec/bnet_api/bnet_api_spec.rb
121
123
  - spec/bnet_api/d3_spec.rb
122
124
  - spec/bnet_api/oauth_spec.rb
125
+ - spec/bnet_api/sc2_spec.rb
123
126
  - spec/bnet_api/wow/wow_achievement_spec.rb
124
127
  - spec/bnet_api/wow/wow_auction_data_spec.rb
125
128
  - spec/bnet_api/wow/wow_battlepet_spec.rb