mywowarmory-ruby 0.1.6 → 0.1.7

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
data/lib/mywowarmory.rb CHANGED
@@ -18,10 +18,9 @@ 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_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
21
+ # Check the realm
22
+ realm_response = HTTParty.get("http://#{country}.battle.net/api/wow/realm/status", :query => {:realms => URI.encode(realm)} ).parsed_response
23
+ realm = realm_response['realms'].select{|r| r['name'] == realm}.first['slug']
25
24
 
26
25
 
27
26
  options.merge!(:query => {:name => character_name, :server => realm, :country => country})
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mywowarmory-ruby}
8
- s.version = "0.1.6"
8
+ s.version = "0.1.7"
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"]
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: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benjamin Wong