Skip to content

Latest commit

 

History

History
107 lines (94 loc) · 2.03 KB

README.md

File metadata and controls

107 lines (94 loc) · 2.03 KB

Game Quake Log Parse

The project consist in implementation for parse log the Game Quake. Example line log register in file:

21:42 Kill: 1022 2 22: <world> killed Isgalamido by MOD_TRIGGER_HURT

Requirements

The project implemented a gem file for easy install and run parse log.

  • Ruby 2.7
  • Rspec - Lasted version

Instructions to install and run project

Installation

You need run the commands lines below in your terminal

$ gem build quake-log.gemspec

After you executed build the output should similar to:

Successfully installed quake-log-0.0.1
Parsing documentation for quake-log-0.0.1
Done installing documentation for quake-log after 0 seconds
1 gem installed

For installation you need run the command

gem install quake-log-0.0.1.gem

Now you can use lib in your terminal via irb.

Run parser direct in your terminal command

For return all information about games run command line:

$ ruby lib/main.rb

The result should similar to:

"game_1": {
"total_kills": 45,
"players": ["Dono da bola", "Isgalamido", "Zeh"],
"kills": {
  "Dono da bola": 5,
  "Isgalamido": 18,
  "Zeh": 20
  }
}...

For return specific game run command:

$ ruby lib/main.rb -g game_11

The result should similar to:

"game_11": {
"total_kills": 45,
"players": ["Dono da bola", "Isgalamido", "Zeh"],
"kills": {
  "Dono da bola": 5,
  "Isgalamido": 18,
  "Zeh": 20
  }
}...

For return specific game with reasons of killeds:

$ ruby lib/main.rb -g game_11 -k
{
  "game_11": {
    "kill_by_means": {
      "MOD_ROCKET": 37,
      "MOD_TRIGGER_HURT": 14,
      "MOD_RAILGUN": 9,
      "MOD_ROCKET_SPLASH": 60,
      "MOD_MACHINEGUN": 4,
      "MOD_SHOTGUN": 4,
      "MOD_FALLING": 3
    }
  }
}

How to run units test

Install rspec with command line:

$ gem install rspec

For execute units tests run command line:

$ cd spec/; rspec

The result should simitar to example below:

Finished in 0.00056 seconds (files took 0.03862 seconds to load)
0 examples, 0 failures