log-analyser 0.1.3.pre.documentation.20201108184713 → 0.1.3.pre.documentation.20201108192110

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e37f374a61508be8ed7cf40a9cea997d1726eef0a5751cf26f99d1a8652de396
4
- data.tar.gz: 5d466d1e94319b45d24f0980c04583c80e93a7d7abe06e42ef522e2ae4cd6a02
3
+ metadata.gz: c2b9b98f46b7ffd52716e53e4b069bfa6d1a01186bfe24bd5e6d9136fc9b79af
4
+ data.tar.gz: 67c01dedd6e66dc077d6e852f64c5270573cdd6c579aeda09326f881845dc61f
5
5
  SHA512:
6
- metadata.gz: 9fe9ca653e989b8dfa52d27958f069343e9cad29fffc97bcf6a19a49aa2e45da8a6892bc29c9139f3360c81acb59b488c957ce412a4d495bb26f4557e308bcd2
7
- data.tar.gz: d7501783412b7916e185b40f21cfca58ead4fa33f5e1d2a5c7c871975e5512bd1204755e751bf542bc06e187f352e653e984d746a1856a7eec7c1369ee47018b
6
+ metadata.gz: a60d02c6be8493405b7bcd36c7b1bdcffb8a3f24f5432411fbacb707ccc4d0c59f44797d64fa1f553ab48b13ee9c3f750d8ec4c1a06b3a910db65c7ad71638ee
7
+ data.tar.gz: b56ec12bf9e52a256498c9573bfceb0eefe40404131536a5ce37514f92ef2840a269df5aad120230aa9a9539c14239419d07a8cba6b35dcdf26621a319bf4f5f
data/CHANGELOG CHANGED
@@ -1 +1,7 @@
1
- v0.1.1. adding gemspec/echoe/
1
+ v0.1.3. completing documentation
2
+
3
+ v0.1.2b.
4
+
5
+ v0.1.2.
6
+
7
+ v0.1.1. adding gemspec/echoe/
data/README.md CHANGED
@@ -169,10 +169,13 @@ Status and coverage history can be checked [here](https://coveralls.io/github/DM
169
169
 
170
170
  #### Deployment
171
171
 
172
- After passing all checks and requirements on github, a *PR* can be merged after review and approval.
173
- The _*master branch*_ merge process will trigger the deployment process on CircleCI.
172
+ Following the creation of a _*Pull Request*_ a CI workflow is triggered in CircleCI, that can be checked [here](https://app.circleci.com/pipelines/github/DMazzei/log-analyser).</br>
173
+ This workflow consist in _building_ the library; Running _rubocop_ and _rspec_ to validate integrity and code quality; And lastly generating and pushing a _feature-gem_ that can be used for development and tests.
174
174
 
175
- The deployment process will build and tag a new gem version and push it to [rubygems.org](https://rubygems.org/gems/log-analyser).
175
+ After passing all checks and requirements on github, a *PR* can be merged as soon as it is reviewed and approved.
176
+ The _*master branch*_ merge process will trigger the deployment process on CircleCI, and this workflow ends with the generation of a _*tagged-gem*_.
177
+
178
+ The whole deployment process will finish by building and tagging a new gem version and pushing it to [rubygems.org](https://rubygems.org/gems/log-analyser).
176
179
 
177
180
  > :warning: In order to merge changes into _*master branch*_, the version must be bumped up, otherwise the deployment will fail.</br>
178
181
  > The version must be updated in `version.rb`.
@@ -1,19 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Pageviews
4
- InvalidLogEntriesError = Class.new(StandardError)
3
+ module LogAnalyser
4
+ class Pageviews
5
+ InvalidLogEntriesError = Class.new(StandardError)
5
6
 
6
- def self.for(entries = {})
7
- new.generate_view_count(entries)
8
- rescue StandardError
9
- raise InvalidLogEntriesError
10
- end
7
+ def self.for(entries = {})
8
+ new.generate_view_count(entries)
9
+ rescue StandardError
10
+ raise InvalidLogEntriesError
11
+ end
11
12
 
12
- def generate_view_count(entries)
13
- entries
14
- .transform_values(&:size)
15
- .sort_by(&:last)
16
- .reverse
17
- .to_h
13
+ def generate_view_count(entries)
14
+ entries
15
+ .transform_values(&:size)
16
+ .sort_by(&:last)
17
+ .reverse
18
+ .to_h
19
+ end
18
20
  end
19
21
  end
@@ -4,24 +4,26 @@ require_relative 'parser'
4
4
  require_relative 'pageviews'
5
5
  require_relative 'unique_pageviews'
6
6
 
7
- class PageviewsLogAggregator
8
- def initialize(file_path)
9
- @file_path = file_path
10
- end
7
+ module LogAnalyser
8
+ class PageviewsLogAggregator
9
+ def initialize(file_path)
10
+ @file_path = file_path
11
+ end
11
12
 
12
- def all
13
- Pageviews.for(entries)
14
- end
13
+ def all
14
+ Pageviews.for(entries)
15
+ end
15
16
 
16
- def unique
17
- UniquePageviews.for(entries)
18
- end
17
+ def unique
18
+ UniquePageviews.for(entries)
19
+ end
19
20
 
20
- private
21
+ private
21
22
 
22
- attr_accessor :file_path
23
+ attr_accessor :file_path
23
24
 
24
- def entries
25
- @entries ||= Parser.call(file_path)
25
+ def entries
26
+ @entries ||= Parser.call(file_path)
27
+ end
26
28
  end
27
29
  end
@@ -1,33 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Parser
4
- class FileNotFoundError < StandardError
5
- def initialize(path)
6
- super("File not found for path: [#{path}]")
3
+ module LogAnalyser
4
+ class Parser
5
+ class FileNotFoundError < StandardError
6
+ def initialize(path)
7
+ super("File not found for path: [#{path}]")
8
+ end
7
9
  end
8
- end
9
10
 
10
- def self.call(file_path)
11
- new.call(file_path)
12
- end
11
+ def self.call(file_path)
12
+ new.call(file_path)
13
+ end
13
14
 
14
- def call(file_path)
15
- raise FileNotFoundError, file_path unless File.exist?(file_path)
15
+ def call(file_path)
16
+ raise FileNotFoundError, file_path unless File.exist?(file_path)
16
17
 
17
- data = File.open(file_path).map(&:strip)
18
- data.reject!(&:empty?)
19
- parse(data)
20
- end
18
+ data = File.open(file_path).map(&:strip)
19
+ data.reject!(&:empty?)
20
+ parse(data)
21
+ end
21
22
 
22
- private
23
+ private
23
24
 
24
- def parse(data)
25
- entries = Hash.new { |h, k| h[k] = [] }
26
- data.each do |entry|
27
- key, value = *entry.split(/\s+/)
28
- entries[key] << value
29
- end
25
+ def parse(data)
26
+ entries = Hash.new { |h, k| h[k] = [] }
27
+ data.each do |entry|
28
+ key, value = *entry.split(/\s+/)
29
+ entries[key] << value
30
+ end
30
31
 
31
- entries
32
+ entries
33
+ end
32
34
  end
33
35
  end
@@ -1,10 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class UniquePageviews < Pageviews
4
- def generate_view_count(entries)
5
- entries.transform_values { |value| value.uniq.size }
6
- .sort_by(&:last)
7
- .reverse
8
- .to_h
3
+ module LogAnalyser
4
+ class UniquePageviews < Pageviews
5
+ def generate_view_count(entries)
6
+ entries.transform_values { |value| value.uniq.size }
7
+ .sort_by(&:last)
8
+ .reverse
9
+ .to_h
10
+ end
9
11
  end
10
12
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log-analyser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.pre.documentation.20201108184713
4
+ version: 0.1.3.pre.documentation.20201108192110
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Mazzei
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
@@ -15,9 +15,11 @@ email:
15
15
  - danielmazzei@gmail.com
16
16
  executables: []
17
17
  extensions: []
18
- extra_rdoc_files: []
18
+ extra_rdoc_files:
19
+ - CHANGELOG
20
+ - LICENSE.txt
21
+ - README.md
19
22
  files:
20
- - ".ruby-version"
21
23
  - CHANGELOG
22
24
  - LICENSE.txt
23
25
  - README.md
@@ -25,15 +27,24 @@ files:
25
27
  - lib/pageviews_log_aggregator.rb
26
28
  - lib/parser.rb
27
29
  - lib/unique_pageviews.rb
28
- - log-analyser.gemspec
29
- - version.rb
30
30
  homepage: https://github.com/DMazzei/log-analyser
31
31
  licenses:
32
32
  - MIT
33
33
  metadata:
34
34
  homepage_uri: https://github.com/DMazzei/log-analyser
35
+ source_code_uri: https://github.com/DMazzei/log-analyser
36
+ changelog_uri: https://github.com/DMazzei/log-analyser/blob/master/CHANGELOG
37
+ bug_tracker_uri: https://github.com/DMazzei/log-analyser/issues
38
+ documentation_uri: https://www.rubydoc.info/gems/log-analyser
35
39
  post_install_message:
36
- rdoc_options: []
40
+ rdoc_options:
41
+ - "--title"
42
+ - Emoticon - emotions in terminal
43
+ - "--main"
44
+ - README.md
45
+ - "--line-numbers"
46
+ - "--inline-source"
47
+ - "--quiet"
37
48
  require_paths:
38
49
  - lib
39
50
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -1 +0,0 @@
1
- 2.7.1
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'log-analyser'
7
- spec.version = VERSION
8
- spec.authors = ['Dan Mazzei']
9
- spec.email = ['danielmazzei@gmail.com']
10
-
11
- spec.summary = 'Log reader and data aggregator for pageviews information.'
12
- spec.description = 'Log reader and data aggregator for pageviews information.'
13
- spec.homepage = 'https://github.com/DMazzei/log-analyser'
14
- spec.license = 'MIT'
15
- spec.required_ruby_version = Gem::Requirement.new('>= 2.7')
16
-
17
- # spec.metadata['allowed_push_host'] = "'TODO: Set to 'http://mygemserver.com''"
18
-
19
- spec.metadata['homepage_uri'] = spec.homepage
20
- # spec.metadata['source_code_uri'] = "'TODO: Put your gem's public repo URL here.'"
21
- # spec.metadata['changelog_uri'] = "'TODO: Put your gem's CHANGELOG.md URL here.'"
22
-
23
- # Specify which files should be added to the gem when it is released.
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 LICENSE.txt README.md lib/pageviews.rb lib/pageviews_log_aggregator.rb lib/parser.rb lib/unique_pageviews.rb log-analyser.gemspec version.rb)
26
- spec.bindir = 'exe'
27
- spec.executables = spec.files.grep(/^exe\//) { |f| File.basename(f) }
28
- spec.require_paths = ['lib']
29
- end
data/version.rb DELETED
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- VERSION = '0.1.3'