wow_community_api 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,6 +6,10 @@ module WowCommunityApi
6
6
  self.base_uri "#{name}.battle.net/api/wow"
7
7
  end
8
8
  base_uri region(Regions::US)
9
+
10
+ def self.get(path, options = {})
11
+ super(URI.encode(path), options)
12
+ end
9
13
 
10
14
  end
11
15
  end
File without changes
File without changes
File without changes
@@ -1,3 +1,3 @@
1
1
  module WowCommunityApi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,5 +1,6 @@
1
1
  require 'httparty'
2
2
  require 'ostruct'
3
+ require 'uri'
3
4
 
4
5
  require "wow_community_api/version"
5
6
  require "wow_community_api/regions"
@@ -7,5 +7,13 @@ describe Character do
7
7
  character = Character.find_by_realm_and_name("uther", "malkyth")
8
8
  character.name.should == "Malkyth"
9
9
  end
10
+
11
+ it 'gets a character from a realm with spaces by realm and name' do
12
+ stub_json "http://us.battle.net/api/wow/character/altar of storms/johndoe", 'character-doe.json'
13
+
14
+ character = Character.find_by_realm_and_name('altar of storms', 'johndoe')
15
+ character.realm.should == 'Altar of Storms'
16
+ character.name.should == 'Johndoe'
17
+ end
10
18
  end
11
19
  end
@@ -0,0 +1,11 @@
1
+ {
2
+ "lastModified": 1310338638000,
3
+ "name": "Johndoe",
4
+ "realm": "Altar of Storms",
5
+ "class": 9,
6
+ "race": 5,
7
+ "gender": 0,
8
+ "level": 85,
9
+ "achievementPoints": 10970,
10
+ "thumbnail": "uther/243/6004211-avatar.jpg"
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "lastModified":1310949770000,
3
+ "name":"Devilsaur May Cry",
4
+ "realm":"Altar of Storms",
5
+ "level":6,
6
+ "side":0,
7
+ "achievementPoints":250
8
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "realms":[
3
+ {
4
+ "type":"pvp",
5
+ "queue":false,
6
+ "status":true,
7
+ "population":"low",
8
+ "name":"Altar of Storms",
9
+ "slug":"altar-of-storms"
10
+ }
11
+ ]
12
+ }
data/spec/guild_spec.rb CHANGED
@@ -7,5 +7,13 @@ describe Guild do
7
7
  guild = Guild.find_by_realm_and_name("uther", "nova")
8
8
  guild.name.should == "Nova"
9
9
  end
10
+
11
+ it 'gets a guild with spaces by realm and name' do
12
+ stub_json 'http://us.battle.net/api/wow/guild/altar of storms/devilsaur may cry', 'guild-dmc.json'
13
+
14
+ guild = Guild.find_by_realm_and_name('altar of storms', 'devilsaur may cry')
15
+ guild.realm.should == 'Altar of Storms'
16
+ guild.name.should == 'Devilsaur May Cry'
17
+ end
10
18
  end
11
19
  end
data/spec/realm_spec.rb CHANGED
@@ -7,5 +7,12 @@ describe Realm do
7
7
  realm = Realm.find_by_name("medivh")
8
8
  realm.status.should be_true
9
9
  end
10
+
11
+ it 'gets the status of a realm with spaces by name' do
12
+ stub_json 'http://us.battle.net/api/wow/realm/status?realms=altar of storms', 'realms-aos.json'
13
+
14
+ realm = Realm.find_by_name("altar of storms")
15
+ realm.status.should be_true
16
+ end
10
17
  end
11
18
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: wow_community_api
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.2
5
+ version: 0.0.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - eddie cianci
@@ -71,8 +71,11 @@ files:
71
71
  - lib/wow_community_api/version.rb
72
72
  - spec/battle_net_spec.rb
73
73
  - spec/character_spec.rb
74
+ - spec/fixtures/character-doe.json
74
75
  - spec/fixtures/character.json
76
+ - spec/fixtures/guild-dmc.json
75
77
  - spec/fixtures/guild.json
78
+ - spec/fixtures/realms-aos.json
76
79
  - spec/fixtures/realms.json
77
80
  - spec/guild_spec.rb
78
81
  - spec/realm_spec.rb
@@ -109,8 +112,11 @@ summary: World of Warcraft Community Platform API
109
112
  test_files:
110
113
  - spec/battle_net_spec.rb
111
114
  - spec/character_spec.rb
115
+ - spec/fixtures/character-doe.json
112
116
  - spec/fixtures/character.json
117
+ - spec/fixtures/guild-dmc.json
113
118
  - spec/fixtures/guild.json
119
+ - spec/fixtures/realms-aos.json
114
120
  - spec/fixtures/realms.json
115
121
  - spec/guild_spec.rb
116
122
  - spec/realm_spec.rb