Simple Ruby Log Parser which can display which path was visited the most - either total or unique count.
Run the parser with the provided example log file via:
./bin/parser.rb webserver.log
This will by default count total number of visits. To see the unique count change the mode
argument:
./bin/parser.rb webserver.log --mode=unique
Install docker and docker-compose and ruby (see the version in .ruby-version
file) on your machine:
Consult the official docs for step-by-step instructions
Clone the repository:
git clone <repo> sp-ruby-test
cd sp-ruby-test
Copy the .env.sample
file and follow the instructions inside it:
cp .env.sample .env
[open .env in file editor and follow instructions inside it]
Run setup script:
bin/setup
If everything went well run the shell:
bin/dc
Add bin/
directory to your PATH using .git/safe trick.
With it you will be able to run dc
script directly instead of typing bin/dc
.
Use bin/dc
to run commands in the container (eliminates the need to type docker-compose run --rm app [command]
).
You can even add the bin/dc
script to your local editor settings!
For example for vim-test
to work correctly, add to your .vimrc.local
file:
let test#ruby#rspec#executable = 'bin/dc rspec'
Usage examples (using .git/safe trick
from above):
dc bundle install
dc rspec
dc ash # instead of bash, which is unavailable