slack_log_device 5.1.5 → 6.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
2
  SHA256:
3
- metadata.gz: 954c628718e1ce1c6acdecc37374044fa2f3d0ddd1a204b2a9c11171ebad1bb1
4
- data.tar.gz: 9e1b79a52410abb078e0717385171b283f682d82ba6996fb0d2061a9220ec01e
3
+ metadata.gz: 75f3fd14091501e77cb9e2aec3df1f75c0d83b506161d990e9e3c05dd0fe78c3
4
+ data.tar.gz: b53bd12072de5c44a1c659ebd636545b291353d361fe429f843f5dba366b0b4c
5
5
  SHA512:
6
- metadata.gz: 4e43959d9788032b24e054d95ff4aaf9184bc03661bc5d5a44f89a268782a4dc5086a774ccbbb9f321f731637eade0201832b8f07df300ad9c4330f62bbc761a
7
- data.tar.gz: 4946d346f1a5336f2cd4988fba72b7f514e3673eeeceb26c0e8c1c51b3859501cca1f18aced07cfcb799bcc2ba42f3527f8bcbf2961c701439bb5d61f951fe48
6
+ metadata.gz: 5428ca393ab3740400f003baf7c433e6da1ee09b21d212a2272fd40e35554ee9a48e08b5e196e15885180f5f0800f0c166d562677023c11d864d01b8077dc720
7
+ data.tar.gz: 1a4c62261c00e45ab94767bfc78f4cb96dcf65cb447d8fb70c33db8e830eb42c014ea02f20cb74566c1c11635bc956d123e570f8fb291be21dc16b85503d25da
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.1.5
1
+ 6.0.0
@@ -27,7 +27,7 @@ class SlackLogDevice
27
27
  @message_converter = block_given? ? Proc.new(&block) : -> (message) { message }
28
28
  end
29
29
 
30
- def call(severity, datetime, progname, message)
30
+ def call(severity, _datetime, progname, message)
31
31
  text = "*`#{severity}`*"
32
32
  text << " (*#{to_utf8(progname)}*)" if progname.present?
33
33
  text << ':'
@@ -63,7 +63,7 @@ class SlackLogDevice
63
63
 
64
64
  def icon_emoji=(value)
65
65
  value = value.to_s.strip.presence
66
- @icon_emojis.keys.each do |severity|
66
+ @icon_emojis.each_key do |severity|
67
67
  @icon_emojis[severity] = value
68
68
  end
69
69
  end
@@ -76,7 +76,6 @@ class SlackLogDevice
76
76
  values.each do |severity, emoji|
77
77
  @icon_emojis[parse_severity(severity)] = emoji.to_s.strip.presence
78
78
  end
79
- @icon_emojis
80
79
  end
81
80
 
82
81
  def max_backtrace_lines=(value)
@@ -126,7 +125,7 @@ class SlackLogDevice
126
125
  'Machine' => Socket.gethostname,
127
126
  'PID' => Process.pid,
128
127
  })
129
- metadata.keys.each do |key|
128
+ metadata.each_key do |key|
130
129
  value = metadata[key]
131
130
  metadata[key] = "`#{to_utf8(value.to_s.strip)}`" if value.present?
132
131
  end
@@ -1,3 +1,4 @@
1
+ require 'active_support/isolated_execution_state'
1
2
  require 'active_support/core_ext/hash'
2
3
  require 'active_support/core_ext/string'
3
4
  require 'httparty'
@@ -53,7 +54,7 @@ class SlackLogDevice
53
54
  end
54
55
 
55
56
  def flush
56
- while !@buffer.empty? do
57
+ until @buffer.empty?
57
58
  message = nil
58
59
  @mutex.synchronize do
59
60
  message = @buffer.pop
@@ -65,9 +66,11 @@ class SlackLogDevice
65
66
  data['icon_emoji'] = message.icon_emoji if message.respond_to?(:icon_emoji) && message.icon_emoji.present?
66
67
  data['username'] = username if username.present?
67
68
  begin
68
- HTTParty.post(webhook_url, body: data.to_json, headers: { 'Content-Type' => 'application/json' }, timeout: timeout)
69
+ HTTParty.post(webhook_url, body: data.to_json, headers: { 'Content-Type' => 'application/json' }, timeout:)
70
+ # rubocop:disable Lint/RescueException
69
71
  rescue Exception => e
70
- STDERR.puts(e)
72
+ # rubocop:enable Lint/RescueException
73
+ warn(e)
71
74
  end
72
75
  end
73
76
  nil
@@ -111,7 +114,7 @@ class SlackLogDevice
111
114
  @mutex.synchronize do
112
115
  @buffer << message
113
116
  end
