elekk 1.0.1 → 1.0.2
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/.gitignore +3 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +38 -0
- data/Rakefile +6 -30
- data/changelog.md +4 -0
- data/elekk.gemspec +25 -65
- data/lib/elekk.rb +2 -0
- data/lib/elekk/armory.rb +2 -2
- data/lib/elekk/version.rb +3 -0
- data/spec/armory_spec.rb +4 -1
- data/spec/character_spec.rb +10 -10
- metadata +49 -25
- data/Manifest +0 -14
- data/VERSION +0 -1
- data/spec/test.rb +0 -7
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
elekk (1.0.2)
|
5
|
+
json
|
6
|
+
memcached
|
7
|
+
nokogiri
|
8
|
+
typhoeus
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
diff-lcs (1.1.2)
|
14
|
+
json (1.4.6)
|
15
|
+
memcached (1.0.2)
|
16
|
+
nokogiri (1.4.4)
|
17
|
+
rake (0.8.7)
|
18
|
+
rspec (2.2.0)
|
19
|
+
rspec-core (~> 2.2)
|
20
|
+
rspec-expectations (~> 2.2)
|
21
|
+
rspec-mocks (~> 2.2)
|
22
|
+
rspec-core (2.2.1)
|
23
|
+
rspec-expectations (2.2.0)
|
24
|
+
diff-lcs (~> 1.1.2)
|
25
|
+
rspec-mocks (2.2.0)
|
26
|
+
typhoeus (0.2.0)
|
27
|
+
|
28
|
+
PLATFORMS
|
29
|
+
ruby
|
30
|
+
|
31
|
+
DEPENDENCIES
|
32
|
+
elekk!
|
33
|
+
json
|
34
|
+
memcached
|
35
|
+
nokogiri
|
36
|
+
rake
|
37
|
+
rspec
|
38
|
+
typhoeus
|
data/Rakefile
CHANGED
@@ -1,34 +1,10 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
+
require 'spec/rake/spectask'
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
s.email = "agnoster@gmail.com"
|
10
|
-
s.homepage = "http://github.com/agnoster/elekk"
|
11
|
-
s.description = "A simple library for World of Warcraft data in Ruby."
|
12
|
-
s.authors = ["Isaac Wolkerstorfer"]
|
13
|
-
s.files = FileList["*", "{lib,spec}/**/*"]
|
14
|
-
s.add_dependency 'typhoeus'
|
15
|
-
s.add_dependency 'memcached'
|
16
|
-
s.add_dependency 'nokogiri'
|
17
|
-
s.add_dependency 'json'
|
18
|
-
end
|
19
|
-
Jeweler::GemcutterTasks.new
|
20
|
-
rescue LoadError
|
21
|
-
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
5
|
+
desc "Run all tests"
|
6
|
+
Spec::Rake::SpecTask.new('spec') do |t|
|
7
|
+
t.spec_files = FileList['spec/**/*.rb']
|
8
|
+
t.spec_opts = ["--color", "--format", "specdoc"]
|
9
|
+
t.fail_on_error = false
|
22
10
|
end
|
23
|
-
|
24
|
-
begin
|
25
|
-
require 'spec/rake/spectask'
|
26
|
-
desc "Run all tests"
|
27
|
-
Spec::Rake::SpecTask.new('spec') do |t|
|
28
|
-
t.spec_files = FileList['spec/**/*.rb']
|
29
|
-
t.spec_opts = ["--color", "--format", "specdoc"]
|
30
|
-
t.fail_on_error = false
|
31
|
-
end
|
32
|
-
rescue LoadError
|
33
|
-
puts "No rspec installed, can't run tests"
|
34
|
-
end
|
data/changelog.md
CHANGED
data/elekk.gemspec
CHANGED
@@ -1,72 +1,32 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "elekk/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
6
|
+
s.name = "elekk"
|
7
|
+
s.version = Elekk::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Isaac Wolkerstorfer"]
|
10
|
+
s.email = ["agnoster@gmail.com"]
|
11
|
+
s.homepage = "https://github.com/agnoster/elekk"
|
12
|
+
s.summary = %q{Ruby interface for World of Warcraft data}
|
13
|
+
s.description = %q{Elekk is a Ruby gem that provides an interface to data for Blizzard's highly popular
|
14
|
+
MMORPG, World of Warcraft. It currently uses data both from Blizzard's official Armory website
|
15
|
+
at wowarmory.com, as well as the popular community database, WoWhead.com. Future versions may
|
16
|
+
make use of additional sources of information.}
|
9
17
|
|
10
|
-
s.
|
11
|
-
s.authors = ["Isaac Wolkerstorfer"]
|
12
|
-
s.date = %q{2010-07-25}
|
13
|
-
s.description = %q{A simple library for World of Warcraft data in Ruby.}
|
14
|
-
s.email = %q{agnoster@gmail.com}
|
15
|
-
s.files = [
|
16
|
-
"Manifest",
|
17
|
-
"Rakefile",
|
18
|
-
"VERSION",
|
19
|
-
"changelog.md",
|
20
|
-
"elekk.gemspec",
|
21
|
-
"lib/elekk.rb",
|
22
|
-
"lib/elekk/achievement.rb",
|
23
|
-
"lib/elekk/armory.rb",
|
24
|
-
"lib/elekk/character.rb",
|
25
|
-
"lib/elekk/data.rb",
|
26
|
-
"lib/elekk/http.rb",
|
27
|
-
"lib/elekk/wowhead.rb",
|
28
|
-
"readme.md",
|
29
|
-
"spec/achievement_spec.rb",
|
30
|
-
"spec/armory_spec.rb",
|
31
|
-
"spec/character_spec.rb",
|
32
|
-
"spec/klass_spec.rb",
|
33
|
-
"spec/test.rb",
|
34
|
-
"spec/wowhead_spec.rb"
|
35
|
-
]
|
36
|
-
s.homepage = %q{http://github.com/agnoster/elekk}
|
37
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
38
|
-
s.require_paths = ["lib"]
|
39
|
-
s.rubygems_version = %q{1.3.7}
|
40
|
-
s.summary = %q{A simple library for World of Warcraft data in Ruby.}
|
41
|
-
s.test_files = [
|
42
|
-
"spec/achievement_spec.rb",
|
43
|
-
"spec/armory_spec.rb",
|
44
|
-
"spec/character_spec.rb",
|
45
|
-
"spec/klass_spec.rb",
|
46
|
-
"spec/test.rb",
|
47
|
-
"spec/wowhead_spec.rb"
|
48
|
-
]
|
18
|
+
s.rubyforge_project = "elekk"
|
49
19
|
|
50
|
-
|
51
|
-
|
52
|
-
|
20
|
+
s.add_dependency 'nokogiri'
|
21
|
+
s.add_dependency 'json'
|
22
|
+
s.add_dependency 'typhoeus'
|
23
|
+
s.add_dependency 'memcached'
|
53
24
|
|
54
|
-
|
55
|
-
|
56
|
-
s.add_runtime_dependency(%q<memcached>, [">= 0"])
|
57
|
-
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
58
|
-
s.add_runtime_dependency(%q<json>, [">= 0"])
|
59
|
-
else
|
60
|
-
s.add_dependency(%q<typhoeus>, [">= 0"])
|
61
|
-
s.add_dependency(%q<memcached>, [">= 0"])
|
62
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
63
|
-
s.add_dependency(%q<json>, [">= 0"])
|
64
|
-
end
|
65
|
-
else
|
66
|
-
s.add_dependency(%q<typhoeus>, [">= 0"])
|
67
|
-
s.add_dependency(%q<memcached>, [">= 0"])
|
68
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
69
|
-
s.add_dependency(%q<json>, [">= 0"])
|
70
|
-
end
|
71
|
-
end
|
25
|
+
s.add_development_dependency 'rake'
|
26
|
+
s.add_development_dependency 'rspec'
|
72
27
|
|
28
|
+
s.files = `git ls-files`.split("\n")
|
29
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
30
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
end
|
data/lib/elekk.rb
CHANGED
data/lib/elekk/armory.rb
CHANGED
@@ -17,8 +17,8 @@ module Elekk
|
|
17
17
|
@region ||= Elekk::default_region
|
18
18
|
end
|
19
19
|
|
20
|
-
def character(name)
|
21
|
-
Character.new name,
|
20
|
+
def character(name, realm=@realm)
|
21
|
+
Character.new name, realm, :region => @region, :armory => self
|
22
22
|
end
|
23
23
|
|
24
24
|
def base
|
data/spec/armory_spec.rb
CHANGED
@@ -35,6 +35,9 @@ describe Armory do
|
|
35
35
|
it "should build URLs relative to the server" do
|
36
36
|
@armory.url('character-sheet.xml').should == 'http://us.wowarmory.com/character-sheet.xml';
|
37
37
|
end
|
38
|
+
|
39
|
+
it "should be able to reach the Armory" do
|
40
|
+
end
|
38
41
|
|
39
42
|
it "should get XML from the armory" do
|
40
43
|
xml = @armory.get_xml 'character-sheet', :r => 'Uldaman', :cn => 'Fyrbard'
|
@@ -50,4 +53,4 @@ describe Armory do
|
|
50
53
|
feed = @armory.get_feed ['Aldea', 'Alassiel', 'Puya', 'Ultimohombre', 'Fyrbard']
|
51
54
|
end
|
52
55
|
|
53
|
-
end
|
56
|
+
end
|
data/spec/character_spec.rb
CHANGED
@@ -5,6 +5,7 @@ describe Character do
|
|
5
5
|
before :each do
|
6
6
|
@armory = Armory.new 'Uldaman', :us
|
7
7
|
@fyrbard = @armory.character 'Fyrbard'
|
8
|
+
@karzhak = @armory.character 'Karzhak', 'Farstriders'
|
8
9
|
@aldea = Character.new 'Aldea', 'Uldaman'
|
9
10
|
end
|
10
11
|
|
@@ -36,17 +37,17 @@ describe Character do
|
|
36
37
|
it "should have the right class" do
|
37
38
|
@fyrbard.klass.should == Klass::Priest
|
38
39
|
@aldea.klass.should == Klass::Warrior
|
39
|
-
@
|
40
|
+
@karzhak.klass.should == Klass::DeathKnight
|
40
41
|
end
|
41
42
|
|
42
43
|
it "should have the right level" do
|
43
|
-
@
|
44
|
+
@karzhak.level.should == 58
|
44
45
|
@armory.character('Harimad').level.should == 16
|
45
46
|
end
|
46
47
|
|
47
48
|
it "should have the right faction" do
|
48
49
|
@fyrbard.faction.should == Faction::Alliance
|
49
|
-
@
|
50
|
+
@karzhak.faction.should == Faction::Horde
|
50
51
|
end
|
51
52
|
|
52
53
|
it "should have the right race" do
|
@@ -63,7 +64,7 @@ describe Character do
|
|
63
64
|
|
64
65
|
it "should have the right specs" do
|
65
66
|
@fyrbard.spec(0).should == TalentTree::Priest::Shadow
|
66
|
-
@fyrbard.spec(1).should == TalentTree::Priest::
|
67
|
+
@fyrbard.spec(1).should == TalentTree::Priest::Discipline
|
67
68
|
@aldea.spec(:active).should == TalentTree::Warrior::Protection
|
68
69
|
@armory.character('Alassiel').spec(0).should == TalentTree::Hunter::BeastMastery
|
69
70
|
@armory.character('Alassiel').spec(0).name.should == 'Beast Mastery'
|
@@ -71,15 +72,14 @@ describe Character do
|
|
71
72
|
end
|
72
73
|
|
73
74
|
it "should have the right points" do
|
74
|
-
@
|
75
|
-
@fyrbard.points.should <= 5000
|
75
|
+
@karzhak.points.should == 130
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should have the right title" do
|
79
|
-
@fyrbard.fullname.should == 'Fyrbard
|
80
|
-
@aldea.fullname.should == 'Aldea
|
81
|
-
@aldea.fullname(:strong).should == '<strong>Aldea</strong>
|
82
|
-
@fyrbard.fullname('').should == 'Fyrbard
|
79
|
+
@fyrbard.fullname.should == 'Fyrbard the Hallowed'
|
80
|
+
@aldea.fullname.should == 'Aldea the Diplomat'
|
81
|
+
@aldea.fullname(:strong).should == '<strong>Aldea</strong> the Diplomat'
|
82
|
+
@fyrbard.fullname('').should == 'Fyrbard the Hallowed'
|
83
83
|
@armory.character('Bitterleaf').fullname('strong').should == 'Loremaster <strong>Bitterleaf</strong>'
|
84
84
|
end
|
85
85
|
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elekk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 21
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
8
|
+
- 2
|
9
|
+
version: 1.0.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Isaac Wolkerstorfer
|
@@ -15,67 +14,94 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-12-10 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
21
|
+
name: nokogiri
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
33
31
|
type: :runtime
|
34
32
|
version_requirements: *id001
|
35
33
|
- !ruby/object:Gem::Dependency
|
36
|
-
name:
|
34
|
+
name: json
|
37
35
|
prerelease: false
|
38
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
37
|
none: false
|
40
38
|
requirements:
|
41
39
|
- - ">="
|
42
40
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
41
|
segments:
|
45
42
|
- 0
|
46
43
|
version: "0"
|
47
44
|
type: :runtime
|
48
45
|
version_requirements: *id002
|
49
46
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
47
|
+
name: typhoeus
|
51
48
|
prerelease: false
|
52
49
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
51
|
requirements:
|
55
52
|
- - ">="
|
56
53
|
- !ruby/object:Gem::Version
|
57
|
-
hash: 3
|
58
54
|
segments:
|
59
55
|
- 0
|
60
56
|
version: "0"
|
61
57
|
type: :runtime
|
62
58
|
version_requirements: *id003
|
63
59
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
60
|
+
name: memcached
|
65
61
|
prerelease: false
|
66
62
|
requirement: &id004 !ruby/object:Gem::Requirement
|
67
63
|
none: false
|
68
64
|
requirements:
|
69
65
|
- - ">="
|
70
66
|
- !ruby/object:Gem::Version
|
71
|
-
hash: 3
|
72
67
|
segments:
|
73
68
|
- 0
|
74
69
|
version: "0"
|
75
70
|
type: :runtime
|
76
71
|
version_requirements: *id004
|
77
|
-
|
78
|
-
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: rake
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
83
|
+
type: :development
|
84
|
+
version_requirements: *id005
|
85
|
+
- !ruby/object:Gem::Dependency
|
86
|
+
name: rspec
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
type: :development
|
97
|
+
version_requirements: *id006
|
98
|
+
description: |-
|
99
|
+
Elekk is a Ruby gem that provides an interface to data for Blizzard's highly popular
|
100
|
+
MMORPG, World of Warcraft. It currently uses data both from Blizzard's official Armory website
|
101
|
+
at wowarmory.com, as well as the popular community database, WoWhead.com. Future versions may
|
102
|
+
make use of additional sources of information.
|
103
|
+
email:
|
104
|
+
- agnoster@gmail.com
|
79
105
|
executables: []
|
80
106
|
|
81
107
|
extensions: []
|
@@ -83,9 +109,10 @@ extensions: []
|
|
83
109
|
extra_rdoc_files: []
|
84
110
|
|
85
111
|
files:
|
86
|
-
-
|
112
|
+
- .gitignore
|
113
|
+
- Gemfile
|
114
|
+
- Gemfile.lock
|
87
115
|
- Rakefile
|
88
|
-
- VERSION
|
89
116
|
- changelog.md
|
90
117
|
- elekk.gemspec
|
91
118
|
- lib/elekk.rb
|
@@ -94,21 +121,21 @@ files:
|
|
94
121
|
- lib/elekk/character.rb
|
95
122
|
- lib/elekk/data.rb
|
96
123
|
- lib/elekk/http.rb
|
124
|
+
- lib/elekk/version.rb
|
97
125
|
- lib/elekk/wowhead.rb
|
98
126
|
- readme.md
|
99
127
|
- spec/achievement_spec.rb
|
100
128
|
- spec/armory_spec.rb
|
101
129
|
- spec/character_spec.rb
|
102
130
|
- spec/klass_spec.rb
|
103
|
-
- spec/test.rb
|
104
131
|
- spec/wowhead_spec.rb
|
105
132
|
has_rdoc: true
|
106
|
-
homepage:
|
133
|
+
homepage: https://github.com/agnoster/elekk
|
107
134
|
licenses: []
|
108
135
|
|
109
136
|
post_install_message:
|
110
|
-
rdoc_options:
|
111
|
-
|
137
|
+
rdoc_options: []
|
138
|
+
|
112
139
|
require_paths:
|
113
140
|
- lib
|
114
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -116,7 +143,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
143
|
requirements:
|
117
144
|
- - ">="
|
118
145
|
- !ruby/object:Gem::Version
|
119
|
-
hash: 3
|
120
146
|
segments:
|
121
147
|
- 0
|
122
148
|
version: "0"
|
@@ -125,21 +151,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
151
|
requirements:
|
126
152
|
- - ">="
|
127
153
|
- !ruby/object:Gem::Version
|
128
|
-
hash: 3
|
129
154
|
segments:
|
130
155
|
- 0
|
131
156
|
version: "0"
|
132
157
|
requirements: []
|
133
158
|
|
134
|
-
rubyforge_project:
|
159
|
+
rubyforge_project: elekk
|
135
160
|
rubygems_version: 1.3.7
|
136
161
|
signing_key:
|
137
162
|
specification_version: 3
|
138
|
-
summary:
|
163
|
+
summary: Ruby interface for World of Warcraft data
|
139
164
|
test_files:
|
140
165
|
- spec/achievement_spec.rb
|
141
166
|
- spec/armory_spec.rb
|
142
167
|
- spec/character_spec.rb
|
143
168
|
- spec/klass_spec.rb
|
144
|
-
- spec/test.rb
|
145
169
|
- spec/wowhead_spec.rb
|
data/Manifest
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
CHANGELOG
|
2
|
-
Rakefile
|
3
|
-
lib/elekk.rb
|
4
|
-
lib/elekk/armory.rb
|
5
|
-
lib/elekk/character.rb
|
6
|
-
lib/elekk/data.rb
|
7
|
-
lib/elekk/http.rb
|
8
|
-
lib/elekk/wowhead.rb
|
9
|
-
readme.md
|
10
|
-
spec/armory_spec.rb
|
11
|
-
spec/character_spec.rb
|
12
|
-
spec/klass_spec.rb
|
13
|
-
spec/wowhead_spec.rb
|
14
|
-
Manifest
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.1
|
data/spec/test.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
require '../lib/elekk.rb'
|
2
|
-
|
3
|
-
@armory = Elekk::Armory.new 'Uldaman'
|
4
|
-
@feeds = @armory.get_feeds ['Fyrbard', 'Aldea', 'Alassiel', 'Ultimohombre', 'Puya', 'Wulffe', 'Silinix', 'Katalia', 'Hdarkone', 'Gleanna', 'Stormrazor', 'Gracasta']
|
5
|
-
@collated = @armory.collate_feeds @feeds
|
6
|
-
|
7
|
-
@collated.each { |k,v| puts v.first[:title]; v.each {|e| puts e[:character]}; puts }
|