glaze-analyzer 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +3 -0
- data/glaze-analyzer.gemspec +24 -0
- data/lib/glaze/analyzer.rb +76 -0
- data/lib/glaze/analyzer/characterdata.rb +112 -0
- data/lib/glaze/analyzer/glyphs.rb +428 -0
- data/lib/glaze/analyzer/version.rb +5 -0
- data/spec/analyzer_spec.rb +43 -0
- data/spec/characterdata_spec.rb +12 -0
- data/spec/glyphs_spec.rb +14 -0
- data/spec/spec_helper.rb +12 -0
- data/tasks/rspec.rake +3 -0
- metadata +105 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 670241c9a702128cbc6ece2d23bb1ccaa3406f2a
|
4
|
+
data.tar.gz: dd86be18e358e524274109ce18883a50cd165f0b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2a343eb0abbf53b1196c8e74daf04e5bc30c0500983794665852f49f96df993a53c1398d34be411dc2072510efb2737c054f80ff6ccefa76b49834be8dd4e77f
|
7
|
+
data.tar.gz: 78b99e2bc8dd682706717b7c2a7965234966f23e97330c39e5cd7067743a750f498bc46cb158a2dc678609f07cd0d919b8d5fa94db3a6a7a954a8b5bf5aaf9b3
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Marcus Orochena
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Glaze::Analyzer
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'glaze-analyzer'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install glaze-analyzer
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Contributing
|
26
|
+
|
27
|
+
1. Fork it ( https://github.com/[my-github-username]/glaze-analyzer/fork )
|
28
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'glaze/analyzer/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "glaze-analyzer"
|
8
|
+
spec.version = Glaze::Analyzer::VERSION
|
9
|
+
spec.authors = ["Marcus Orochena"]
|
10
|
+
spec.email = ["marcus@orochena.net"]
|
11
|
+
spec.summary = %q{WoW Arena Analytics}
|
12
|
+
spec.description = %q{Queries Wow Arena Stats}
|
13
|
+
spec.homepage = "http://www.glaze-wow.com"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'uri'
|
3
|
+
require 'json'
|
4
|
+
require "glaze/analyzer/version"
|
5
|
+
require "glaze/analyzer/characterdata"
|
6
|
+
require "glaze/analyzer/glyphs"
|
7
|
+
|
8
|
+
module GlazeAnalyzer
|
9
|
+
class Analyzer
|
10
|
+
|
11
|
+
attr_reader :ranking_data
|
12
|
+
|
13
|
+
def initialize
|
14
|
+
@ranking_data = retrieve_ranking_data
|
15
|
+
end
|
16
|
+
|
17
|
+
def retrieve_ranking_data
|
18
|
+
puts 'retrieving 3v3 ranking data...'
|
19
|
+
uri = URI.parse('http://us.battle.net/api/wow/leaderboard/3v3')
|
20
|
+
response = Net::HTTP.get_response(uri)
|
21
|
+
puts 'retrieved ranking data, parsing json....'
|
22
|
+
results = JSON.parse(response.body)
|
23
|
+
|
24
|
+
results['rows']
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_top_characters(spec_id, number_to_retrieve)
|
28
|
+
character_list = []
|
29
|
+
retrieved = 0
|
30
|
+
|
31
|
+
@ranking_data.each do |character|
|
32
|
+
if spec_id == character['specId']
|
33
|
+
character_list << character
|
34
|
+
retrieved += 1
|
35
|
+
end
|
36
|
+
if retrieved >= number_to_retrieve
|
37
|
+
break
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
character_list
|
42
|
+
end
|
43
|
+
|
44
|
+
def create_glyph_hash(glyph_array, spec_id)
|
45
|
+
glyph_count = Glyphs.new(spec_id)
|
46
|
+
glyph_array.each do |g|
|
47
|
+
glyph_count.glyph_data[g] +=1
|
48
|
+
end
|
49
|
+
glyph_count.glyph_data
|
50
|
+
end
|
51
|
+
|
52
|
+
def get_glyph_data_for_spec(spec_id, number_to_retrieve)
|
53
|
+
character_list = get_top_characters(spec_id, number_to_retrieve)
|
54
|
+
glyph_list = []
|
55
|
+
character_data_list = character_list.map do |x|
|
56
|
+
begin
|
57
|
+
CharacterData.new(x['realmSlug'], x['name'], x['specId'])
|
58
|
+
rescue
|
59
|
+
puts "error.. skipped character"
|
60
|
+
nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
character_data_list.compact!
|
64
|
+
character_data_list.each do |character|
|
65
|
+
character.major_glyph_names.each do |g|
|
66
|
+
glyph_list << g
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
glyph_hash = create_glyph_hash(glyph_list, spec_id)
|
71
|
+
|
72
|
+
return glyph_hash, character_data_list.count
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,112 @@
|
|
1
|
+
module GlazeAnalyzer
|
2
|
+
|
3
|
+
class CharacterData
|
4
|
+
attr_accessor :data
|
5
|
+
|
6
|
+
def initialize(realm, character_name, pvp_spec_id)
|
7
|
+
uri = URI.parse("http://us.battle.net/api/wow/character/#{realm}/#{URI.encode(character_name)}?fields=talents")
|
8
|
+
response = Net::HTTP.get_response(uri)
|
9
|
+
character_data = JSON.parse(response.body)
|
10
|
+
|
11
|
+
tries = 0
|
12
|
+
while character_data['talents'] == nil
|
13
|
+
if tries > 3
|
14
|
+
raise 'Error retrieving character data'
|
15
|
+
end
|
16
|
+
|
17
|
+
puts "error.. retrying #{character_name} - #{realm} retrying in 5 seconds"
|
18
|
+
response = Net::HTTP.get_response(uri)
|
19
|
+
character_data = JSON.parse(response.body)
|
20
|
+
tries += 1
|
21
|
+
sleep 5
|
22
|
+
end
|
23
|
+
|
24
|
+
@data = character_data
|
25
|
+
@pvp_spec_id = pvp_spec_id
|
26
|
+
end
|
27
|
+
|
28
|
+
def pvp_spec
|
29
|
+
pvp_spec_name = spec_name(@pvp_spec_id) # eg. Retribution
|
30
|
+
spec1_name, spec2_name = get_character_spec_names # eg. Retribution, Holy
|
31
|
+
|
32
|
+
|
33
|
+
if pvp_spec_name == spec1_name && pvp_spec_name == spec2_name
|
34
|
+
if @data['talents'].first['selected'] == true
|
35
|
+
return 0
|
36
|
+
else
|
37
|
+
return 1
|
38
|
+
end
|
39
|
+
elsif pvp_spec_name == spec1_name
|
40
|
+
return 0
|
41
|
+
elsif pvp_spec_name == spec2_name
|
42
|
+
return 1
|
43
|
+
else
|
44
|
+
return 0
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_character_spec_names
|
49
|
+
begin
|
50
|
+
spec1_name = @data['talents'][0]['spec']['name']
|
51
|
+
rescue
|
52
|
+
spec1_name = 'nil'
|
53
|
+
end
|
54
|
+
|
55
|
+
begin
|
56
|
+
spec2_name = @data['talents'][1]['spec']['name']
|
57
|
+
rescue
|
58
|
+
spec2_name = 'nil'
|
59
|
+
end
|
60
|
+
|
61
|
+
return spec1_name, spec2_name
|
62
|
+
end
|
63
|
+
|
64
|
+
def major_glyph_names
|
65
|
+
@data['talents'][pvp_spec]['glyphs']['major'].map do |glyph|
|
66
|
+
glyph['name']
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def spec_name(spec_id)
|
71
|
+
spec_names = {
|
72
|
+
102 => 'Balance',
|
73
|
+
103 => 'Feral Combat',
|
74
|
+
104 => 'Guardian',
|
75
|
+
105 => 'Restoration',
|
76
|
+
250 => 'Blood',
|
77
|
+
251 => 'Frost',
|
78
|
+
252 => 'Unholy',
|
79
|
+
253 => 'Beast Mastery',
|
80
|
+
254 => 'Marksmanship',
|
81
|
+
255 => 'Survival',
|
82
|
+
256 => 'Discipline',
|
83
|
+
257 => 'Holy',
|
84
|
+
258 => 'Shadow',
|
85
|
+
259 => 'Assassination',
|
86
|
+
260 => 'Combat',
|
87
|
+
261 => 'Subtlety',
|
88
|
+
262 => 'Elemental',
|
89
|
+
263 => 'Enhancement',
|
90
|
+
264 => 'Restoration',
|
91
|
+
265 => 'Affliction',
|
92
|
+
266 => 'Demonology',
|
93
|
+
267 => 'Destruction',
|
94
|
+
268 => 'Brewmaster',
|
95
|
+
269 => 'Windwalker',
|
96
|
+
270 => 'Mistweaver',
|
97
|
+
62 => 'Arcane',
|
98
|
+
63 => 'Fire',
|
99
|
+
64 => 'Frost',
|
100
|
+
65 => 'Holy',
|
101
|
+
66 => 'Protection',
|
102
|
+
70 => 'Retribution',
|
103
|
+
71 => 'Arms',
|
104
|
+
72 => 'Fury',
|
105
|
+
73 => 'Protection'
|
106
|
+
}
|
107
|
+
|
108
|
+
return spec_names[spec_id]
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,428 @@
|
|
1
|
+
module GlazeAnalyzer
|
2
|
+
|
3
|
+
class Glyphs
|
4
|
+
attr_accessor :glyph_data
|
5
|
+
|
6
|
+
def initialize(spec_id)
|
7
|
+
@glyph_data = Hash.new
|
8
|
+
|
9
|
+
case spec_id
|
10
|
+
when 65..70
|
11
|
+
@glyph_data = paladin_glyphs
|
12
|
+
when 256..258
|
13
|
+
@glyph_data = priest_glyphs
|
14
|
+
when 250..252
|
15
|
+
@glyph_data = deathknight_glyphs
|
16
|
+
when 102..105
|
17
|
+
@glyph_data = druid_glyphs
|
18
|
+
when 253..255
|
19
|
+
@glyph_data = hunter_glyphs
|
20
|
+
when 62..64
|
21
|
+
@glyph_data = mage_glyphs
|
22
|
+
when 268..270
|
23
|
+
@glyph_data = monk_glyphs
|
24
|
+
when 259..261
|
25
|
+
@glyph_data = rogue_glyphs
|
26
|
+
when 262..264
|
27
|
+
@glyph_data = shaman_glyphs
|
28
|
+
when 265..267
|
29
|
+
@glyph_data = warlock_glyphs
|
30
|
+
when 71..73
|
31
|
+
@glyph_data = warrior_glyphs
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
|
36
|
+
def warrior_glyphs
|
37
|
+
{
|
38
|
+
'Glyph of Rude Interruption' => 0,
|
39
|
+
'Glyph of Blitz' => 0,
|
40
|
+
'Glyph of Bloodthirst' => 0,
|
41
|
+
'Glyph of Bull Rush' => 0,
|
42
|
+
'Glyph of Cleave' => 0,
|
43
|
+
'Glyph of Death From Above' => 0,
|
44
|
+
'Glyph of Die by the Sword' => 0,
|
45
|
+
'Glyph of Enraged Speed' => 0,
|
46
|
+
'Glyph of Flawless Defense' => 0,
|
47
|
+
'Glyph of Gag Order' => 0,
|
48
|
+
'Glyph of Heroic Leap' => 0,
|
49
|
+
'Glyph of Hindering Strikes' => 0,
|
50
|
+
'Glyph of Impaling Throws' => 0,
|
51
|
+
'Glyph of Long Charge' => 0,
|
52
|
+
'Glyph of Mocking Banner' => 0,
|
53
|
+
'Glyph of Mortal Strike' => 0,
|
54
|
+
'Glyph of Raging Blow' => 0,
|
55
|
+
'Glyph of Raging Wind' => 0,
|
56
|
+
'Glyph of Rallying Cry' => 0,
|
57
|
+
'Glyph of Recklessness' => 0,
|
58
|
+
'Glyph of Resonating Power' => 0,
|
59
|
+
'Glyph of Shattering Throw' => 0,
|
60
|
+
'Glyph of Shield Slam' => 0,
|
61
|
+
'Glyph of Shield Wall' => 0,
|
62
|
+
'Glyph of Spell Reflection' => 0,
|
63
|
+
'Glyph of Sweeping Strikes' => 0,
|
64
|
+
'Glyph of the Drawn Sword' => 0,
|
65
|
+
'Glyph of the Executor' => 0,
|
66
|
+
'Glyph of Unending Rage' => 0,
|
67
|
+
'Glyph of Victorious Throw' => 0,
|
68
|
+
'Glyph of Victory Rush' => 0,
|
69
|
+
'Glyph of Wind and Thunder' => 0,
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
def paladin_glyphs
|
74
|
+
{
|
75
|
+
"Glyph of Ardent Defender" => 0,
|
76
|
+
"Glyph of Avenging Wrath" => 0,
|
77
|
+
"Glyph of Beacon of Light" => 0,
|
78
|
+
"Glyph of Blessed Life" => 0,
|
79
|
+
"Glyph of Burden of Guilt" => 0,
|
80
|
+
"Glyph of Cleanse" => 0,
|
81
|
+
"Glyph of Consecration" => 0,
|
82
|
+
"Glyph of Dazing Shield" => 0,
|
83
|
+
"Glyph of Denounce" => 0,
|
84
|
+
"Glyph of Devotion Aura" => 0,
|
85
|
+
"Glyph of Divine Protection" => 0,
|
86
|
+
"Glyph of Divine Shield" => 0,
|
87
|
+
"Glyph of Divine Storm" => 0,
|
88
|
+
"Glyph of Divine Wrath" => 0,
|
89
|
+
"Glyph of Divinity" => 0,
|
90
|
+
"Glyph of Double Jeopardy" => 0,
|
91
|
+
"Glyph of Final Wrath" => 0,
|
92
|
+
"Glyph of Flash of Light" => 0,
|
93
|
+
"Glyph of Focused Shield" => 0,
|
94
|
+
"Glyph of Hammer of the Righteous" => 0,
|
95
|
+
"Glyph of Hand of Freedom" => 0,
|
96
|
+
"Glyph of Hand of Sacrifice" => 0,
|
97
|
+
"Glyph of Harsh Words" => 0,
|
98
|
+
"Glyph of Holy Shock" => 0,
|
99
|
+
"Glyph of Holy Wrath" => 0,
|
100
|
+
"Glyph of Illumination" => 0,
|
101
|
+
"Glyph of Immediate Truth" => 0,
|
102
|
+
"Glyph of Judgment" => 0,
|
103
|
+
"Glyph of Light of Dawn" => 0,
|
104
|
+
"Glyph of Mass Exorcism" => 0,
|
105
|
+
"Glyph of Merciful Wrath" => 0,
|
106
|
+
"Glyph of Protector of the Innocent" => 0,
|
107
|
+
"Glyph of Templar's Verdict" => 0,
|
108
|
+
"Glyph of the Alabaster Shield" => 0,
|
109
|
+
"Glyph of the Battle Healer" => 0,
|
110
|
+
"Glyph of the Consecrator" => 0,
|
111
|
+
"Glyph of the Liberator" => 0,
|
112
|
+
"Glyph of Word of Glory" => 0
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
def priest_glyphs
|
117
|
+
{
|
118
|
+
"Glyph of Holy Nova" => 0,
|
119
|
+
"Glyph of Binding Heal" => 0,
|
120
|
+
"Glyph of Circle of Healing" => 0,
|
121
|
+
"Glyph of Deep Wells" => 0,
|
122
|
+
"Glyph of Delayed Coalescence" => 0,
|
123
|
+
"Glyph of Dispel Magic" => 0,
|
124
|
+
"Glyph of Dispersion" => 0,
|
125
|
+
"Glyph of Fade" => 0,
|
126
|
+
"Glyph of Fear Ward" => 0,
|
127
|
+
"Glyph of Focused Mending" => 0,
|
128
|
+
"Glyph of Free Action" => 0,
|
129
|
+
"Glyph of Guardian Spirit" => 0,
|
130
|
+
"Glyph of Holy Fire" => 0,
|
131
|
+
"Glyph of Inner Fire" => 0,
|
132
|
+
"Glyph of Inner Sanctum" => 0,
|
133
|
+
"Glyph of Leap of Faith" => 0,
|
134
|
+
"Glyph of Levitate" => 0,
|
135
|
+
"Glyph of Lightwell" => 0,
|
136
|
+
"Glyph of Mass Dispel" => 0,
|
137
|
+
"Glyph of Mind Blast" => 0,
|
138
|
+
"Glyph of Mind Flay" => 0,
|
139
|
+
"Glyph of Mind Harvest" => 0,
|
140
|
+
"Glyph of Mind Spike" => 0,
|
141
|
+
"Glyph of Miraculous Dispelling" => 0,
|
142
|
+
"Glyph of Penance" => 0,
|
143
|
+
"Glyph of Power Word: Shield" => 0,
|
144
|
+
"Glyph of Prayer of Mending" => 0,
|
145
|
+
"Glyph of Psychic Horror" => 0,
|
146
|
+
"Glyph of Psychic Scream" => 0,
|
147
|
+
"Glyph of Purification" => 0,
|
148
|
+
"Glyph of Purify" => 0,
|
149
|
+
"Glyph of Reflective Shield" => 0,
|
150
|
+
"Glyph of Renew" => 0,
|
151
|
+
"Glyph of Restored Faith" => 0,
|
152
|
+
"Glyph of Scourge Imprisonment" => 0,
|
153
|
+
"Glyph of Shadow Magic" => 0,
|
154
|
+
"Glyph of Shadow Word: Death" => 0,
|
155
|
+
"Glyph of Silence" => 0,
|
156
|
+
"Glyph of Smite" => 0,
|
157
|
+
"Glyph of Spirit of Redemption" => 0,
|
158
|
+
"Glyph of the Inquisitor" => 0,
|
159
|
+
"Glyph of the Redeemer" => 0,
|
160
|
+
"Glyph of Vampiric Embrace" => 0,
|
161
|
+
"Glyph of Weakened Soul" => 0,
|
162
|
+
}
|
163
|
+
end
|
164
|
+
|
165
|
+
def deathknight_glyphs
|
166
|
+
{
|
167
|
+
"Glyph of Chains of Ice" => 0,
|
168
|
+
"Glyph of Icebound Fortitude" => 0,
|
169
|
+
"Glyph of Runic Power" => 0,
|
170
|
+
"Glyph of Shifting Presences" => 0,
|
171
|
+
"Glyph of Unholy Frenzy" => 0,
|
172
|
+
"Glyph of Vampiric Blood" => 0,
|
173
|
+
"Glyph of Absorb Magic" => 0,
|
174
|
+
"Glyph of Anti-Magic Shell" => 0,
|
175
|
+
"Glyph of Blood Boil" => 0,
|
176
|
+
"Glyph of Dancing Rune Weapon" => 0,
|
177
|
+
"Glyph of Dark Simulacrum" => 0,
|
178
|
+
"Glyph of Death and Decay" => 0,
|
179
|
+
"Glyph of Death Coil" => 0,
|
180
|
+
"Glyph of Death Grip" => 0,
|
181
|
+
"Glyph of Empowerment" => 0,
|
182
|
+
"Glyph of Enduring Infection" => 0,
|
183
|
+
"Glyph of Icy Runes" => 0,
|
184
|
+
"Glyph of Icy Touch" => 0,
|
185
|
+
"Glyph of Mind Freeze" => 0,
|
186
|
+
"Glyph of Outbreak" => 0,
|
187
|
+
"Glyph of Pillar of Frost" => 0,
|
188
|
+
"Glyph of Raise Ally" => 0,
|
189
|
+
"Glyph of Regenerative Magic" => 0,
|
190
|
+
"Glyph of Rune Tap" => 0,
|
191
|
+
"Glyph of Strangulate" => 0,
|
192
|
+
"Glyph of Swift Death" => 0,
|
193
|
+
"Glyph of the Ice Reaper" => 0,
|
194
|
+
"Glyph of Unholy Command" => 0,
|
195
|
+
}
|
196
|
+
end
|
197
|
+
|
198
|
+
def druid_glyphs
|
199
|
+
{
|
200
|
+
"Glyph of Rejuvenation" => 0,
|
201
|
+
"Glyph of Cyclone" => 0,
|
202
|
+
"Glyph of Maim" => 0,
|
203
|
+
"Glyph of Moonwarding" => 0,
|
204
|
+
"Glyph of Skull Bash" => 0,
|
205
|
+
"Glyph of the Shapemender" => 0,
|
206
|
+
"Glyph of Astral Communion" => 0,
|
207
|
+
"Glyph of Barkskin" => 0,
|
208
|
+
"Glyph of Blooming" => 0,
|
209
|
+
"Glyph of Cat Form" => 0,
|
210
|
+
"Glyph of Celestial Alignment" => 0,
|
211
|
+
"Glyph of Dash" => 0,
|
212
|
+
"Glyph of Enchanted Bark" => 0,
|
213
|
+
"Glyph of Entangling Energy" => 0,
|
214
|
+
"Glyph of Entangling Roots" => 0,
|
215
|
+
"Glyph of Fae Silence" => 0,
|
216
|
+
"Glyph of Faerie Fire" => 0,
|
217
|
+
"Glyph of Ferocious Bite" => 0,
|
218
|
+
"Glyph of Guided Stars" => 0,
|
219
|
+
"Glyph of Healing Touch" => 0,
|
220
|
+
"Glyph of Hurricane" => 0,
|
221
|
+
"Glyph of Imbued Bark" => 0,
|
222
|
+
"Glyph of Maul" => 0,
|
223
|
+
"Glyph of Nature's Cure" => 0,
|
224
|
+
"Glyph of Rake" => 0,
|
225
|
+
"Glyph of Rebirth" => 0,
|
226
|
+
"Glyph of Regrowth" => 0,
|
227
|
+
"Glyph of Savage Roar" => 0,
|
228
|
+
"Glyph of Stampeding Roar" => 0,
|
229
|
+
"Glyph of Survival Instincts" => 0,
|
230
|
+
"Glyph of the Master Shapeshifter" => 0,
|
231
|
+
"Glyph of the Ninth Life" => 0,
|
232
|
+
"Glyph of Wild Growth" => 0,
|
233
|
+
}
|
234
|
+
end
|
235
|
+
|
236
|
+
def hunter_glyphs
|
237
|
+
{
|
238
|
+
"Glyph of Liberation" => 0,
|
239
|
+
"Glyph of Quick Revival" => 0,
|
240
|
+
"Glyph of Snake Trap" => 0,
|
241
|
+
"Glyph of Animal Bond" => 0,
|
242
|
+
"Glyph of Black Ice" => 0,
|
243
|
+
"Glyph of Camouflage" => 0,
|
244
|
+
"Glyph of Chimaera Shot" => 0,
|
245
|
+
"Glyph of Deterrence" => 0,
|
246
|
+
"Glyph of Disengage" => 0,
|
247
|
+
"Glyph of Distracting Shot" => 0,
|
248
|
+
"Glyph of Endless Wrath" => 0,
|
249
|
+
"Glyph of Enduring Deceit" => 0,
|
250
|
+
"Glyph of Explosive Trap" => 0,
|
251
|
+
"Glyph of Freezing Trap" => 0,
|
252
|
+
"Glyph of Ice Trap" => 0,
|
253
|
+
"Glyph of Master's Call" => 0,
|
254
|
+
"Glyph of Mend Pet" => 0,
|
255
|
+
"Glyph of Mending" => 0,
|
256
|
+
"Glyph of Mirrored Blades" => 0,
|
257
|
+
"Glyph of Misdirection" => 0,
|
258
|
+
"Glyph of No Escape" => 0,
|
259
|
+
"Glyph of Pathfinding" => 0,
|
260
|
+
"Glyph of Solace" => 0,
|
261
|
+
"Glyph of the Lean Pack" => 0,
|
262
|
+
"Glyph of Tranquilizing Shot" => 0,
|
263
|
+
}
|
264
|
+
end
|
265
|
+
|
266
|
+
def mage_glyphs
|
267
|
+
{
|
268
|
+
"Glyph of Dragon's Breath" => 0,
|
269
|
+
"Glyph of Regenerative Ice" => 0,
|
270
|
+
"Glyph of Slow" => 0,
|
271
|
+
"Glyph of Arcane Explosion" => 0,
|
272
|
+
"Glyph of Arcane Power" => 0,
|
273
|
+
"Glyph of Blink" => 0,
|
274
|
+
"Glyph of Combustion" => 0,
|
275
|
+
"Glyph of Cone of Cold" => 0,
|
276
|
+
"Glyph of Counterspell" => 0,
|
277
|
+
"Glyph of Deep Freeze" => 0,
|
278
|
+
"Glyph of Frost Nova" => 0,
|
279
|
+
"Glyph of Frostfire Bolt" => 0,
|
280
|
+
"Glyph of Ice Block" => 0,
|
281
|
+
"Glyph of Icy Veins" => 0,
|
282
|
+
"Glyph of Inferno Blast" => 0,
|
283
|
+
"Glyph of Polymorph" => 0,
|
284
|
+
"Glyph of Rapid Displacement" => 0,
|
285
|
+
"Glyph of Remove Curse" => 0,
|
286
|
+
"Glyph of Spellsteal" => 0,
|
287
|
+
"Glyph of Splitting Ice" => 0,
|
288
|
+
"Glyph of Water Elemental" => 0,
|
289
|
+
}
|
290
|
+
end
|
291
|
+
|
292
|
+
def monk_glyphs
|
293
|
+
{
|
294
|
+
"Glyph of Expel Harm" => 0,
|
295
|
+
"Glyph of Freedom Roll" => 0,
|
296
|
+
"Glyph of Keg Smash" => 0,
|
297
|
+
"Glyph of Renewed Tea" => 0,
|
298
|
+
"Glyph of Soothing Mist" => 0,
|
299
|
+
"Glyph of the Floating Butterfly" => 0,
|
300
|
+
"Glyph of the Flying Serpent" => 0,
|
301
|
+
"Glyph of Victory Roll" => 0,
|
302
|
+
"Glyph of Breath of Fire" => 0,
|
303
|
+
"Glyph of Detox" => 0,
|
304
|
+
"Glyph of Detoxing" => 0,
|
305
|
+
"Glyph of Fists of Fury" => 0,
|
306
|
+
"Glyph of Flying Fists" => 0,
|
307
|
+
"Glyph of Fortifying Brew" => 0,
|
308
|
+
"Glyph of Fortuitous Spheres" => 0,
|
309
|
+
"Glyph of Guard" => 0,
|
310
|
+
"Glyph of Leer of the Ox" => 0,
|
311
|
+
"Glyph of Life Cocoon" => 0,
|
312
|
+
"Glyph of Mana Tea" => 0,
|
313
|
+
"Glyph of Nimble Brew" => 0,
|
314
|
+
"Glyph of Paralysis" => 0,
|
315
|
+
"Glyph of Rapid Rolling" => 0,
|
316
|
+
"Glyph of Renewing Mist" => 0,
|
317
|
+
"Glyph of Surging Mist" => 0,
|
318
|
+
"Glyph of Targeted Expulsion" => 0,
|
319
|
+
"Glyph of Touch of Death" => 0,
|
320
|
+
"Glyph of Touch of Karma" => 0,
|
321
|
+
"Glyph of Transcendence" => 0,
|
322
|
+
"Glyph of Zen Focus" => 0,
|
323
|
+
"Glyph of Zen Meditation" => 0,
|
324
|
+
}
|
325
|
+
end
|
326
|
+
|
327
|
+
def rogue_glyphs
|
328
|
+
{
|
329
|
+
"Glyph of Ambush" => 0,
|
330
|
+
"Glyph of Blade Flurry" => 0,
|
331
|
+
"Glyph of Blind" => 0,
|
332
|
+
"Glyph of Cheap Shot" => 0,
|
333
|
+
"Glyph of Cloak of Shadows" => 0,
|
334
|
+
"Glyph of Deadly Momentum" => 0,
|
335
|
+
"Glyph of Disappearance" => 0,
|
336
|
+
"Glyph of Elusiveness" => 0,
|
337
|
+
"Glyph of Energy" => 0,
|
338
|
+
"Glyph of Energy Flows" => 0,
|
339
|
+
"Glyph of Evasion" => 0,
|
340
|
+
"Glyph of Feint" => 0,
|
341
|
+
"Glyph of Garrote" => 0,
|
342
|
+
"Glyph of Gouge" => 0,
|
343
|
+
"Glyph of Hemorrhaging Veins" => 0,
|
344
|
+
"Glyph of Kick" => 0,
|
345
|
+
"Glyph of Recovery" => 0,
|
346
|
+
"Glyph of Recuperate" => 0,
|
347
|
+
"Glyph of Shiv" => 0,
|
348
|
+
"Glyph of Smoke Bomb" => 0,
|
349
|
+
"Glyph of Sprint" => 0,
|
350
|
+
"Glyph of Stealth" => 0,
|
351
|
+
"Glyph of Vanish" => 0,
|
352
|
+
"Glyph of Vendetta" => 0,
|
353
|
+
}
|
354
|
+
end
|
355
|
+
|
356
|
+
def shaman_glyphs
|
357
|
+
{
|
358
|
+
"Glyph of Grounding" => 0,
|
359
|
+
"Glyph of Lava Spread" => 0,
|
360
|
+
"Glyph of Reactive Shielding" => 0,
|
361
|
+
"Glyph of Shamanistic Resolve" => 0,
|
362
|
+
"Glyph of Shocks" => 0,
|
363
|
+
"Glyph of Spiritwalker's Focus" => 0,
|
364
|
+
"Glyph of Capacitor Totem" => 0,
|
365
|
+
"Glyph of Chain Lightning" => 0,
|
366
|
+
"Glyph of Chaining" => 0,
|
367
|
+
"Glyph of Cleansing Waters" => 0,
|
368
|
+
"Glyph of Ephemeral Spirits" => 0,
|
369
|
+
"Glyph of Eternal Earth" => 0,
|
370
|
+
"Glyph of Feral Spirit" => 0,
|
371
|
+
"Glyph of Fire Elemental Totem" => 0,
|
372
|
+
"Glyph of Fire Nova" => 0,
|
373
|
+
"Glyph of Flame Shock" => 0,
|
374
|
+
"Glyph of Frost Shock" => 0,
|
375
|
+
"Glyph of Frostbrand Weapon" => 0,
|
376
|
+
"Glyph of Ghost Wolf" => 0,
|
377
|
+
"Glyph of Grounding Totem" => 0,
|
378
|
+
"Glyph of Healing Stream Totem" => 0,
|
379
|
+
"Glyph of Healing Wave" => 0,
|
380
|
+
"Glyph of Hex" => 0,
|
381
|
+
"Glyph of Lightning Shield" => 0,
|
382
|
+
"Glyph of Purge" => 0,
|
383
|
+
"Glyph of Purging" => 0,
|
384
|
+
"Glyph of Purify Spirit" => 0,
|
385
|
+
"Glyph of Riptide" => 0,
|
386
|
+
"Glyph of Shamanistic Rage" => 0,
|
387
|
+
"Glyph of Spirit Walk" => 0,
|
388
|
+
"Glyph of Spiritwalker's Aegis" => 0,
|
389
|
+
"Glyph of Spiritwalker's Grace" => 0,
|
390
|
+
"Glyph of Thunder" => 0,
|
391
|
+
"Glyph of Totemic Recall" => 0,
|
392
|
+
"Glyph of Totemic Vigor" => 0,
|
393
|
+
"Glyph of Unstable Earth" => 0,
|
394
|
+
"Glyph of Water Shield" => 0,
|
395
|
+
"Glyph of Wind Shear" => 0,
|
396
|
+
}
|
397
|
+
end
|
398
|
+
|
399
|
+
def warlock_glyphs
|
400
|
+
{
|
401
|
+
"Glyph of Conflagrate" => 0,
|
402
|
+
"Glyph of Dark Soul" => 0,
|
403
|
+
"Glyph of Demon Training" => 0,
|
404
|
+
"Glyph of Demonic Circle" => 0,
|
405
|
+
"Glyph of Drain Life" => 0,
|
406
|
+
"Glyph of Ember Tap" => 0,
|
407
|
+
"Glyph of Eternal Resolve" => 0,
|
408
|
+
"Glyph of Fear" => 0,
|
409
|
+
"Glyph of Havoc" => 0,
|
410
|
+
"Glyph of Healthstone" => 0,
|
411
|
+
"Glyph of Imp Swarm" => 0,
|
412
|
+
"Glyph of Life Pact" => 0,
|
413
|
+
"Glyph of Life Tap" => 0,
|
414
|
+
"Glyph of Shadowflame" => 0,
|
415
|
+
"Glyph of Siphon Life" => 0,
|
416
|
+
"Glyph of Soul Consumption" => 0,
|
417
|
+
"Glyph of Soul Swap" => 0,
|
418
|
+
"Glyph of Soul Swap" => 0,
|
419
|
+
"Glyph of Soulstone" => 0,
|
420
|
+
"Glyph of Strengthened Resolve" => 0,
|
421
|
+
"Glyph of Twilight Ward" => 0,
|
422
|
+
"Glyph of Unending Resolve" => 0,
|
423
|
+
"Glyph of Unstable Affliction" => 0,
|
424
|
+
}
|
425
|
+
end
|
426
|
+
|
427
|
+
end
|
428
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
|
4
|
+
describe GlazeAnalyzer::Analyzer do
|
5
|
+
analyzer = GlazeAnalyzer::Analyzer.new('sample_3v3.json')
|
6
|
+
|
7
|
+
it 'retrieves 3v3 ranking data and parses as array' do
|
8
|
+
expect(analyzer.ranking_data).to be_an(Array)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'gets top arena players by spec' do
|
12
|
+
top_paladins = analyzer.get_top_characters(70, 3)
|
13
|
+
expect(top_paladins).to be_an(Array)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'gets glyph data for a spec' do
|
17
|
+
glyph_data, character_count = analyzer.get_glyph_data_for_spec(70, 3)
|
18
|
+
expect(glyph_data).to be_an(Hash)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'increments glyph list based on glyph array' do
|
22
|
+
glyph_array = [
|
23
|
+
"Glyph of Templar's Verdict",
|
24
|
+
"Glyph of Templar's Verdict",
|
25
|
+
"Glyph of Templar's Verdict",
|
26
|
+
"Glyph of Burden of Guilt",
|
27
|
+
"Glyph of Burden of Guilt",
|
28
|
+
"Glyph of Burden of Guilt",
|
29
|
+
"Glyph of Hand of Freedom",
|
30
|
+
"Glyph of Hand of Freedom",
|
31
|
+
"Glyph of Hand of Freedom",
|
32
|
+
]
|
33
|
+
glyph_hash = analyzer.create_glyph_hash(glyph_array, 70)
|
34
|
+
expect(glyph_hash["Glyph of Hand of Freedom"]).to eq 3
|
35
|
+
end
|
36
|
+
|
37
|
+
it 'gets total amount of a spec' do
|
38
|
+
num_of_ret_paladins = analyzer.get_total_spec(70)
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
|
43
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GlazeAnalyzer::CharacterData do
|
4
|
+
character_data = GlazeAnalyzer::CharacterData.new(
|
5
|
+
'bleeding-hollow',
|
6
|
+
'aeze',
|
7
|
+
70)
|
8
|
+
|
9
|
+
it 'successfully retrives character information' do
|
10
|
+
expect(character_data.data).to be_an(Hash)
|
11
|
+
end
|
12
|
+
end
|
data/spec/glyphs_spec.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GlazeAnalyzer::Glyphs do
|
4
|
+
glyphs = GlazeAnalyzer::Glyphs.new(70)
|
5
|
+
|
6
|
+
it 'should initialize as a hash' do
|
7
|
+
expect(glyphs.glyph_data).to be_an(Hash)
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should be initialized with proper hash data' do
|
11
|
+
expect(glyphs.glyph_data["Glyph of Templar's Verdict"]).to eq 0
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'glaze/analyzer'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
# Use color in STDOUT
|
5
|
+
config.color = true
|
6
|
+
|
7
|
+
# Use color not only in STDOUT but also in pagers and files
|
8
|
+
config.tty = true
|
9
|
+
|
10
|
+
# Use the specified formatter
|
11
|
+
config.formatter = :documentation # :progress, :html, :textmate
|
12
|
+
end
|
data/tasks/rspec.rake
ADDED
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: glaze-analyzer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Marcus Orochena
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: Queries Wow Arena Stats
|
56
|
+
email:
|
57
|
+
- marcus@orochena.net
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- glaze-analyzer.gemspec
|
68
|
+
- lib/glaze/analyzer.rb
|
69
|
+
- lib/glaze/analyzer/characterdata.rb
|
70
|
+
- lib/glaze/analyzer/glyphs.rb
|
71
|
+
- lib/glaze/analyzer/version.rb
|
72
|
+
- spec/analyzer_spec.rb
|
73
|
+
- spec/characterdata_spec.rb
|
74
|
+
- spec/glyphs_spec.rb
|
75
|
+
- spec/spec_helper.rb
|
76
|
+
- tasks/rspec.rake
|
77
|
+
homepage: http://www.glaze-wow.com
|
78
|
+
licenses:
|
79
|
+
- MIT
|
80
|
+
metadata: {}
|
81
|
+
post_install_message:
|
82
|
+
rdoc_options: []
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
requirements: []
|
96
|
+
rubyforge_project:
|
97
|
+
rubygems_version: 2.4.3
|
98
|
+
signing_key:
|
99
|
+
specification_version: 4
|
100
|
+
summary: WoW Arena Analytics
|
101
|
+
test_files:
|
102
|
+
- spec/analyzer_spec.rb
|
103
|
+
- spec/characterdata_spec.rb
|
104
|
+
- spec/glyphs_spec.rb
|
105
|
+
- spec/spec_helper.rb
|