114
- @flush_thread.kill if @flush_thread
117
+ @flush_thread&.kill
115
118
  if flush?
116
119
  flush
117
120
  else
@@ -9,16 +9,19 @@ Gem::Specification.new do |s|
9
9
  s.description = 'LogDevice implementation that post logs on a Slack channel'
10
10
  s.license = 'MIT'
11
11
 
12
- s.files = `git ls-files | grep -vE '^(spec/|test/|\\.|Gemfile|Rakefile)'`.split("\n")
13
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
12
+ s.files = %x(git ls-files | grep -vE '^(spec/|test/|\\.|Gemfile|Rakefile)').split("\n")
13
+ s.executables = %x(git ls-files -- bin/*).split("\n").map { |f| File.basename(f) }
14
14
  s.require_paths = ['lib']
15
15
 
16
16
  s.required_ruby_version = '>= 2.1.0'
17
17
 
18
- s.add_dependency 'activesupport', '>= 4.1.0', '< 7.0.0'
19
- s.add_dependency 'httparty', '>= 0.14.0', '< 0.19.0'
18
+ s.add_dependency 'activesupport', '>= 7.0.0', '< 8.0.0'
19
+ s.add_dependency 'httparty', '>= 0.14.0', '< 0.21.0'
20
20
 
21
21
  s.add_development_dependency 'byebug', '>= 9.0.0', '< 12.0.0'
22
22
  s.add_development_dependency 'rake', '>= 12.0.0', '< 14.0.0'
23
- s.add_development_dependency 'rspec', '>= 3.5.0', '< 3.10.0'
23
+ s.add_development_dependency 'rspec', '>= 3.5.0', '< 3.11.0'
24
+ s.add_development_dependency 'rubocop', '>= 1.25.0', '< 2.0.0'
25
+ s.add_development_dependency 'rubocop-rake', '>= 0.6.0', '< 1.0.0'
26
+ s.add_development_dependency 'rubocop-rspec', '>= 2.8.0', '< 3.0.0'
24
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_log_device
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.5
4
+ version: 6.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-01 00:00:00.000000000 Z
11
+ date: 2022-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.1.0
19
+ version: 7.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 7.0.0
22
+ version: 8.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 4.1.0
29
+ version: 7.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 7.0.0
32
+ version: 8.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: httparty
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: 0.14.0
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
- version: 0.19.0
42
+ version: 0.21.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: 0.14.0
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
- version: 0.19.0
52
+ version: 0.21.0
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: byebug
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -99,7 +99,7 @@ dependencies:
99
99
  version: 3.5.0
100
100
  - - "<"
101
101
  - !ruby/object:Gem::Version
102
- version: 3.10.0
102
+ version: 3.11.0
103
103
  type: :development
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
@@ -109,7 +109,67 @@ dependencies:
109
109
  version: 3.5.0
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
- version: 3.10.0
112
+ version: 3.11.0
113
+ - !ruby/object:Gem::Dependency
114
+ name: rubocop
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 1.25.0
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: 2.0.0
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: 1.25.0
130
+ - - "<"
131
+ - !ruby/object:Gem::Version
132
+ version: 2.0.0
133
+ - !ruby/object:Gem::Dependency
134
+ name: rubocop-rake
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: 0.6.0
140
+ - - "<"
141
+ - !ruby/object:Gem::Version
142
+ version: 1.0.0
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: !ruby/object:Gem::Requirement
146
+ requirements:
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: 0.6.0
150
+ - - "<"
151
+ - !ruby/object:Gem::Version
152
+ version: 1.0.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: rubocop-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 2.8.0
160
+ - - "<"
161
+ - !ruby/object:Gem::Version
162
+ version: 3.0.0
163
+ type: :development
164
+ prerelease: false
165
+ version_requirements: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 2.8.0
170
+ - - "<"
171
+ - !ruby/object:Gem::Version
172
+ version: 3.0.0
113
173
  description: LogDevice implementation that post logs on a Slack channel
114
174
  email: al@alweb.org
115
175
  executables: []
@@ -129,7 +189,7 @@ homepage: https://github.com/alexistoulotte/slack_log_device
129
189
  licenses:
130
190
  - MIT
131
191
  metadata: {}
132
- post_install_message:
192
+ post_install_message:
133
193
  rdoc_options: []
134
194
  require_paths:
135
195
  - lib
@@ -144,8 +204,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
204
  - !ruby/object:Gem::Version
145
205
  version: '0'
146
206
  requirements: []
147
- rubygems_version: 3.0.3
148
- signing_key:
207
+ rubygems_version: 3.3.3
208
+ signing_key:
149
209
  specification_version: 4
150
210
  summary: LogDevice for Slack
151
211
  test_files: []