slack_webhook_logger 0.5.2 → 0.5.5

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: f65b62b9f156ae454fec95c6ffecdd53c175970ec14cb3d06d24e8b64d692ad6
4
- data.tar.gz: a99595d6bf1356de86f20fd6946ad9e8f8a8d48901cd3d9431736bea89f35701
3
+ metadata.gz: 96e88ffe219e928ae89d442a038315b73e4fa4b57134f426aef3e5b62e5b807e
4
+ data.tar.gz: ed1a29838a186cd9cf488ccdc0d45c89f964d17385c1884079d4ea1aa9d512be
5
5
  SHA512:
6
- metadata.gz: 203cda370e20c98232df09f33701811ed7dbc20d8c03b22e680d5f3f4220d0cc8bc92ed9c6c7faa5ce4997320f17f43ac798b5c13d6f5ffee9b7a325fb395b14
7
- data.tar.gz: f25193c1bb42d465b973aaf9df6ba92a00bae54c96594da1f399b2a722c63026bde49f04dc17761f2e55050ecefac2ef610d98bc983a44ddd4cd4ee11da20e7e
6
+ metadata.gz: 2b969a4ec3c7d972803877749e74732707ecf9dc997e66bde91b4f168e0e8a0371d86fcf91468a35e5f74ddcbe7a9d7bb56130c112af329684328fdc67781c32
7
+ data.tar.gz: e2a3a168dd998f9cce18dd91d34d10274b78b8dc0b47773c2ae7b2df75f1df40dca8918b09162a545565b2462300ec3818a43fc0aee541d40ea70c0516dfe674
@@ -3,15 +3,25 @@ updates:
3
3
  - package-ecosystem: "github-actions"
4
4
  directory: "/"
5
5
  schedule:
6
- interval: daily
6
+ interval: weekly
7
+ day: monday
7
8
  time: "09:00"
8
9
  timezone: "Etc/UTC"
10
+ groups:
11
+ github-actions:
12
+ patterns:
13
+ - "*"
9
14
  open-pull-requests-limit: 10
10
15
 
11
- - package-ecosystem: "bundler"
16
+ - package-ecosystem: bundler
12
17
  directory: "/"
13
18
  schedule:
14
- interval: daily
19
+ interval: weekly
20
+ day: monday
15
21
  time: "09:00"
16
22
  timezone: "Etc/UTC"
17
23
  open-pull-requests-limit: 10
24
+ groups:
25
+ bundler-dependencies:
26
+ patterns:
27
+ - "*"
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [v0.5.4] - 06-07-2023
2
+ null
3
+ ## [v0.5.2] - 06-07-2023
4
+ null
1
5
  ## [v0.5.1] - 06-07-2023
2
6
  null
3
7
  ## [v0.5.0] - 05-07-2023
@@ -4,7 +4,13 @@ module SlackWebhookLogger
4
4
  class Formatter < ::Logger::Formatter
5
5
  attr_writer :format
6
6
 
7
- MAX_LENGTH = 20000
7
+ MAX_LENGTH = 3000
8
+
9
+ class << self
10
+ def fetch_text(hash)
11
+ hash[:blocks].last[:text][:text]
12
+ end
13
+ end
8
14
 
9
15
  def format
10
16
  @format ||= proc do |severity, time, _progname, msg|
@@ -39,7 +45,6 @@ module SlackWebhookLogger
39
45
 
40
46
  def slackify(title, text)
41
47
  {
42
- text: [title, text].join("\n").to_s,
43
48
  blocks: [
44
49
  {
45
50
  type: "section",
@@ -75,7 +80,7 @@ module SlackWebhookLogger
75
80
  end
76
81
 
77
82
  private def truncate(string)
78
- string.length > MAX_LENGTH ? "#{string[0...MAX_LENGTH]}..." : string
83
+ string.length > MAX_LENGTH ? "#{string[0...MAX_LENGTH - 3]}..." : string
79
84
  end
80
85
  end
81
86
  end
@@ -14,9 +14,9 @@ module SlackWebhookLogger
14
14
  def write(hash)
15
15
  return if hash.blank?
16
16
 
17
- return if SlackWebhookLogger.ignore_patterns.any? { |ignore_pattern| hash[:text].match(ignore_pattern) }
17
+ return if SlackWebhookLogger.ignore_patterns.any? { |ignore_pattern| SlackWebhookLogger::Formatter.fetch_text(hash).match(ignore_pattern) }
18
18
 
19
- response = HTTPX.with(headers: { "content-type" => "application/json" }).post(SlackWebhookLogger.webhook_uri.to_s, form: hash)
19
+ response = HTTPX.with(headers: { "content-type" => "application/json" }).post(SlackWebhookLogger.webhook_uri.to_s, json: hash)
20
20
 
21
21
  return if (200..299).cover?(response.status)
22
22
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SlackWebhookLogger
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.5"
5
5
  end
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.5.2
4
+ version: 0.5.5
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: 2023-07-06 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
122
  requirements: []
123
- rubygems_version: 3.4.15
123
+ rubygems_version: 3.4.18
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: A slim wrapper for posting to Rails logs to Slack