A small library for analyzing log files.
bundle exec bin/setup
ruby bin/parse file_path
You can decide which of analyze you want to run by passing optional argument to script like this:
ruby bin/parse file_path optional_argument
Field | Type | Description |
---|---|---|
file_path | String | Path to a file to be analysed |
optional_argument | String | It is a analyze type, by defaut set to 'all', other options are: 'views' and 'uniq_views' |
You can run example on your own following these steps:
- Clone repository
- Open repository directory
- Execute
ruby bin/setup
- Get a path to real data or to test data on your local machine and use it as a path_file in a script below:
ruby bin/parse file_path
For data:
/test_page_1/1 111.222.333.444
/test_page_1/1 999.888.777.666
/test_page_2 999.888.777.666
/test_page_2 999.888.777.666
/test_page_2 111.222.333.444
Result looks like this:
----- Statistics for visits ----
/test_page_2 - 3 visits
/test_page_1/1 - 2 visits
----- Statistics for unique visits ----
/test_page_2 - 2 unique visits
/test_page_1/1 - 2 unique visits
ruby bin/console
rubocop
add -a
if you want autocorrection
bundle exec rspec
To see test coverage after running specs go to coverage/index.html