log-analyser 0.1.1.pre.test.20201106194135 → 0.1.1.pre.v012b.20201107191751

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +116 -16
  3. data/Rakefile +8 -3
  4. data/log-analyser.gemspec +1 -1
  5. metadata +6 -8
  6. data/Gemfile.lock +0 -117
  7. data/Manifest +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6912b36d30f208b346179fcf9513486d1327a7f1c80ce3bbc761ac52662fceff
4
- data.tar.gz: f68d64ad5f087c3af8db3fb90fc6bcfa16ddf3a68a8d03790bfd22fc4f2a70e6
3
+ metadata.gz: 67344c9fd999cac581f41656f12107812b2d5477d6583e50f37224317ef39201
4
+ data.tar.gz: 2bafa5474f4604f766c6e99eaef1539bfc2c60f13c06c783f2a62070af39bed9
5
5
  SHA512:
6
- metadata.gz: 5416de8c283c39a961749b7a26d9f2b3494aad29041b5a2d22846a557082a46f64521be753655a70acb213ca3c5eba3f140327bb88817308e5c2bf9f87818277
7
- data.tar.gz: c4a40bd86969b4c9898b85333398421a0cec1071e080c16300ca370d2f51c451c8feb6a248ad946bfd279f0ffa8c634250400ab7bf7dd7d30e9e39e7a7b97027
6
+ metadata.gz: 21b998c5eb5e2d07c8e8a0374cd34b0321efd447d968c4086797e587f8976c0e4db2e2cc25d1985acc03eee82e958b5a29a41a0529b7d3a55305fe4949b312c8
7
+ data.tar.gz: b0491a46ef1b578487c9d8e5d52eb41d7ec033b5c42ead9c12b6914bae481d337f3b02f1f2f623fa185d8f9ecee71e491e8cd27cbe78e417d024bfb333151c6d
data/README.md CHANGED
@@ -1,51 +1,151 @@
1
1
  [![Coverage Status](https://coveralls.io/repos/github/DMazzei/log-analyser/badge.svg?branch=master)](https://coveralls.io/github/DMazzei/log-analyser?branch=master)
2
+ [![Gem Version](https://badge.fury.io/rb/log-analyser.svg)](https://badge.fury.io/rb/log-analyser)
3
+ [![Circle CI](https://circleci.com/gh/DMazzei/log-analyser.svg?style=shield)](https://app.circleci.com/pipelines/github/DMazzei/log-analyser)
4
+ ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/dmazzei/log-analyser)
5
+ ![Gem](https://img.shields.io/gem/dv/log-analyser/stable)
6
+
7
+ # Log-Analyser
2
8
 
9
+ ## About
3
10
 
11
+ Simple ruby library to read and parse web-server's log files and aggregate pageview data.
4
12
 
5
- ```
6
- A pageview is defined as a view of a page on your site that is being tracked by the Analytics tracking code. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a user navigates to a different page and then returns to the original page, a second pageview is recorded as well.
13
+ ### TL;DR
14
+ <details>
15
+ <summary>check minimal instructions</summary>
7
16
 
8
- A unique pageview, as seen in the Content Overview report, aggregates pageviews that are generated by the same user during the same session. A unique pageview represents the number of sessions during which that page was viewed one or more times.
9
- ```
17
+ Install *log-analyser* gem.
18
+ After instantiating *log-analyser's* `PageviewsLogAggregator` class with the path to the logfile:
19
+ </br>- the method `all` will return the pageview count
20
+ </br>- whilst method `unique` will return the unique pageview count.
10
21
 
22
+ </details>
11
23
 
12
- # Log::Analyser
24
+ ### Table of Contents
25
+ <details>
26
+ <summary>click to expand the index</summary>
13
27
 
14
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/log/analyser`. To experiment with that code, run `bin/console` for an interactive prompt.
28
+ - [Installation](#installation)
29
+ - [Usage](#usage)
30
+ - [Logs and Pageviews](#logs-and-pageviews)
31
+ * [Definitions](#definitions)
32
+ * [Log Formatting](#log-formatting)
33
+ - [Development](#development)
34
+ - [Contributing](#contributing)
35
+ - [Next Steps](#next-steps)
36
+ - [License](#license)
37
+
15
38
 
16
- TODO: Delete this and the text above, and describe your gem
39
+ </details>
17
40
 
18
41
  ## Installation
19
42
 
20
- Add this line to your application's Gemfile:
43
+ To use *log-analyser* in your application, add this line to your Gemfile:
21
44
 
22
45
  ```ruby
23
46
  gem 'log-analyser'
24
47
  ```
25
48
 
26
- And then execute:
27
-
28
- $ bundle install
29
-
30
49
  Or install it yourself as:
31
50
 
32
51
  $ gem install log-analyser
33
52
 
34
53
  ## Usage
35
54
 
36
- TODO: Write usage instructions here
55
+ ```
56
+ ...
57
+ ...
58
+ ...
59
+ ...
60
+ ...
61
+ ```
62
+
63
+ ## Logs and Pageviews
64
+
65
+ ### Definitions
66
+ ```
67
+ A pageview is defined as a view of a page on your site that is being tracked by the Analytics tracking code.
68
+ If a user clicks reload after reaching the page, this is counted as an additional pageview.
69
+ If a user navigates to a different page and then returns to the original page, a second pageview is recorded as well.
70
+
71
+ A unique pageview, as seen in the Content Overview report, aggregates pageviews that are generated by the same
72
+ user during the same session. A unique pageview represents the number of sessions during which that page was
73
+ viewed one or more times.
74
+ ```
75
+
76
+ ### Log Formatting
77
+
78
+ The library is prepared to parser text files, containing one entry per line, in the format: `\page_name identifier`.
79
+
80
+ A space must separate the page name (first column) from the user identifier (e.g. IP address):
81
+
82
+ ```
83
+ /help_page/1 126.318.035.038
84
+ /contact 184.123.665.067
85
+ /home 184.123.665.067
86
+ ```
37
87
 
38
88
  ## Development
39
89
 
40
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
90
+ #### Start with the project:
91
+
92
+ Install the Ruby version specified in `.ruby-version` </br>
93
+ Clone the project and install Bundler
94
+
95
+ ```
96
+ git clone git@github.com:DMazzei/log-analyser.git
97
+ cd log-analyser
98
+ gem install bundler
99
+ ```
100
+
101
+ #### Setup:
102
+
103
+ Run the initial setup
104
+
105
+ $ bin/setup
106
+
107
+ > If you need to reinstall dependencies or something alike:
108
+ > ```
109
+ > $ bundle install
110
+ > ```
111
+
112
+
113
+ You can also run `Bundle exec console` for an interactive prompt that will allow you to experiment.
114
+
115
+ To install this gem onto your local machine, run `bundle exec rake install`.
116
+ To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
117
+
118
+ #### Linter (rubocop)
119
+
120
+ _*Rubocop*_ is used as code analyser and maintain code formatting (as well as some best practices).
121
+
122
+ Use `Bundle exec rake rubocop` to run the checks.
123
+
124
+ #### Test coverage
125
+
126
+ Use `Bundle exec rake rspec` to run the tests.
127
+
128
+ The test coverage is handled by `rspec`, `simplecov` and `coveralls`.
129
+ Status and coverage history can be checked [here](https://coveralls.io/github/DMazzei/log-analyser).
130
+
131
+ #### Deployment
132
+
133
+ After passing all checks and requirements on github, a *PR* can be merged after review and approval.
134
+ The _*master branch*_ merge process will trigger the deployment process on CircleCI.
135
+
136
+ The deployment process will build and tag a new gem version and push it to [rubygems.org](https://rubygems.org/gems/log-analyser).
41
137
 
42
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
43
138
 
44
139
  ## Contributing
45
140
 
46
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/log-analyser.
141
+ Bug reports and pull requests are welcome on GitHub at https://github.com/DMazzeig/log-analyser.
142
+
143
+ ## Next Steps
47
144
 
145
+ - Extend the logfile formatting;
48
146
 
49
147
  ## License
50
148
 
51
149
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
150
+
151
+
data/Rakefile CHANGED
@@ -1,11 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/setup'
4
- require 'rubygems'
5
- require 'rspec/core/rake_task'
3
+ begin
4
+ require 'bundler/setup'
5
+ rescue LoadError
6
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
+ end
6
8
 
7
9
  Bundler::GemHelper.install_tasks
8
10
 
11
+ require 'rubygems'
12
+ require 'rspec/core/rake_task'
13
+
9
14
  RSpec::Core::RakeTask.new(:spec)
10
15
 
11
16
  task default: :spec
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = %w(.ruby-version CHANGELOG Gemfile Gemfile.lock Guardfile LICENSE.txt Manifest README.md Rakefile bin/setup config/environment.rb lib/pageviews.rb lib/pageviews_log_aggregator.rb lib/parser.rb lib/unique_pageviews.rb log-analyser.gemspec version.rb)
25
+ spec.files = %w(.ruby-version CHANGELOG Gemfile Guardfile LICENSE.txt README.md Rakefile bin/setup config/environment.rb lib/pageviews.rb lib/pageviews_log_aggregator.rb lib/parser.rb lib/unique_pageviews.rb log-analyser.gemspec version.rb)
26
26
  spec.bindir = 'exe'
27
27
  spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
28
28
  spec.require_paths = ['lib']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log-analyser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.pre.test.20201106194135
4
+ version: 0.1.1.pre.v012b.20201107191751
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mazzei
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-06 00:00:00.000000000 Z
11
+ date: 2020-11-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Log reader and data aggregator for pageviews information.
14
14
  email:
@@ -20,10 +20,8 @@ files:
20
20
  - ".ruby-version"
21
21
  - CHANGELOG
22
22
  - Gemfile
23
- - Gemfile.lock
24
23
  - Guardfile
25
24
  - LICENSE.txt
26
- - Manifest
27
25
  - README.md
28
26
  - Rakefile
29
27
  - bin/setup
@@ -39,7 +37,7 @@ licenses:
39
37
  - MIT
40
38
  metadata:
41
39
  homepage_uri: https://github.com/DMazzei/log-analyser
42
- post_install_message:
40
+ post_install_message:
43
41
  rdoc_options: []
44
42
  require_paths:
45
43
  - lib
@@ -54,8 +52,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
52
  - !ruby/object:Gem::Version
55
53
  version: 1.3.1
56
54
  requirements: []
57
- rubygems_version: 3.1.2
58
- signing_key:
55
+ rubygems_version: 3.1.4
56
+ signing_key:
59
57
  specification_version: 4
60
58
  summary: Log reader and data aggregator for pageviews information.
61
59
  test_files: []
@@ -1,117 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- log-analyser (0.1.1)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.1)
10
- coderay (1.1.3)
11
- coveralls_reborn (0.18.0)
12
- simplecov (>= 0.18.1, < 0.20.0)
13
- term-ansicolor (~> 1.6)
14
- thor (>= 0.20.3, < 2.0)
15
- tins (~> 1.16)
16
- diff-lcs (1.4.4)
17
- docile (1.3.2)
18
- ffi (1.13.1)
19
- formatador (0.2.5)
20
- guard (2.16.2)
21
- formatador (>= 0.2.4)
22
- listen (>= 2.7, < 4.0)
23
- lumberjack (>= 1.0.12, < 2.0)
24
- nenv (~> 0.1)
25
- notiffany (~> 0.0)
26
- pry (>= 0.9.12)
27
- shellany (~> 0.0)
28
- thor (>= 0.18.1)
29
- guard-compat (1.2.1)
30
- guard-rspec (4.7.3)
31
- guard (~> 2.1)
32
- guard-compat (~> 1.1)
33
- rspec (>= 2.99.0, < 4.0)
34
- listen (3.2.1)
35
- rb-fsevent (~> 0.10, >= 0.10.3)
36
- rb-inotify (~> 0.9, >= 0.9.10)
37
- lumberjack (1.2.8)
38
- method_source (1.0.0)
39
- nenv (0.3.0)
40
- notiffany (0.1.3)
41
- nenv (~> 0.1)
42
- shellany (~> 0.0)
43
- parallel (1.19.2)
44
- parser (2.7.2.0)
45
- ast (~> 2.4.1)
46
- pry (0.13.1)
47
- coderay (~> 1.1)
48
- method_source (~> 1.0)
49
- rainbow (3.0.0)
50
- rake (12.3.3)
51
- rb-fsevent (0.10.4)
52
- rb-inotify (0.10.1)
53
- ffi (~> 1.0)
54
- regexp_parser (1.8.2)
55
- require_all (3.0.0)
56
- rexml (3.2.4)
57
- rspec (3.10.0)
58
- rspec-core (~> 3.10.0)
59
- rspec-expectations (~> 3.10.0)
60
- rspec-mocks (~> 3.10.0)
61
- rspec-core (3.10.0)
62
- rspec-support (~> 3.10.0)
63
- rspec-expectations (3.10.0)
64
- diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.10.0)
66
- rspec-mocks (3.10.0)
67
- diff-lcs (>= 1.2.0, < 2.0)
68
- rspec-support (~> 3.10.0)
69
- rspec-support (3.10.0)
70
- rspec_junit_formatter (0.4.1)
71
- rspec-core (>= 2, < 4, != 2.12.0)
72
- rubocop (1.2.0)
73
- parallel (~> 1.10)
74
- parser (>= 2.7.1.5)
75
- rainbow (>= 2.2.2, < 4.0)
76
- regexp_parser (>= 1.8)
77
- rexml
78
- rubocop-ast (>= 1.0.1)
79
- ruby-progressbar (~> 1.7)
80
- unicode-display_width (>= 1.4.0, < 2.0)
81
- rubocop-ast (1.1.1)
82
- parser (>= 2.7.1.5)
83
- ruby-progressbar (1.10.1)
84
- shellany (0.0.1)
85
- simplecov (0.19.1)
86
- docile (~> 1.1)
87
- simplecov-html (~> 0.11)
88
- simplecov-html (0.12.3)
89
- simplecov-lcov (0.8.0)
90
- sync (0.5.0)
91
- term-ansicolor (1.7.1)
92
- tins (~> 1.0)
93
- thor (1.0.1)
94
- tins (1.26.0)
95
- sync
96
- unicode-display_width (1.7.0)
97
-
98
- PLATFORMS
99
- ruby
100
-
101
- DEPENDENCIES
102
- bundler
103
- coveralls_reborn (~> 0.18.0)
104
- guard
105
- guard-rspec
106
- log-analyser!
107
- pry
108
- rake (~> 12.0)
109
- require_all
110
- rspec (~> 3.8)
111
- rspec_junit_formatter
112
- rubocop
113
- simplecov
114
- simplecov-lcov
115
-
116
- BUNDLED WITH
117
- 2.1.4
data/Manifest DELETED
File without changes