heavylog 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14234701b389d0f983d0195b56bff88b36bd5b20303dde3831e24c09c1413857
4
- data.tar.gz: d64b00d6db92f63d676c245259dd40bf32e0aa86a4390d5603eacd66d06ac31c
3
+ metadata.gz: a01b4798a9eccba2129d251ce94305a062a5ba47bef3a37d81674ef730ea0c8a
4
+ data.tar.gz: a2e26f6f95305729667ba8bed2e2d739200c18ae972efe40a295e7e15163c174
5
5
  SHA512:
6
- metadata.gz: '08f1ce54b82fa3e501535b1d78725f81ae4f2e6a004bba8b75e1b10f954e93473eb25aa3f5a740dd88543438b10b051cafa1c1742e5ee47432a6778d40a3fbc8'
7
- data.tar.gz: 95f42f4607951a35b499e022028a0f9e4d4d3de063ffe8a9c88d74852827c0b3a3751b3a82affed322d252c193a6a957aee57bc4cc317166e9f4261a49c3047f
6
+ metadata.gz: 45c91792eb8cd223555cebe0709501677ff73583bd72b60d88e4b364caa85d796e2c75d93a131745e246eb9509ade848207f74086765f30976b4228ba61a3daa
7
+ data.tar.gz: 6a0eb6464ce38bd89294ed7be9d68b9ff2465ce2734e2904a88234ff1bb528b0a1f1e9741908cb5aca7334003ace4f79b06804468107d70804169ad91832c811
@@ -0,0 +1,14 @@
1
+ # This file is for unifying the coding style for different editors and IDEs
2
+ # editorconfig.org
3
+
4
+ root = true
5
+
6
+ [*]
7
+ charset = utf-8
8
+ trim_trailing_whitespace = false
9
+ insert_final_newline = true
10
+ indent_style = space
11
+ indent_size = 2
12
+
13
+ [*.md]
14
+ trim_trailing_whitespace = true
@@ -0,0 +1,36 @@
1
+ name: Test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ test:
7
+ name: Build
8
+ runs-on: ubuntu-latest
9
+
10
+ steps:
11
+ - uses: actions/checkout@v1
12
+ - name: Set up Ruby
13
+ uses: actions/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6.5
16
+
17
+ - uses: actions/cache@v1
18
+ with:
19
+ path: vendor/bundle
20
+ key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
21
+ restore-keys: |
22
+ ${{ runner.os }}-gem-
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ gem install bundler
27
+ bundle config path vendor/bundle
28
+ bundle install --jobs 4 --retry 3
29
+
30
+ - name: Run tests
31
+ uses: paambaati/codeclimate-action@v2.4.0
32
+ env:
33
+ CI: true
34
+ CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
35
+ with:
36
+ coverageCommand: bundle exec rspec
data/.gitignore CHANGED
@@ -6,6 +6,7 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /log/
9
10
 
10
11
  # rspec failure tracking
11
12
  .rspec_status
@@ -2,46 +2,42 @@ require:
2
2
  - rubocop-performance
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.5
5
+ TargetRubyVersion: 2.6
6
6
 
7
7
  # # Commonly used screens these days easily fit more than 80 characters.
8
- Metrics/LineLength:
8
+ Layout/LineLength:
9
9
  Max: 120
10
10
 
11
11
  # Too short methods lead to extraction of single-use methods, which can make
12
12
  # the code easier to read (by naming things), but can also clutter the class
13
13
  Metrics/MethodLength:
14
- Max: 125
14
+ Enabled: false
15
15
 
16
16
  # The guiding principle of classes is SRP, SRP can't be accurately measured by LoC
17
17
  Metrics/ClassLength:
18
- Max: 1500
18
+ Enabled: false
19
19
 
20
20
  Metrics/AbcSize:
21
- Max: 160
21
+ Enabled: false
22
22
 
23
23
  Metrics/CyclomaticComplexity:
24
- Max: 45
24
+ Enabled: false
25
25
 
26
26
  Metrics/PerceivedComplexity:
27
- Max: 45
27
+ Enabled: false
28
28
 
29
29
  Metrics/ParameterLists:
30
- Max: 6
30
+ Enabled: false
31
31
 
32
32
  Metrics/ModuleLength:
33
- Max: 125
33
+ Enabled: false
34
34
 
35
35
  Metrics/BlockLength:
36
- Max: 45
37
- Exclude:
38
- - 'spec/**/*'
36
+ Enabled: false
39
37
 
40
38
  # Mixing the styles looks just silly.
41
39
  Style/HashSyntax:
