log_analysis 0.1.2 → 0.1.3

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: 3229e7a8ab9b83925c34270e0e4de8ccec44f62ca94d7c29d1cafe14c1d6adf9
4
- data.tar.gz: 9a0c94678156f7dc429d972ecb8f038fe86cd720a7df76963a1ded5abdbd8bf6
3
+ metadata.gz: 4da3bc937c35f605da6c99b694104dab09af74be0f373a2537c990923e1c9bcb
4
+ data.tar.gz: b9ab4de5844da665fd5ac587c0404530971113208c82847f5b3130ad02d26764
5
5
  SHA512:
6
- metadata.gz: 69adb8ae6e8b12a239b4af81c3b5dd3e17bac46304811ebb3afaa78eba5dedd51120aaa5d371bd400e3237dc14d2c49c4a8b7297cffa06ca453e767be29f3da9
7
- data.tar.gz: d0f4459fdfb8416b2c621f54929d397f02e41fdeebdae29d95d5933a4e1db6b28f44701467c7488bc52197c8e2d9cc9b9d7bcd36d2a065bf031669af39d3f1ac
6
+ metadata.gz: d477e49633b472c87f065317a107ab8423a3f0d2f6f7549bb3a35b36f4780f8a17bf58b58589fe0397329abc3e9a1181dd8bd099d0972808a3306be24fa7d7b6
7
+ data.tar.gz: cc4756d9bc8ed7199b9f9f1e67d3a0245dd7e2d511fe82b517eff5f0cc00bce89a84b7bd76842eeebd2ad3a354c0279e437dfee8e4973f3d29a66c194449e649
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- log_analysis (0.1.2)
4
+ log_analysis (0.1.3)
5
5
  activesupport (~> 6.0.3.1)
6
6
  useragent (~> 0.16.10)
7
7
 
@@ -17,7 +17,7 @@ GEM
17
17
  concurrent-ruby (1.1.6)
18
18
  i18n (1.8.3)
19
19
  concurrent-ruby (~> 1.0)
20
- minitest (5.13.0)
20
+ minitest (5.14.1)
21
21
  rake (12.3.1)
22
22
  thread_safe (0.3.6)
23
23
  tzinfo (1.2.7)
@@ -15,7 +15,13 @@ class LogAnalysis
15
15
  def initialize(path, type = nil)
16
16
  @path = path
17
17
  @type = type
18
- @cleaned_data = PreProcess.input(path, type)
18
+ @cleaned_data = PreProcess.input(path, type) do |record|
19
+ if block_given?
20
+ yield(record) ? record : nil
21
+ else
22
+ record
23
+ end
24
+ end
19
25
  end
20
26
 
21
27
  def identified_user
@@ -19,6 +19,7 @@ module PreProcess
19
19
  preprocessed_log = type.nil? ? line.gsub(/[\t]/i, ' ').chomp! : line
20
20
  record_params = send(CONVERT_RECORD[type.nil? ? 'nginx' : type], preprocessed_log)
21
21
  record = Record.new(record_params) if record_params && preprocessed_log
22
+ record = yield(record) if block_given?
22
23
 
23
24
  arr.push(record) if record && record.status_200? && record.method_get? && record.uri_without_data && !record.robot?
24
25
 
@@ -1,4 +1,3 @@
1
1
  class LogAnalysis
2
- VERSION = '0.1.2'.freeze
3
- DATA_PATH = '~/data/waazabag/'.freeze
2
+ VERSION = '0.1.3'
4
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: log_analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Tran
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: useragent