tf2_line_parser 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63ba39004702334d3877c7656e29ace89831fa7fd14d476364675e894ceb0333
4
- data.tar.gz: 9e5454836fbc05685e7a428015f3772d7d1d193073d74b8c469910445660b2df
3
+ metadata.gz: 46a0f04b46043dd222fd9d5d73f2ea81969917539758a229ad9b830222d7d0fe
4
+ data.tar.gz: 734fbc7d3cccced8f84f5bddd3e06616ce1270508da008dbe259651be1d11231
5
5
  SHA512:
6
- metadata.gz: 6c9372fa0970de3e30f809605bf054eac603bb3d2115fe6718f5c5c1afdbad18f302ce08feaa3e5afe8f33ac0a180b24543f2a2d5edd641ba46978b45d3268df
7
- data.tar.gz: e4b2ef25b0756e89d3db87808c3cb91e00d4219880127fbf267e23c8cec4194908de1d4563f150b837e79197653ba835b2b282d03b1f3aee1075acde1ac774db
6
+ metadata.gz: ba4161880723e5af2a6140deb9f1eb9954b84b01dbcebebc0e21c8999342af7614250a9073cb7af76aa41cb9b509e285007f8454c6d327f16cb8cb5d27d1afce
7
+ data.tar.gz: 9e2d9c9f6f114775f5d5c9564a1b51176d1c58239d67285440fc95a388a4601e7f88c3509727e615edcb85e443b6175b4f0a394e44dea31e57860ce5387cff8e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tf2_line_parser (0.2.1)
4
+ tf2_line_parser (0.2.2)
5
5
  activesupport
6
6
 
7
7
  GEM
@@ -38,7 +38,7 @@ module TF2LineParser
38
38
  # ordered by how common the messages are
39
39
  @types ||= [Damage, Heal, PickupItem, Assist, Kill, CaptureBlock, PointCapture, ChargeDeployed,
40
40
  MedicDeath, RoleChange, Spawn, Airshot, HeadshotDamage, Suicide, Say, TeamSay, Domination, Revenge, RoundWin, CurrentScore,
41
- RoundLength, RoundStart, Connect, Disconnect, ConsoleSay, MatchEnd, FinalScore,
41
+ RoundLength, RoundStart, Connect, Disconnect, RconCommand, ConsoleSay, MatchEnd, FinalScore,
42
42
  RoundStalemate, Unknown].freeze
43
43
  end
44
44
 
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TF2LineParser
4
+ module Events
5
+ class RconCommand < Event
6
+ def self.regex
7
+ @regex ||= /#{regex_time} rcon from #{regex_rcon}/.freeze
8
+ end
9
+
10
+ def self.regex_rcon
11
+ @regex_rcon ||= '(?\'message\'.*")'
12
+ end
13
+
14
+ def self.attributes
15
+ @attributes ||= %i[time message]
16
+ end
17
+
18
+ def initialize(time, message)
19
+ @time = parse_time(time)
20
+ @message = message
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TF2LineParser
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
@@ -4541,4 +4541,5 @@ L 07/01/2013 - 15:22:46: "INF Scorpion's new acc<120><STEAM_0:0:42468138><Blue>"
4541
4541
  L 07/01/2013 - 15:22:46: "snaaw<123><STEAM_0:1:59955670><Red>" spawned as "Medic"
4542
4542
  L 07/01/2013 - 15:22:46: "candyyou # Infinity Gaming<124><STEAM_0:0:50979748><Red>" spawned as "Soldier"
4543
4543
  L 10/04/2012 - 21:25:53: "cc//TviQ<8><STEAM_0:0:8520477><Blue>" disconnected (reason "Disconnect by user.")
4544
+ L 07/03/2017 - 21:26:18: rcon from "0.0.0.0:41432": command "status"
4544
4545
  L 02/07/2013 - 21:56:13: Log file closed
@@ -381,6 +381,13 @@ module TF2LineParser
381
381
  parse(line)
382
382
  end
383
383
 
384
+ it 'recognizes rcon commands' do
385
+ line = log_lines[4543]
386
+ message = '"0.0.0.0:41432": command "status"'
387
+ expect(Events::RconCommand).to receive(:new).with(anything, message)
388
+ parse(line)
389
+ end
390
+
384
391
  it 'deals with unknown lines' do
385
392
  line = log_lines[0]
386
393
  time = '02/07/2013 - 21:21:08'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tf2_line_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arie
@@ -102,6 +102,7 @@ files:
102
102
  - lib/tf2_line_parser/events/player_action_event.rb
103
103
  - lib/tf2_line_parser/events/point_capture.rb
104
104
  - lib/tf2_line_parser/events/pvp_event.rb
105
+ - lib/tf2_line_parser/events/rcon_command.rb
105
106
  - lib/tf2_line_parser/events/revenge.rb
106
107
  - lib/tf2_line_parser/events/role_change.rb
107
108
  - lib/tf2_line_parser/events/round_event_with_variables.rb