42
40
  EnforcedStyle: ruby19_no_mixed_keys
43
- Exclude:
44
- - 'config/routes.rb'
45
41
 
46
42
  # Single quotes being faster is hardly measurable and only affects parse time.
47
43
  # Enforcing double quotes reduces the times where you need to change them
@@ -103,8 +99,11 @@ Style/ClassAndModuleChildren:
103
99
  Style/DoubleNegation:
104
100
  Enabled: false
105
101
 
102
+ Style/AsciiComments:
103
+ Enabled: false
104
+
106
105
  # Most readable form.
107
- Layout/AlignHash:
106
+ Layout/HashAlignment:
108
107
  EnforcedHashRocketStyle: table
109
108
  EnforcedColonStyle: table
110
109
 
@@ -125,14 +124,14 @@ Layout/MultilineMethodCallIndentation:
125
124
  # Suppressing exceptions can be perfectly fine, and be it to avoid to
126
125
  # explicitly type nil into the rescue since that's what you want to return,
127
126
  # or suppressing LoadError for optional dependencies
128
- Lint/HandleExceptions:
127
+ Lint/SuppressedException:
129
128
  Enabled: false
130
129
 
131
130
  # This is just silly. Calling the argument `other` in all cases makes no sense.
132
131
  Naming/BinaryOperatorParameterName:
133
132
  Enabled: false
134
133
 
135
- Naming/UncommunicativeMethodParamName:
134
+ Naming/MethodParameterName:
136
135
  AllowedNames:
137
136
  - io
138
137
  - id
@@ -148,3 +147,6 @@ Naming/UncommunicativeMethodParamName:
148
147
 
149
148
  Bundler/OrderedGems:
150
149
  Enabled: false
150
+
151
+ Gemspec/OrderedDependencies:
152
+ Enabled: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- heavylog (0.0.16)
4
+ heavylog (0.0.17)
5
5
  actionpack (>= 5)
6
6
  activesupport (>= 5)
7
7
  railties (>= 5)
@@ -10,90 +10,132 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- actionpack (6.0.0)
14
- actionview (= 6.0.0)
15
- activesupport (= 6.0.0)
16
- rack (~> 2.0)
13
+ actionpack (6.0.2.1)
14
+ actionview (= 6.0.2.1)
15
+ activesupport (= 6.0.2.1)
16
+ rack (~> 2.0, >= 2.0.8)
17
17
  rack-test (>= 0.6.3)
18
18
  rails-dom-testing (~> 2.0)
19
19
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
20
- actionview (6.0.0)
21
- activesupport (= 6.0.0)
20
+ actionview (6.0.2.1)
21
+ activesupport (= 6.0.2.1)
22
22
  builder (~> 3.1)
23
23
  erubi (~> 1.4)
24
24
  rails-dom-testing (~> 2.0)
25
25
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
26
- activesupport (6.0.0)
26
+ activesupport (6.0.2.1)
27
27
  concurrent-ruby (~> 1.0, >= 1.0.2)
28
28
  i18n (>= 0.7, < 2)
29
29
  minitest (~> 5.1)
30
30
  tzinfo (~> 1.1)
31
- zeitwerk (~> 2.1, >= 2.1.8)
31
+ zeitwerk (~> 2.2)
32
32
  ast (2.4.0)
33
- builder (3.2.3)
34
- concurrent-ruby (1.1.5)
35
- crass (1.0.4)
33
+ backport (1.1.2)
34
+ benchmark (0.1.0)
35
+ builder (3.2.4)
36
+ concurrent-ruby (1.1.6)
37
+ connection_pool (2.2.2)
38
+ crass (1.0.6)
36
39
  diff-lcs (1.3)
40
+ docile (1.3.2)
41
+ e2mmap (0.1.0)
37
42
  erubi (1.9.0)
38
- i18n (1.7.0)
43
+ i18n (1.8.2)
39
44
  concurrent-ruby (~> 1.0)
40
- jaro_winkler (1.5.2)
41
- loofah (2.3.0)
45
+ jaro_winkler (1.5.4)
46
+ json (2.3.0)
47
+ loofah (2.4.0)
42
48
  crass (~> 1.0.2)
43
49
  nokogiri (>= 1.5.9)
50
+ maruku (0.7.3)
44
51
  method_source (0.9.2)
45
52
  mini_portile2 (2.4.0)
46
- minitest (5.12.2)
47
- nokogiri (1.10.4)
53
+ minitest (5.14.0)
54
+ nokogiri (1.10.8)
48
55
  mini_portile2 (~> 2.4.0)
