friedmag-warcraft-armory 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog +2 -0
- data/LICENSE +20 -0
- data/README.textile +44 -0
- data/Rakefile +25 -0
- data/init.rb +2 -0
- data/lib/warcraft_armory.rb +34 -0
- data/lib/warcraft_armory/character.rb +142 -0
- data/lib/warcraft_armory/character_part.rb +41 -0
- data/lib/warcraft_armory/character_reputation.rb +66 -0
- data/lib/warcraft_armory/faction.rb +124 -0
- data/lib/warcraft_armory/faction_category.rb +22 -0
- data/lib/warcraft_armory/guild.rb +51 -0
- data/lib/warcraft_armory/guild_lite.rb +23 -0
- data/lib/warcraft_armory/guild_statistics.rb +111 -0
- data/lib/warcraft_armory_test_hacks.rb +17 -0
- data/test/assets/character.xml +114 -0
- data/test/assets/guild.xml +466 -0
- data/test/character_test.rb +57 -0
- data/test/guild_test.rb +31 -0
- data/warcraft-armory.gemspec +32 -0
- metadata +89 -0
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require "#{File.dirname(__FILE__)}/../init"
|
4
|
+
|
5
|
+
class CharacterTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@scraped_content = File.read(File.expand_path(File.dirname(__FILE__)) + '/assets/character.xml').to_s
|
9
|
+
@character = WarcraftArmory::Character.new(nil,@scraped_content)
|
10
|
+
end
|
11
|
+
|
12
|
+
def teardown
|
13
|
+
# Nothing
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_character
|
17
|
+
assert_equal @character,@character.full_character
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_character_name
|
21
|
+
assert_equal 'Crindappy', @character.name
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_character_title
|
25
|
+
assert_equal 'Crindappy the Hallowed', @character.inspect
|
26
|
+
assert_equal '%s the Hallowed', @character.current_title_format
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_character_titles
|
30
|
+
assert_equal ["%s the Explorer", "%s the Hallowed", "%s, Champion of the Naaru", "Corporal %s"],@character.title_formats
|
31
|
+
assert_equal ["Crindappy the Explorer", "Crindappy the Hallowed", "Crindappy, Champion of the Naaru", "Corporal Crindappy"],@character.titles
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_character_level
|
35
|
+
assert_equal 80, @character.level
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_character_faction
|
39
|
+
assert_equal :alliance, @character.faction
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_character_race
|
43
|
+
assert_equal :gnome, @character.race
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_character_gender
|
47
|
+
assert_equal :female, @character.gender
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_character_guild
|
51
|
+
assert_equal "Daughters OfThe Alliance",@character.guild.inspect
|
52
|
+
end
|
53
|
+
|
54
|
+
def test_character_class
|
55
|
+
assert_equal :warlock, @character.class_name
|
56
|
+
end
|
57
|
+
end
|
data/test/guild_test.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
|
3
|
+
require "#{File.dirname(__FILE__)}/../init"
|
4
|
+
|
5
|
+
class GuildTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@scraped_content = File.read(File.expand_path(File.dirname(__FILE__)) + '/assets/guild.xml').to_s
|
9
|
+
@guild = WarcraftArmory::Guild.new(nil,@scraped_content)
|
10
|
+
end
|
11
|
+
|
12
|
+
def teardown
|
13
|
+
# Nothing
|
14
|
+
end
|
15
|
+
|
16
|
+
def test_guild
|
17
|
+
assert_equal @guild,@guild.full_guild
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_guild_name
|
21
|
+
assert_equal 'Daughters OfThe Alliance', @guild.inspect
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_member_count
|
25
|
+
assert_equal 480, @guild.member_count
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_members
|
29
|
+
assert_equal 457, @guild.members.length
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{warcraft-armory}
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Andrea Nall"]
|
9
|
+
s.date = %q{2008-12-16}
|
10
|
+
s.description = %q{Retrieve character information from the World of Warcraft Armory}
|
11
|
+
s.email = %q{anall@andreanall.com}
|
12
|
+
s.extra_rdoc_files = ["lib/warcraft_armory/character.rb", "lib/warcraft_armory/character_part.rb", "lib/warcraft_armory/character_reputation.rb", "lib/warcraft_armory/guild.rb", "lib/warcraft_armory/guild_lite.rb", "lib/warcraft_armory/guild_statistics.rb", "lib/warcraft_armory.rb", "lib/warcraft_armory_test_hacks.rb", "lib/warcraft_armory/faction.rb", "lib/warcraft_armory/faction_category.rb", "LICENSE", "README.textile"]
|
13
|
+
s.files = ["Changelog", "init.rb", "lib/warcraft_armory/character.rb", "lib/warcraft_armory/character_part.rb", "lib/warcraft_armory/character_reputation.rb", "lib/warcraft_armory/guild.rb", "lib/warcraft_armory/guild_lite.rb", "lib/warcraft_armory/guild_statistics.rb", "lib/warcraft_armory.rb", "lib/warcraft_armory_test_hacks.rb", "lib/warcraft_armory/faction.rb", "lib/warcraft_armory/faction_category.rb", "LICENSE", "Rakefile", "README.textile", "test/assets/character.xml", "test/assets/guild.xml", "test/character_test.rb", "test/guild_test.rb", "warcraft-armory.gemspec"]
|
14
|
+
s.has_rdoc = true
|
15
|
+
s.homepage = %q{http://github.com/anall/warcraft-armory}
|
16
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Warcraft-armory", "--main", "README.textile"]
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.rubyforge_project = %q{warcraft-armory}
|
19
|
+
s.rubygems_version = %q{1.3.0}
|
20
|
+
s.summary = %q{Retrieve character information from the World of Warcraft Armory}
|
21
|
+
s.test_files = ["test/character_test.rb", "test/guild_test.rb"]
|
22
|
+
|
23
|
+
if s.respond_to? :specification_version then
|
24
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
25
|
+
s.specification_version = 2
|
26
|
+
|
27
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
28
|
+
else
|
29
|
+
end
|
30
|
+
else
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: friedmag-warcraft-armory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrea Nall
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-12-16 00:00:00 -08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Retrieve character information from the World of Warcraft Armory
|
17
|
+
email: anall@andreanall.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- lib/warcraft_armory/character.rb
|
24
|
+
- lib/warcraft_armory/character_part.rb
|
25
|
+
- lib/warcraft_armory/character_reputation.rb
|
26
|
+
- lib/warcraft_armory/guild.rb
|
27
|
+
- lib/warcraft_armory/guild_lite.rb
|
28
|
+
- lib/warcraft_armory/guild_statistics.rb
|
29
|
+
- lib/warcraft_armory.rb
|
30
|
+
- lib/warcraft_armory_test_hacks.rb
|
31
|
+
- lib/warcraft_armory/faction.rb
|
32
|
+
- lib/warcraft_armory/faction_category.rb
|
33
|
+
- LICENSE
|
34
|
+
- README.textile
|
35
|
+
files:
|
36
|
+
- Changelog
|
37
|
+
- init.rb
|
38
|
+
- lib/warcraft_armory/character.rb
|
39
|
+
- lib/warcraft_armory/character_part.rb
|
40
|
+
- lib/warcraft_armory/character_reputation.rb
|
41
|
+
- lib/warcraft_armory/guild.rb
|
42
|
+
- lib/warcraft_armory/guild_lite.rb
|
43
|
+
- lib/warcraft_armory/guild_statistics.rb
|
44
|
+
- lib/warcraft_armory.rb
|
45
|
+
- lib/warcraft_armory_test_hacks.rb
|
46
|
+
- lib/warcraft_armory/faction.rb
|
47
|
+
- lib/warcraft_armory/faction_category.rb
|
48
|
+
- LICENSE
|
49
|
+
- Rakefile
|
50
|
+
- README.textile
|
51
|
+
- test/assets/character.xml
|
52
|
+
- test/assets/guild.xml
|
53
|
+
- test/character_test.rb
|
54
|
+
- test/guild_test.rb
|
55
|
+
- warcraft-armory.gemspec
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/anall/warcraft-armory
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --line-numbers
|
61
|
+
- --inline-source
|
62
|
+
- --title
|
63
|
+
- Warcraft-armory
|
64
|
+
- --main
|
65
|
+
- README.textile
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: "0"
|
73
|
+
version:
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "1.2"
|
79
|
+
version:
|
80
|
+
requirements: []
|
81
|
+
|
82
|
+
rubyforge_project: warcraft-armory
|
83
|
+
rubygems_version: 1.2.0
|
84
|
+
signing_key:
|
85
|
+
specification_version: 2
|
86
|
+
summary: Retrieve character information from the World of Warcraft Armory
|
87
|
+
test_files:
|
88
|
+
- test/character_test.rb
|
89
|
+
- test/guild_test.rb
|