tf2_line_parser 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.coverage +3 -0
- data/Gemfile.lock +21 -17
- data/lib/tf2_line_parser/events/event.rb +1 -1
- data/lib/tf2_line_parser/events/spawn.rb +20 -0
- data/lib/tf2_line_parser/line.rb +2 -0
- data/lib/tf2_line_parser/version.rb +1 -1
- data/lib/tidy_bytes_monkey_patch.rb +21 -0
- data/script/ci +1 -1
- data/spec/fixtures/logs/broder_vs_epsilon.log +4 -0
- data/spec/fixtures/logs/very_special_characters.log +1499 -0
- data/spec/lib/tf2_line_parser/parser_spec.rb +15 -4
- data/tf2_line_parser.gemspec +0 -1
- metadata +6 -17
data/.coverage
ADDED
data/Gemfile.lock
CHANGED
@@ -1,29 +1,34 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tf2_line_parser (0.0.
|
4
|
+
tf2_line_parser (0.0.6)
|
5
5
|
activesupport
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
11
|
-
i18n (~> 0.6)
|
12
|
-
|
10
|
+
activesupport (4.0.0)
|
11
|
+
i18n (~> 0.6, >= 0.6.4)
|
12
|
+
minitest (~> 4.2)
|
13
|
+
multi_json (~> 1.3)
|
14
|
+
thread_safe (~> 0.1)
|
15
|
+
tzinfo (~> 0.3.37)
|
16
|
+
atomic (1.1.10)
|
13
17
|
coderay (1.0.9)
|
14
18
|
colorize (0.5.8)
|
15
|
-
coveralls (0.6.
|
19
|
+
coveralls (0.6.7)
|
16
20
|
colorize
|
17
21
|
multi_json (~> 1.3)
|
18
22
|
rest-client
|
19
23
|
simplecov (>= 0.7)
|
20
24
|
thor
|
21
|
-
diff-lcs (1.2.
|
25
|
+
diff-lcs (1.2.4)
|
22
26
|
i18n (0.6.4)
|
23
27
|
method_source (0.8.1)
|
24
|
-
mime-types (1.
|
25
|
-
|
26
|
-
|
28
|
+
mime-types (1.23)
|
29
|
+
minitest (4.7.5)
|
30
|
+
multi_json (1.7.7)
|
31
|
+
pry (0.9.12.2)
|
27
32
|
coderay (~> 1.0.5)
|
28
33
|
method_source (~> 0.8)
|
29
34
|
slop (~> 3.4)
|
@@ -35,19 +40,19 @@ GEM
|
|
35
40
|
rspec-core (~> 2.13.0)
|
36
41
|
rspec-expectations (~> 2.13.0)
|
37
42
|
rspec-mocks (~> 2.13.0)
|
38
|
-
rspec-core (2.13.
|
43
|
+
rspec-core (2.13.1)
|
39
44
|
rspec-expectations (2.13.0)
|
40
45
|
diff-lcs (>= 1.1.3, < 2.0)
|
41
|
-
rspec-mocks (2.13.
|
46
|
+
rspec-mocks (2.13.1)
|
42
47
|
simplecov (0.7.1)
|
43
48
|
multi_json (~> 1.0)
|
44
49
|
simplecov-html (~> 0.7.1)
|
45
50
|
simplecov-html (0.7.1)
|
46
|
-
slop (3.4.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
+
slop (3.4.5)
|
52
|
+
thor (0.18.1)
|
53
|
+
thread_safe (0.1.0)
|
54
|
+
atomic
|
55
|
+
tzinfo (0.3.37)
|
51
56
|
|
52
57
|
PLATFORMS
|
53
58
|
ruby
|
@@ -56,5 +61,4 @@ DEPENDENCIES
|
|
56
61
|
coveralls
|
57
62
|
pry-nav (~> 0.2.3)
|
58
63
|
rspec (~> 2.13.0)
|
59
|
-
spec_coverage (~> 0.0.5)
|
60
64
|
tf2_line_parser!
|
@@ -40,7 +40,7 @@ module TF2LineParser
|
|
40
40
|
def self.types
|
41
41
|
#ordered by how common the messages are
|
42
42
|
@types ||= [Damage, Heal, PickupItem, Assist, Kill, CaptureBlock, PointCapture, ChargeDeployed,
|
43
|
-
MedicDeath, RoleChange, Suicide, Say, TeamSay, Domination, Revenge, RoundWin, CurrentScore,
|
43
|
+
MedicDeath, RoleChange, Spawn, Suicide, Say, TeamSay, Domination, Revenge, RoundWin, CurrentScore,
|
44
44
|
RoundLength, RoundStart, ConsoleSay, MatchEnd, FinalScore,
|
45
45
|
RoundStalemate, Unknown]
|
46
46
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module TF2LineParser
|
2
|
+
module Events
|
3
|
+
|
4
|
+
class Spawn < PlayerActionEvent
|
5
|
+
|
6
|
+
def self.action_text
|
7
|
+
@action_text ||= "spawned as"
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.regex_action
|
11
|
+
@regex_item ||= '\"(?\'player_class\'.*)\"'
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.item
|
15
|
+
:player_class
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/tf2_line_parser/line.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
module ActiveSupport
|
2
|
+
module Multibyte
|
3
|
+
module Unicode
|
4
|
+
|
5
|
+
def tidy_byte(byte)
|
6
|
+
if byte.is_a? Integer
|
7
|
+
if byte < 160
|
8
|
+
[database.cp1252[byte] || byte].pack("U").unpack("C*")
|
9
|
+
elsif byte < 192
|
10
|
+
[194, byte]
|
11
|
+
else
|
12
|
+
[195, byte - 64]
|
13
|
+
end
|
14
|
+
else
|
15
|
+
byte
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/script/ci
CHANGED
@@ -4536,4 +4536,8 @@ L 02/07/2013 - 21:56:07: "Epsilon Mitsy<12><STEAM_0:0:16858056><Red>" triggered
|
|
4536
4536
|
L 02/07/2013 - 21:56:07: "Epsilon Mitsy<12><STEAM_0:0:16858056><Red>" killed "broder bybben<10><STEAM_0:1:159631><Blue>" with "shotgun_soldier" (attacker_position "-972 -638 200") (victim_position "-833 -934 224")
|
4537
4537
|
L 02/07/2013 - 21:56:08: "Epsilon .schocky<15><STEAM_0:0:2829363><Red>" picked up item "medkit_medium"
|
4538
4538
|
L 02/07/2013 - 21:56:08: "Epsilon .schocky<15><STEAM_0:0:2829363><Red>" picked up item "ammopack_small"
|
4539
|
+
L 07/01/2013 - 15:22:46: "Imm.SPIRIT<117><STEAM_0:0:51202358><Blue>" spawned as "Medic"
|
4540
|
+
L 07/01/2013 - 15:22:46: "INF Scorpion's new acc<120><STEAM_0:0:42468138><Blue>" spawned as "Soldier"
|
4541
|
+
L 07/01/2013 - 15:22:46: "snaaw<123><STEAM_0:1:59955670><Red>" spawned as "Medic"
|
4542
|
+
L 07/01/2013 - 15:22:46: "candyyou # Infinity Gaming<124><STEAM_0:0:50979748><Red>" spawned as "Soldier"
|
4539
4543
|
L 02/07/2013 - 21:56:13: Log file closed
|