49
- parallel (1.17.0)
50
- parser (2.6.3.0)
56
+ parallel (1.19.1)
57
+ parser (2.7.0.2)
51
58
  ast (~> 2.4.0)
52
- rack (2.0.7)
59
+ rack (2.2.2)
60
+ rack-protection (2.0.8.1)
61
+ rack
53
62
  rack-test (1.1.0)
54
63
  rack (>= 1.0, < 3)
55
64
  rails-dom-testing (2.0.3)
56
65
  activesupport (>= 4.2.0)
57
66
  nokogiri (>= 1.6)
58
- rails-html-sanitizer (1.2.0)
59
- loofah (~> 2.2, >= 2.2.2)
60
- railties (6.0.0)
61
- actionpack (= 6.0.0)
62
- activesupport (= 6.0.0)
67
+ rails-html-sanitizer (1.3.0)
68
+ loofah (~> 2.3)
69
+ railties (6.0.2.1)
70
+ actionpack (= 6.0.2.1)
71
+ activesupport (= 6.0.2.1)
63
72
  method_source
64
73
  rake (>= 0.8.7)
65
74
  thor (>= 0.20.3, < 2.0)
66
75
  rainbow (3.0.0)
67
76
  rake (10.5.0)
68
- request_store (1.4.1)
77
+ redis (4.1.3)
78
+ request_store (1.5.0)
69
79
  rack (>= 1.4)
70
- rspec (3.7.0)
71
- rspec-core (~> 3.7.0)
72
- rspec-expectations (~> 3.7.0)
73
- rspec-mocks (~> 3.7.0)
74
- rspec-core (3.7.1)
75
- rspec-support (~> 3.7.0)
76
- rspec-expectations (3.7.0)
80
+ reverse_markdown (1.4.0)
81
+ nokogiri
82
+ rexml (3.2.4)
83
+ rspec (3.9.0)
84
+ rspec-core (~> 3.9.0)
85
+ rspec-expectations (~> 3.9.0)
86
+ rspec-mocks (~> 3.9.0)
87
+ rspec-core (3.9.1)
88
+ rspec-support (~> 3.9.1)
89
+ rspec-expectations (3.9.0)
77
90
  diff-lcs (>= 1.2.0, < 2.0)
78
- rspec-support (~> 3.7.0)
79
- rspec-mocks (3.7.0)
91
+ rspec-support (~> 3.9.0)
92
+ rspec-mocks (3.9.1)
80
93
  diff-lcs (>= 1.2.0, < 2.0)
81
- rspec-support (~> 3.7.0)
82
- rspec-support (3.7.1)
83
- rubocop (0.71.0)
94
+ rspec-support (~> 3.9.0)
95
+ rspec-support (3.9.2)
96
+ rubocop (0.80.0)
84
97
  jaro_winkler (~> 1.5.1)
85
98
  parallel (~> 1.10)
86
- parser (>= 2.6)
99
+ parser (>= 2.7.0.1)
87
100
  rainbow (>= 2.2.2, < 4.0)
101
+ rexml
88
102
  ruby-progressbar (~> 1.7)
89
103
  unicode-display_width (>= 1.4.0, < 1.7)
104
+ rubocop-performance (1.5.2)
105
+ rubocop (>= 0.71.0)
90
106
  ruby-progressbar (1.10.1)
91
- thor (0.20.3)
107
+ sidekiq (6.0.5)
108
+ connection_pool (>= 2.2.2)
109
+ rack (~> 2.0)
110
+ rack-protection (>= 2.0.0)
111
+ redis (>= 4.1.0)
112
+ simplecov (0.17.1)
113
+ docile (~> 1.1)
114
+ json (>= 1.8, < 3)
115
+ simplecov-html (~> 0.10.0)
116
+ simplecov-html (0.10.2)
117
+ solargraph (0.38.5)
118
+ backport (~> 1.1)
119
+ benchmark
120
+ bundler (>= 1.17.2)
121
+ e2mmap
122
+ jaro_winkler (~> 1.5)
123
+ maruku (~> 0.7, >= 0.7.3)
124
+ nokogiri (~> 1.9, >= 1.9.1)
125
+ parser (~> 2.3)
126
+ reverse_markdown (~> 1.0, >= 1.0.5)
127
+ rubocop (~> 0.52)
128
+ thor (~> 1.0)
129
+ tilt (~> 2.0)
130
+ yard (~> 0.9)
131
+ thor (1.0.1)
92
132
  thread_safe (0.3.6)
93
- tzinfo (1.2.5)
133
+ tilt (2.0.10)
134
+ tzinfo (1.2.6)
94
135
  thread_safe (~> 0.1)
