slack_webhook_logger 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +0 -9
- data/.vscode/settings.json +5 -0
- data/Gemfile.lock +54 -48
- data/lib/slack_webhook_logger/formatter.rb +1 -1
- data/lib/slack_webhook_logger/logger.rb +1 -1
- data/lib/slack_webhook_logger/request_io.rb +2 -5
- data/lib/slack_webhook_logger/version.rb +1 -1
- data/lib/slack_webhook_logger.rb +5 -6
- data/slack_webhook_logger.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7946d92f1bd89b5b0abe79a1d1a54566cb83017c2a2b8c96692f918f89274a5f
|
4
|
+
data.tar.gz: c74d1d8381ea1b4a2a23781f949ec33d0408e89b7bffcbeb5e621bf10e3e385d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b0ae3b2a587b896ae2d55bb5f9ad066354272b05b12eb2e463f7f07c33fbe7a680412166dacc4553faf04c9794cd2dbe29197c80b74cde69c50b2728c3feaca
|
7
|
+
data.tar.gz: 0a4363543af0d739112b4c17f5c6647b6a3c280ec933aaff37d78d6b2b95159d625a4ac3fbe82595167c07f0306edbbdcba9f7926312d2ab775412365f8c3d1d
|
data/.github/FUNDING.yml
CHANGED
@@ -1,12 +1,3 @@
|
|
1
1
|
# These are supported funding model platforms
|
2
2
|
|
3
3
|
github: gjtorikian
|
4
|
-
patreon: gjtorikian
|
5
|
-
open_collective: garen-torikian
|
6
|
-
#ko_fi: # Replace with a single Ko-fi username
|
7
|
-
#tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
8
|
-
#community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
9
|
-
#liberapay: # Replace with a single Liberapay username
|
10
|
-
issuehunt: gjtorikian
|
11
|
-
#otechie: # Replace with a single Otechie username
|
12
|
-
#custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
data/Gemfile.lock
CHANGED
@@ -1,113 +1,119 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
slack_webhook_logger (0.
|
4
|
+
slack_webhook_logger (0.4.0)
|
5
5
|
activesupport (>= 5.0, < 8.0)
|
6
|
+
httpx (~> 0.20)
|
6
7
|
railties (>= 5.0, < 8.0)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
11
|
-
actionpack (7.0.
|
12
|
-
actionview (= 7.0.
|
13
|
-
activesupport (= 7.0.
|
12
|
+
actionpack (7.0.4.3)
|
13
|
+
actionview (= 7.0.4.3)
|
14
|
+
activesupport (= 7.0.4.3)
|
14
15
|
rack (~> 2.0, >= 2.2.0)
|
15
16
|
rack-test (>= 0.6.3)
|
16
17
|
rails-dom-testing (~> 2.0)
|
17
18
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
18
|
-
actionview (7.0.
|
19
|
-
activesupport (= 7.0.
|
19
|
+
actionview (7.0.4.3)
|
20
|
+
activesupport (= 7.0.4.3)
|
20
21
|
builder (~> 3.1)
|
21
22
|
erubi (~> 1.4)
|
22
23
|
rails-dom-testing (~> 2.0)
|
23
24
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
24
|
-
activesupport (7.0.
|
25
|
+
activesupport (7.0.4.3)
|
25
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
26
27
|
i18n (>= 1.6, < 2)
|
27
28
|
minitest (>= 5.1)
|
28
29
|
tzinfo (~> 2.0)
|
29
|
-
addressable (2.8.
|
30
|
-
public_suffix (>= 2.0.2, <
|
30
|
+
addressable (2.8.4)
|
31
|
+
public_suffix (>= 2.0.2, < 6.0)
|
31
32
|
ast (2.4.2)
|
32
33
|
awesome_print (1.9.2)
|
33
34
|
builder (3.2.4)
|
34
|
-
concurrent-ruby (1.
|
35
|
+
concurrent-ruby (1.2.2)
|
35
36
|
crack (0.4.5)
|
36
37
|
rexml
|
37
38
|
crass (1.0.6)
|
38
|
-
erubi (1.
|
39
|
+
erubi (1.12.0)
|
39
40
|
hashdiff (1.0.1)
|
40
|
-
|
41
|
+
http-2-next (0.5.1)
|
42
|
+
httpx (0.23.1)
|
43
|
+
http-2-next (>= 0.4.1)
|
44
|
+
i18n (1.13.0)
|
41
45
|
concurrent-ruby (~> 1.0)
|
42
|
-
|
46
|
+
json (2.6.3)
|
47
|
+
loofah (2.20.0)
|
43
48
|
crass (~> 1.0.2)
|
44
49
|
nokogiri (>= 1.5.9)
|
45
50
|
method_source (1.0.0)
|
46
|
-
minitest (5.
|
47
|
-
nokogiri (1.
|
51
|
+
minitest (5.18.0)
|
52
|
+
nokogiri (1.14.3-arm64-darwin)
|
48
53
|
racc (~> 1.4)
|
49
|
-
parallel (1.
|
50
|
-
parser (3.
|
54
|
+
parallel (1.23.0)
|
55
|
+
parser (3.2.2.1)
|
51
56
|
ast (~> 2.4.1)
|
52
|
-
public_suffix (
|
53
|
-
racc (1.6.
|
54
|
-
rack (2.2.
|
55
|
-
rack-test (
|
56
|
-
rack (>= 1.
|
57
|
+
public_suffix (5.0.1)
|
58
|
+
racc (1.6.2)
|
59
|
+
rack (2.2.7)
|
60
|
+
rack-test (2.1.0)
|
61
|
+
rack (>= 1.3)
|
57
62
|
rails-dom-testing (2.0.3)
|
58
63
|
activesupport (>= 4.2.0)
|
59
64
|
nokogiri (>= 1.6)
|
60
|
-
rails-html-sanitizer (1.
|
61
|
-
loofah (~> 2.
|
62
|
-
railties (7.0.
|
63
|
-
actionpack (= 7.0.
|
64
|
-
activesupport (= 7.0.
|
65
|
+
rails-html-sanitizer (1.5.0)
|
66
|
+
loofah (~> 2.19, >= 2.19.1)
|
67
|
+
railties (7.0.4.3)
|
68
|
+
actionpack (= 7.0.4.3)
|
69
|
+
activesupport (= 7.0.4.3)
|
65
70
|
method_source
|
66
71
|
rake (>= 12.2)
|
67
72
|
thor (~> 1.0)
|
68
73
|
zeitwerk (~> 2.5)
|
69
|
-
rainbow (3.
|
74
|
+
rainbow (3.1.1)
|
70
75
|
rake (12.3.3)
|
71
|
-
regexp_parser (2.
|
76
|
+
regexp_parser (2.8.0)
|
72
77
|
rexml (3.2.5)
|
73
|
-
rubocop (1.
|
78
|
+
rubocop (1.50.2)
|
79
|
+
json (~> 2.3)
|
74
80
|
parallel (~> 1.10)
|
75
|
-
parser (>= 3.
|
81
|
+
parser (>= 3.2.0.0)
|
76
82
|
rainbow (>= 2.2.2, < 4.0)
|
77
83
|
regexp_parser (>= 1.8, < 3.0)
|
78
|
-
rexml
|
79
|
-
rubocop-ast (>= 1.
|
84
|
+
rexml (>= 3.2.5, < 4.0)
|
85
|
+
rubocop-ast (>= 1.28.0, < 2.0)
|
80
86
|
ruby-progressbar (~> 1.7)
|
81
|
-
unicode-display_width (>=
|
82
|
-
rubocop-ast (1.
|
83
|
-
parser (>= 3.
|
84
|
-
rubocop-minitest (0.
|
85
|
-
rubocop (>=
|
86
|
-
rubocop-performance (1.
|
87
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
88
|
+
rubocop-ast (1.28.1)
|
89
|
+
parser (>= 3.2.1.0)
|
90
|
+
rubocop-minitest (0.30.0)
|
91
|
+
rubocop (>= 1.39, < 2.0)
|
92
|
+
rubocop-performance (1.17.1)
|
87
93
|
rubocop (>= 1.7.0, < 2.0)
|
88
94
|
rubocop-ast (>= 0.4.0)
|
89
|
-
rubocop-rails (2.
|
95
|
+
rubocop-rails (2.19.1)
|
90
96
|
activesupport (>= 4.2.0)
|
91
97
|
rack (>= 1.1)
|
92
|
-
rubocop (>= 1.
|
98
|
+
rubocop (>= 1.33.0, < 2.0)
|
93
99
|
rubocop-rake (0.6.0)
|
94
100
|
rubocop (~> 1.0)
|
95
|
-
rubocop-standard (5.1
|
101
|
+
rubocop-standard (5.2.1)
|
96
102
|
rubocop
|
97
103
|
rubocop-minitest
|
98
104
|
rubocop-performance
|
99
105
|
rubocop-rails
|
100
106
|
rubocop-rake
|
101
|
-
ruby-progressbar (1.
|
102
|
-
thor (1.1
|
103
|
-
tzinfo (2.0.
|
107
|
+
ruby-progressbar (1.13.0)
|
108
|
+
thor (1.2.1)
|
109
|
+
tzinfo (2.0.6)
|
104
110
|
concurrent-ruby (~> 1.0)
|
105
|
-
unicode-display_width (2.
|
106
|
-
webmock (3.
|
111
|
+
unicode-display_width (2.4.2)
|
112
|
+
webmock (3.18.1)
|
107
113
|
addressable (>= 2.8.0)
|
108
114
|
crack (>= 0.3.2)
|
109
115
|
hashdiff (>= 0.4.0, < 2.0.0)
|
110
|
-
zeitwerk (2.
|
116
|
+
zeitwerk (2.6.8)
|
111
117
|
|
112
118
|
PLATFORMS
|
113
119
|
ruby
|
@@ -5,7 +5,7 @@ require 'active_support/core_ext/module/delegation'
|
|
5
5
|
module SlackWebhookLogger
|
6
6
|
class Logger < ::ActiveSupport::Logger
|
7
7
|
class << self
|
8
|
-
delegate :fatal, :error, :warn, :info, :debug,
|
8
|
+
delegate :fatal, :error, :warn, :info, :debug,
|
9
9
|
:add, :log, to: :instance
|
10
10
|
end
|
11
11
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'uri'
|
4
4
|
require 'json'
|
5
|
+
require 'httpx'
|
5
6
|
|
6
7
|
module SlackWebhookLogger
|
7
8
|
class RequestIO
|
@@ -14,11 +15,7 @@ module SlackWebhookLogger
|
|
14
15
|
|
15
16
|
return if SlackWebhookLogger.ignore_patterns.any? { |ignore_pattern| hash[:text].match(ignore_pattern) }
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
req = Net::HTTP::Post.new(SlackWebhookLogger.webhook_uri.path)
|
20
|
-
req.set_form_data(payload: payload)
|
21
|
-
SlackWebhookLogger.https.request(req)
|
18
|
+
HTTPX.post(SlackWebhookLogger.webhook_uri.to_s, form: hash)
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
data/lib/slack_webhook_logger.rb
CHANGED
@@ -32,12 +32,11 @@ module SlackWebhookLogger
|
|
32
32
|
@@logger.formatter = @@formatter || SlackWebhookLogger::Formatter.new
|
33
33
|
@@logger.level = @@level || :warn
|
34
34
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
@@https = https
|
35
|
+
begin
|
36
|
+
@@webhook_uri = URI.parse(@@webhook_url)
|
37
|
+
rescue URI::InvalidURIError
|
38
|
+
raise ArgumentError, 'Invalid URI for webhook_url'
|
39
|
+
end
|
41
40
|
|
42
41
|
@@ignore_patterns ||= []
|
43
42
|
end
|
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.require_paths = ['lib']
|
26
26
|
|
27
27
|
spec.add_dependency 'activesupport', '>= 5.0', '< 8.0'
|
28
|
+
spec.add_dependency 'httpx', '~> 0.20'
|
28
29
|
spec.add_dependency 'railties', '>= 5.0', '< 8.0' # for the generators
|
29
30
|
spec.metadata = {
|
30
31
|
'rubygems_mfa_required' => 'true'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_webhook_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '8.0'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: httpx
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0.20'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.20'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: railties
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,6 +76,7 @@ files:
|
|
62
76
|
- ".github/workflows/lint.yml"
|
63
77
|
- ".gitignore"
|
64
78
|
- ".rubocop.yml"
|
79
|
+
- ".vscode/settings.json"
|
65
80
|
- CODE_OF_CONDUCT.md
|
66
81
|
- Gemfile
|
67
82
|
- Gemfile.lock
|
@@ -98,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
113
|
- !ruby/object:Gem::Version
|
99
114
|
version: '0'
|
100
115
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
116
|
+
rubygems_version: 3.4.12
|
102
117
|
signing_key:
|
103
118
|
specification_version: 4
|
104
119
|
summary: A slim wrapper for posting to Rails logs to Slack
|