openlogcleaner 0.1.4 → 0.1.5
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/VERSION +1 -1
- data/lib/openlogcleaner/old_html_document.rb +20 -13
- metadata +5 -9
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
@@ -12,22 +12,29 @@ module OpenLogCleaner
|
|
12
12
|
|
13
13
|
def add_messages(contents)
|
14
14
|
elems = contents.at('body').elements.to_a
|
15
|
-
|
16
|
-
|
15
|
+
line = 0
|
16
|
+
begin
|
17
|
+
until elems.empty?
|
18
|
+
nick, font, br = elems.shift, elems.shift, elems.shift
|
19
|
+
line = nick.line
|
17
20
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
21
|
+
# deal with system messages, I hope!
|
22
|
+
if nick.name == 'font' and font.name == 'br'
|
23
|
+
elems.unshift br
|
24
|
+
next
|
25
|
+
end
|
23
26
|
|
24
|
-
|
25
|
-
|
27
|
+
# sanity check:
|
28
|
+
raise "Oooops. #{nick.inspect} #{font.inspect} #{br.inspect}" unless (nick.name == 'b') and (font.name == 'font') and (br.nil? or br.name == 'br')
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
nick = nick.inner_text
|
31
|
+
color = font['color']
|
32
|
+
text = font.inner_html
|
33
|
+
messages << Say.new(nick, text, color)
|
34
|
+
end
|
35
|
+
rescue Exception => e
|
36
|
+
warn "Error on line: #{line}"
|
37
|
+
raise e
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: openlogcleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jonathan Stott
|
@@ -10,8 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
14
|
-
default_executable: openlogcleaner
|
13
|
+
date: 2011-10-12 00:00:00 Z
|
15
14
|
dependencies:
|
16
15
|
- !ruby/object:Gem::Dependency
|
17
16
|
name: mustache
|
@@ -96,7 +95,6 @@ files:
|
|
96
95
|
- spec/openlogcleaner/html_document_spec.rb
|
97
96
|
- spec/openlogcleaner_spec.rb
|
98
97
|
- spec/spec_helper.rb
|
99
|
-
has_rdoc: true
|
100
98
|
homepage: http://github.com/namelessjon/openlogcleaner
|
101
99
|
licenses: []
|
102
100
|
|
@@ -120,11 +118,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
118
|
requirements: []
|
121
119
|
|
122
120
|
rubyforge_project:
|
123
|
-
rubygems_version: 1.5
|
121
|
+
rubygems_version: 1.8.5
|
124
122
|
signing_key:
|
125
123
|
specification_version: 3
|
126
124
|
summary: Cleans OpenRPG logs
|
127
|
-
test_files:
|
128
|
-
|
129
|
-
- spec/openlogcleaner_spec.rb
|
130
|
-
- spec/spec_helper.rb
|
125
|
+
test_files: []
|
126
|
+
|