95
- unicode-display_width (1.6.0)
96
- zeitwerk (2.1.10)
136
+ unicode-display_width (1.6.1)
137
+ yard (0.9.24)
138
+ zeitwerk (2.3.0)
97
139
 
98
140
  PLATFORMS
99
141
  ruby
@@ -104,6 +146,10 @@ DEPENDENCIES
104
146
  rake (~> 10.0)
105
147
  rspec (~> 3.0)
106
148
  rubocop (~> 0.71)
149
+ rubocop-performance (~> 1.5.2)
150
+ sidekiq (>= 5.0)
151
+ simplecov (~> 0.17.1)
152
+ solargraph (~> 0.38.5)
107
153
 
108
154
  BUNDLED WITH
109
155
  2.0.2
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  spec.license = "MIT"
17
17
 
18
18
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
19
- f.match(%r{^(test|spec|features)/})
19
+ f.match(%r{^(test|spec|features|.vscode)/})
20
20
  end
21
21
  spec.bindir = "exe"
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -26,6 +26,10 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "rspec", "~> 3.0"
28
28
  spec.add_development_dependency "rubocop", "~> 0.71"
29
+ spec.add_development_dependency "rubocop-performance", "~> 1.5.2"
30
+ spec.add_development_dependency "simplecov", "~> 0.17.1"
31
+ spec.add_development_dependency "sidekiq", ">= 5.0"
32
+ spec.add_development_dependency "solargraph", "~> 0.38.5"
29
33
 
30
34
  spec.add_runtime_dependency "actionpack", ">= 5"
31
35
  spec.add_runtime_dependency "activesupport", ">= 5"
@@ -1,17 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "sidekiq/job_logger"
3
+ begin
4
+ require "sidekiq/job_logger"
4
5
 
5
- module Heavylog
6
- class SidekiqLogger < Sidekiq::JobLogger
7
- def call(item, _queue)
8
- # item = {"class"=>"SuspiciousJob", "args"=>[12754545, [3858890], "invoice"], "retry"=>true, "queue"=>"default",
9
- # "jid"=>"5ec968571e358497d70a3cf2", "created_at"=>1540484817.3950138, "enqueued_at"=>1540484817.395076}
6
+ module Heavylog
7
+ class SidekiqLogger < Sidekiq::JobLogger
8
+ def call(item, _queue)
9
+ # item = {"class"=>"SuspiciousJob", "args"=>[12754545, [3858890], "invoice"], "retry"=>true, "queue"=>"default",
10
+ # "jid"=>"5ec968571e358497d70a3cf2", "created_at"=>1540484817.3950138, "enqueued_at"=>1540484817.395076}
10
11
 
11
- Heavylog.log_sidekiq(item["jid"], item["class"], item["args"])
12
- super
13
- ensure
14
- Heavylog.finish_sidekiq
12
+ Heavylog.log_sidekiq(item["jid"], item["class"], item["args"])
13
+ super
14
+ ensure
15
+ Heavylog.finish_sidekiq
16
+ end
15
17
  end
16
18
  end
19
+ rescue LoadError
17
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Heavylog
4
- VERSION = "0.0.16"
4
+ VERSION = "0.0.17"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heavylog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristjan Rang
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-04 00:00:00.000000000 Z
11
+ date: 2020-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -66,6 +66,62 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.71'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rubocop-performance
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.5.2
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.5.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.17.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.17.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: sidekiq
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '5.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '5.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: solargraph
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 0.38.5
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 0.38.5
69
125
  - !ruby/object:Gem::Dependency
70
126
  name: actionpack
71
127
  requirement: !ruby/object:Gem::Requirement
@@ -129,10 +185,11 @@ executables: []
129
185
  extensions: []
130
186
  extra_rdoc_files: []
131
187
  files:
188
+ - ".editorconfig"
189
+ - ".github/workflows/test.yml"
132
190
  - ".gitignore"
133
191
  - ".rspec"
134
192
  - ".rubocop.yml"
135
- - ".travis.yml"
136
193
  - Gemfile
137
194
  - Gemfile.lock
138
195
  - LICENSE.txt
@@ -171,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
228
  - !ruby/object:Gem::Version
172
229
  version: '0'
173
230
  requirements: []
174
- rubygems_version: 3.0.3
231
+ rubygems_version: 3.1.2
175
232
  signing_key:
176
233
  specification_version: 4
177
234
  summary: Format all Rails logging per request
@@ -1,6 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.5.0
5
- before_install: gem install bundler -v 2.0.1
6
- script: bundle exec rspec