mywowarmory-ruby 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.5
1
+ 0.1.6
@@ -18,8 +18,11 @@ class MyWoWArmory
18
18
  name = URI::encode(character_name)
19
19
  # self.class.get("/api/profiles/#{country}/#{realm.tr('^a-zA-Z','-').downcase}/#{name}.json", options).parsed_response
20
20
 
21
- # realm = WowCommunityApi::Realm.find_by_name(realm).slug # Bug for WowCommunityApi...
22
- realm = WowCommunityApi::Realm.find_all.select{|r| r.name == realm}.first.slug
21
+ realm_response = HTTParty.get(URI.encode("http://#{country}.battle.net/api/wow/realm/status?realms=#{realm}")).parsed_response['realms']
22
+ if realm_response.count == 1
23
+ realm = realm_response.first['slug']
24
+ end
25
+
23
26
 
24
27
  options.merge!(:query => {:name => character_name, :server => realm, :country => country})
25
28
  MultiJson.decode(self.class.get("/api/getprofile.php", options).parsed_response)
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mywowarmory-ruby}
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Benjamin Wong"]
12
- s.date = %q{2011-09-19}
12
+ s.date = %q{2011-09-28}
13
13
  s.description = %q{This library uses HTTParty to provide simple, reliable access to the MyWoWArmory API. Good for building reporting scripts and simple apps. Note that this library does not support the complete MyWoWArmory API at this time. See Features/Issues below for details. }
14
14
  s.email = %q{tkwong@railsant.com}
15
15
  s.extra_rdoc_files = [
@@ -9,12 +9,12 @@ class TestMywowarmory < Test::Unit::TestCase
9
9
  api = MyWoWArmory.new
10
10
  # response = api.get_profile('us','kul-tiras','gary')
11
11
  # puts response.inspect
12
- # response = api.get_profile('us','Tichondrius','Slapshøt')
13
- # puts response.inspect
14
- # response = api.get_profile("us", "Mal'Ganis", 'gary')
15
- # puts response.inspect
16
- # response = api.get_profile("us", "Kel'Thuzad", 'Chaoticblade')
17
- # puts response.inspect
12
+ response = api.get_profile('us','Tichondrius','Slapshøt')
13
+ puts response.inspect
14
+ response = api.get_profile("us", "Mal'Ganis", 'gary')
15
+ puts response.inspect
16
+ response = api.get_profile("us", "Kel'Thuzad", 'Chaoticblade')
17
+ puts response.inspect
18
18
 
19
19
  response = api.get_profile "us","Lightning's Blade","Bools"
20
20
  puts response.inspect
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mywowarmory-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benjamin Wong
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-19 00:00:00 +08:00
18
+ date: 2011-09-28 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency