armory-ruby 0.0.8 → 0.0.10

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
  SHA1:
3
- metadata.gz: 7204ec6db8add78ce6389ed64724d49a1d3aee71
4
- data.tar.gz: 57cad40318067e2404d1256a1a2a46c36bbf379a
3
+ metadata.gz: a940e83fdd137ba6559850313970bb6e796dd4f3
4
+ data.tar.gz: da81c9e308fdba9661162e45c76558a9300f1e55
5
5
  SHA512:
6
- metadata.gz: 2eef8e528d55a71c486a8de839abd30b962ad09bda7916f7b1491aaf4f8f162762353cb207f1c3b50291eb9f3ada668bec96c5763944804503cc86a92a37a4a1
7
- data.tar.gz: 9bb08af626718bb0733123b4b7a70b676c9eb2ead142888f1cfd60815867cb2ce342af026417e7012f30e4aef7d2bd84227a1e0ff0ac8740aec7956433b3c89b
6
+ metadata.gz: 8415ef5fd56d74c977fb9c026ee3c04b17a6018424327b61ec14101be333c5aa57b8a51a2715a1a1611e51587a82a54f6b60192252e91213ac2a52bcabf004c5
7
+ data.tar.gz: 135a236c68dded4f6967d63ea9bddbcf5fccfb3aed6065d7bb4ed43876b9b6227a4daee400f024dcffc56c44a95a7d51d0896e1bf214c9fafa6802b4956cb43a
Binary file
@@ -1,34 +1,45 @@
1
- require 'json'
1
+ require "json"
2
2
 
3
3
  module Armory
4
4
 
5
5
  #default parameters
6
- @locale = 'us'
6
+ @locale = "us"
7
7
 
8
8
  def self.character(name, realm, locale = @locale)
9
- #set default locale to what is passed into the method
10
- @local = locale
11
- host = locale + '.battle.net'
12
- # URL = Host + "/api/wow/character/" + Realm + "/" + CharacterName
13
- fullurl = 'http://' + host + '/api/wow/character/' + realm + '/' + name
14
- uri = URI(URI.encode(fullurl))
15
- response = Net::HTTP.get_response(uri)
16
- # Return ruby object parsed from json
17
- json = JSON.parse(response.body)
18
- return json
9
+ #set default locale to what is passed into the method
10
+ #host = locale + ".battle.net"
11
+ host = "127.0.0.1:9081"
12
+ # URL = Host + "/api/wow/character/" + Realm + "/" + CharacterName
13
+ fullurl = "http://" + host + "/api/character/" + name
14
+ uri = URI(URI.encode(fullurl))
15
+ response = Net::HTTP.get_response(uri)
16
+ # Return ruby object parsed from json
17
+ json = JSON.parse(response.body)
18
+ return json
19
19
  end
20
20
 
21
21
  def self.guild(name, realm, locale = @locale)
22
- @locale = locale
23
- host = locale + '.battle.net'
24
- # Host + "/api/wow/guild/" + Realm + "/" + GuildName
25
- fullurl = 'http://' + host + '/api/wow/guild/' + realm + '/' + name
26
- uri = URI(URI.encode(fullurl))
27
- response = Net::HTTP.get_response(uri)
22
+ #host = locale + ".battle.net"
23
+ host = "127.0.0.1:9081"
24
+ # Host + "/api/wow/guild/" + Realm + "/" + GuildName
25
+ fullurl = "http://" + host + "/api/guilds/" + name
26
+ uri = URI(URI.encode(fullurl))
27
+ response = Net::HTTP.get_response(uri)
28
28
 
29
- json = JSON.parse(response.body)
30
- return json
29
+ json = JSON.parse(response.body)
30
+ return json
31
+ end
32
+
33
+ def self.guildMembers(name, realm, locale = @locale)
34
+ #host = locale + ".battle.net"
35
+ host = "127.0.0.1:9081"
36
+ # Host + "/api/wow/guild/" + Realm + "/" + GuildName ?fields=members
37
+ fullurl = "http://" + host + "/api/guilds/members/" + name + ""
38
+ uri = URI(URI.encode(fullurl))
39
+ response = Net::HTTP.get_response(uri)
31
40
 
41
+ json = JSON.parse(response.body)
42
+ return json
32
43
  end
33
44
 
34
45
  end
@@ -1,3 +1,3 @@
1
1
  module Armory
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -23,5 +23,9 @@ describe 'Character API' do
23
23
  response = Armory.guild('SUPERBOOMKINFUNTIME', 'burning-legion')
24
24
  expect(response['reason']).to eq('Guild not found.')
25
25
  end
26
+ it 'gets all of the characters from a guild' do
27
+ response = Armory.guildMembers('HC', 'burning-legion')
28
+ expect(response['members']).to be
29
+ end
26
30
  end
27
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: armory-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - William Volin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-12 00:00:00.000000000 Z
11
+ date: 2014-12-14 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A World of Warcraft Armory API Adapter for Ruby
14
14
  email:
@@ -26,6 +26,7 @@ files:
26
26
  - README.rdoc
27
27
  - Rakefile
28
28
  - armory-ruby-0.0.2.gem
29
+ - armory-ruby-0.0.8.gem
29
30
  - armory.gemspec
30
31
  - lib/armory.rb
31
32
  - lib/armory/version.rb