ffxiv-lodestone 0.9.7 → 0.9.8
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/HISTORY +4 -0
- data/lib/ffxiv-lodestone.rb +8 -8
- metadata +4 -4
data/HISTORY
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
== 0.9.8 ==
|
2
|
+
* Updated for the new Lodestone character page rolled out yesterday. Note that the tests DO NOT pass
|
3
|
+
at this time; I'll get around to unfucking that sooner or later.
|
4
|
+
|
1
5
|
== 0.9.7 ==
|
2
6
|
* 'Shield' has now been aliased to 'sentinel' for char#jobs(). Please be aware that the shield
|
3
7
|
key will no longer show up in a json'd character's job list - it will be sentinel instead.
|
data/lib/ffxiv-lodestone.rb
CHANGED
@@ -21,7 +21,7 @@ end
|
|
21
21
|
|
22
22
|
module FFXIVLodestone
|
23
23
|
# Gem version.
|
24
|
-
VERSION = '0.9.
|
24
|
+
VERSION = '0.9.8'
|
25
25
|
|
26
26
|
# Accept-language must be sent; their default is Japanese text.
|
27
27
|
HTTP_OPTIONS = {'Accept-Language' => 'en-us,en;q=0.5', 'Accept-Charset' => 'utf-8;q=0.5',
|
@@ -87,7 +87,7 @@ module FFXIVLodestone
|
|
87
87
|
class StatList < Hash
|
88
88
|
def initialize(table)
|
89
89
|
table.search('tr').each do |tr|
|
90
|
-
self[tr.children[0].content.strip.downcase.to_sym] = tr.children[
|
90
|
+
self[tr.children[0].content.strip.downcase.to_sym] = tr.children[1].content.strip_nbsp.split(' ')[0].to_i
|
91
91
|
end
|
92
92
|
end
|
93
93
|
|
@@ -119,7 +119,7 @@ module FFXIVLodestone
|
|
119
119
|
@skills = {}
|
120
120
|
|
121
121
|
skill_table.children.each do |skill|
|
122
|
-
name = skill.children[0].
|
122
|
+
name = skill.children[0].content
|
123
123
|
if FFXIVLodestone::SKILL_TO_CLASS.key? name
|
124
124
|
key = FFXIVLodestone::SKILL_TO_CLASS[name]
|
125
125
|
job = key.to_s.capitalize
|
@@ -129,11 +129,11 @@ module FFXIVLodestone
|
|
129
129
|
end
|
130
130
|
|
131
131
|
# '-' = not leveled (never equipped the class' weapon)
|
132
|
-
rank = skill.children[
|
132
|
+
rank = skill.children[1].search('table tr td[last()]').children.first.content
|
133
133
|
rank = (rank.include?('-') ? 0 : rank.to_i)
|
134
134
|
|
135
135
|
# # '-' = not leveled, otherwise it will be in the format '391 / 1500'
|
136
|
-
sp = skill.children[
|
136
|
+
sp = skill.children[2].search('table tr td[last()]').children.first.content
|
137
137
|
|
138
138
|
if sp.include? '-'
|
139
139
|
current_sp = 0
|
@@ -188,15 +188,15 @@ module FFXIVLodestone
|
|
188
188
|
|
189
189
|
# The skills table doesn't have a unqiue ID or class to find it by, so take the first skill lable and go up two elements (table -> tr -> th.mianskill-lable)
|
190
190
|
@skills = SkillList.new(doc.search('th.mainskill-label').first.parent.parent)
|
191
|
-
@stats = StatList.new(doc.search("div.contents-subheader[contains('Attributes')]").first.next_sibling
|
192
|
-
@resistances = StatList.new(doc.search("div.contents-subheader[contains('Elements')]").first.next_sibling
|
191
|
+
@stats = StatList.new(doc.search("div.contents-subheader[contains('Attributes')]").first.next_sibling)
|
192
|
+
@resistances = StatList.new(doc.search("div.contents-subheader[contains('Elements')]").first.next_sibling)
|
193
193
|
|
194
194
|
# The character info box at the top ... actually has a useful ID!
|
195
195
|
@profile = {}
|
196
196
|
profile = doc.search("//div[starts-with(@id,'profile-plate')]")
|
197
197
|
profile.search('tr th').each do |th|
|
198
198
|
key = th.content.strip.downcase.gsub(':','').gsub(' ','_').to_sym
|
199
|
-
value = th.next_sibling.
|
199
|
+
value = th.next_sibling.content.strip_nbsp
|
200
200
|
|
201
201
|
# HP/MP/TP are max values. They depend on the currently equipped job and are not very
|
202
202
|
# meaningful pieces of data. XP will be handled seperately.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffxiv-lodestone
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 43
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
|
-
-
|
10
|
-
version: 0.9.
|
9
|
+
- 8
|
10
|
+
version: 0.9.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- owlmanatt
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-01 00:00:00 +00:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|