juan_pelota 2.1.0 → 3.0.0

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
- SHA1:
3
- metadata.gz: f5cf1fcaa40e9afedde03fe0777365cfa57edbc9
4
- data.tar.gz: 1210a5dd9472f4fe071b16054f2afbcbf3796adf
2
+ SHA256:
3
+ metadata.gz: 8d3ad11775f22c6779a0181bb3ebdac39f23b15fc1d929eddb704d39d4eac137
4
+ data.tar.gz: dffa44eda6417af4e0ac1c8ca2cf812d3491cb4a3ee9425f20487ee39e81721d
5
5
  SHA512:
6
- metadata.gz: 48734ec1a53916df44c9f76eaac7bc71a062b31603514c0b3dc32839f97737effc0d77c0863110d18a75c1a1f2644d9ac0aa2b617390c4de950c2ad472b5c2c8
7
- data.tar.gz: 35997f62cf30af24bc92b7a00b013ed8d5e7cc60eb29c55dcb49a98bab8877a755f60b2da580e788a67072a607c6f973ed4e0ec7e09b9f11024c297257492663
6
+ metadata.gz: 8e958cf459d7de7e468ff595b805364b3ea7444bad7c69e6c473665873e54632958bfff2bc70c9f6a0297ab2762fc84c192d8cf9cdc27e246a9c45aa4541a73c
7
+ data.tar.gz: b66950aac6dceefa71bd1cb0ee70812aa3fabd3ace60af47d6121dd3474758608ef8e4e48ba219c4b1368ee92709f01fa330861dbbf1de83379f8c94e42fb710
checksums.yaml.gz.sig CHANGED
Binary file
data/LICENSE.txt ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2010-2016 The Kompanee, Ltd
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -14,8 +14,8 @@ module JuanPelota
14
14
  class Configuration
15
15
  include Singleton
16
16
 
17
- attr_accessor :filtered_arguments,
18
- :filtered_workers
17
+ attr_writer :filtered_arguments,
18
+ :filtered_workers
19
19
 
20
20
  def filtered_arguments
21
21
  @filtered_arguments || []
@@ -1,20 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'sidekiq/logging'
3
+ require 'sidekiq/logger'
4
4
  require 'juan_pelota/version'
5
5
  require 'juan_pelota'
6
6
  require 'json'
7
7
 
8
8
  module JuanPelota
9
- class Logger < ::Sidekiq::Logging::Pretty
9
+ class Logger < ::Sidekiq::Logger::Formatters::Base
10
10
  IGNORABLE_STATUSES = %w{start done queueing}.freeze
11
11
 
12
12
  attr_accessor :severity,
13
13
  :timestamp,
14
- :program_name,
15
- :raw_message
14
+ :program_name
15
+ attr_writer :raw_message
16
16
 
17
- def call(severity, time, program_name, incoming_message)
17
+ def call(severity, time, program_name, incoming_message) # rubocop:disable Metrics/AbcSize
18
18
  self.severity = severity
19
19
  self.timestamp = time.utc.iso8601
20
20
  self.program_name = program_name
@@ -23,7 +23,7 @@ class Logger < ::Sidekiq::Logging::Pretty
23
23
  return if config.filtered_workers.include?(worker_name.to_s) &&
24
24
  IGNORABLE_STATUSES.include?(status)
25
25
 
