Heavy metal log parser is my try to write a ruby script.
The alpha-version is for demonstrating my programmer skills.
Write a ruby script that:
a. Receives a log as argument (webserver.log is provided)
e.g.:
./parser.rb webserver.log
b. Returns the following:
-
list of webpages with most page views ordered from most pages views to less page views e.g.:
/home 90 visits /index 80 visits etc...
-
list of webpages with most unique page views also ordered e.g.:
/about/2 8 unique views /index 5 unique views etc...
-
Clone the log_parser code
-
Then, in the log_parser directory:
$ bundle install
Basic command:
$ bin/parser analyze [PATH/TO/FILE]
Run HELP for the command delails
$ bin/parser help
parser help [COMMAND] # Describe available commands or one specific command
parser analyze [PATH/TO/FILE] # list the webpages with visits and then list the webpages with unique views
parser average_rating [PATH/TO/FILE] # list the resources with most views
parser resources_rating [PATH/TO/FILE] # list the resources with most views
parser webpages_rating [PATH/TO/FILE] # list the webpages with most page views
Run RSPEC in the log_parser directory
$ rspec
-
Improve the user interface and CLI, especially the error handling.
-
The Line class should be splitted into the LogLine and PrintLine classes.
-
The specs could be made more readable.
-
Make the app documentation.