26
- {
26
+ { # rubocop:disable Style/StringConcatenation
27
27
  '@type' => 'sidekiq',
28
28
  '@timestamp' => timestamp,
29
29
  '@status' => status,
@@ -33,7 +33,7 @@ class Logger < ::Sidekiq::Logging::Pretty
33
33
  '@fields' => {
34
34
  pid: self.class.pid,
35
35
  tid: self.class.tid,
36
- context: context,
36
+ context: ctx,
37
37
  program_name: program_name,
38
38
  worker: worker_name,
39
39
  arguments: arguments,
@@ -51,20 +51,22 @@ class Logger < ::Sidekiq::Logging::Pretty
51
51
 
52
52
  private
53
53
 
54
- def raw_message
54
+ def raw_message # rubocop:disable Metrics/CyclomaticComplexity
55
55
  if @raw_message.is_a? Hash
56
56
  @raw_message
57
57
  elsif @raw_message.respond_to?(:match) &&
58
58
  @raw_message.match(/^queueing/)
59
+
59
60
  {
60
61
  'status' => 'queueing',
61
62
  'message' => @raw_message,
62
- 'class' => @raw_message.split(' ')[1],
63
+ 'class' => @raw_message.split[1],
63
64
  }
64
65
  elsif @raw_message.respond_to?(:match) &&
65
66
  @raw_message.match(/:\d+:in\s`/)
67
+
66
68
  {
67
- 'message' => @raw_message.lines.first(10).map(&:chomp),
69
+ 'message' => @raw_message.lines.first(10).map!(&:chomp),
68
70
  }
69
71
  else
70
72
  {
@@ -3,7 +3,7 @@
3
3
  module JuanPelota
4
4
  module Middlewares
5
5
  class Logging
6
- # rubocop:disable Lint/RescueException, Metrics/AbcSize, Metrics/MethodLength
6
+ # rubocop:disable Lint/RescueException, Metrics/AbcSize
7
7
  def call(worker, job, _queue)
8
8
  start = Time.now
9
9
 
@@ -30,11 +30,11 @@ class Logging
30
30
  'args' => filtered_arguments(job['args'].try(:first)),
31
31
  )
32
32
  end
33
- rescue Exception => e
33
+ rescue Exception => error
34
34
  message = {
35
- 'error_class' => e.class.name,
36
- 'error_message' => e.message,
37
- 'error_backtrace' => e.backtrace.first(10),
35
+ 'error_class' => error.class.name,
36
+ 'error_message' => error.message,
37
+ 'error_backtrace' => error.backtrace.first(10),
38
38
  }
39
39
 
40
40
  logger.info(
@@ -47,12 +47,12 @@ class Logging
47
47
  'args' => filtered_arguments(job['args'].try(:first)),
48
48
  )
49
49
 
50
- raise e
50
+ raise error
51
51
  end
52
- # rubocop:enable Lint/RescueException, Metrics/AbcSize, Metrics/MethodLength
52
+ # rubocop:enable Lint/RescueException, Metrics/AbcSize
53
53
 
54
54
  def elapsed(start)
55
- (Time.now - start).to_f.round(3)
55
+ Float((Time.now - start)).round(3)
56
56
  end
57
57
 
58
58
  def logger
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JuanPelota
4
- VERSION = '2.1.0'
4
+ VERSION = '3.0.0'
5
5
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: juan_pelota
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thekompanee
@@ -10,43 +10,49 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDrjCCApagAwIBAgIBATANBgkqhkiG9w0BAQUFADBOMRowGAYDVQQDDBFhY2Nv
13
+ MIIErjCCAxagAwIBAgIBATANBgkqhkiG9w0BAQsFADBOMRowGAYDVQQDDBFhY2Nv
14
14
  dW50c19ydWJ5Z2VtczEbMBkGCgmSJomT8ixkARkWC3RoZWtvbXBhbmVlMRMwEQYK
15
- CZImiZPyLGQBGRYDY29tMB4XDTE3MDgwMjIyNTYzMVoXDTE4MDgwMjIyNTYzMVow
15
+ CZImiZPyLGQBGRYDY29tMB4XDTIyMDMwNDE5NTc0NloXDTIzMDMwNDE5NTc0Nlow
16
16
  TjEaMBgGA1UEAwwRYWNjb3VudHNfcnVieWdlbXMxGzAZBgoJkiaJk/IsZAEZFgt0
17
- aGVrb21wYW5lZTETMBEGCgmSJomT8ixkARkWA2NvbTCCASIwDQYJKoZIhvcNAQEB
18
- BQADggEPADCCAQoCggEBAMc4QXE2KJeQa7s4KCh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 2Q1jYQMxADb6ruQiM9VYIVIfwTrOsF8t9IuoN+xCOUafDQ3Ix3i70BSdzm48toNl
35
+ 0xoB7J4x0kJYk4zrQ9VsLK7xadlR0MC4rfkjPucz41+zOEzoG0hZgoySbR/0K1vX
36
+ dqKIiQ90U6ghhzc0WhL3K7L50FKfHh1vCXBToYuQIpyWyZtvkTvvDE9vLHmVJH4U
37
+ wNduo7tKzoOUaVNBOaIdXeZ610yzBamfSN2xNtSord+Y3JTt/Uvn2UmG8QwHqnxq
38
+ W/M=
33
39
  -----END CERTIFICATE-----
34
- date: 2017-08-02 00:00:00.000000000 Z
40
+ date: 2022-03-04 00:00:00.000000000 Z
35
41
  dependencies:
36
42
  - !ruby/object:Gem::Dependency
37
43
  name: sidekiq
38
44
  requirement: !ruby/object:Gem::Requirement
39
45
  requirements:
40
- - - ">="
46
+ - - "~>"
41
47
  - !ruby/object:Gem::Version
42
- version: '4.0'
48
+ version: '6.0'
43
49
  type: :runtime
44
50
  prerelease: false
45
51
  version_requirements: !ruby/object:Gem::Requirement
46
52
  requirements:
47
- - - ">="
53
+ - - "~>"
48
54
  - !ruby/object:Gem::Version
49
- version: '4.0'
55
+ version: '6.0'
50
56
  - !ruby/object:Gem::Dependency
51
57
  name: rspec
52
58
  requirement: !ruby/object:Gem::Requirement
@@ -95,14 +101,14 @@ dependencies:
95
101
  requirements:
96
102
  - - "~>"
97
103
  - !ruby/object:Gem::Version
98
- version: 0.7.1
104
+ version: 0.9.4
99
105
  type: :development
100
106
  prerelease: false
101
107
  version_requirements: !ruby/object:Gem::Requirement
102
108
  requirements:
103
109
  - - "~>"
104
110
  - !ruby/object:Gem::Version
105
- version: 0.7.1
111
+ version: 0.9.4
106
112
  description: ''
107
113
  email:
108
114
  - info@thekompanee.com
@@ -110,7 +116,7 @@ executables: []
110
116
  extensions: []
111
117
  extra_rdoc_files: []
112
118
  files:
113
- - LICENSE
119
+ - LICENSE.txt
114
120
  - README.md
115
121
  - Rakefile
116
122
  - lib/juan_pelota.rb
@@ -138,8 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
144
  - !ruby/object:Gem::Version
139
145
  version: '0'
140
146
  requirements: []
141
- rubyforge_project:
142
- rubygems_version: 2.6.8
147
+ rubygems_version: 3.1.6
143
148
  signing_key:
144
149
  specification_version: 4
145
150
  summary: Log Sidekiq messages in JSON format
metadata.gz.sig CHANGED
Binary file
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2013 Jeff Felchner
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.