slack-notification 0.1.9 → 0.1.11
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 +4 -4
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -1
- data/lib/slack_notification.rb +5 -4
- data/slack-notification.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2abf1d04fa88a9b0e2db66e72cbf23c96767e82127e34ade0186e52cfe21a62
|
|
4
|
+
data.tar.gz: 1278148aa051b26391ceacc0b8e6c5400617a7ecb17079a7c6b16ea672d31b17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aa414c69a7025c78b377c0286cac4474f03d1d5ba0e70eaea3ddd883dc08520a74ae00ded0683aa474970a973003202ef3082faf35cc042b92f071b4b5168573
|
|
7
|
+
data.tar.gz: 2f35a1c9c4e4f5693e29b37dd28ef11fdcfdac9181935e0780ae9c31b004c8e1cf4e442c51696513e7311a4918520975acc3a41e650f448da17a3528072b2bb3
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.5.1
|
data/Gemfile.lock
CHANGED
data/lib/slack_notification.rb
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require 'slack-notifier'
|
|
4
4
|
|
|
5
5
|
class SlackNotification
|
|
6
|
-
attr_accessor :type, :dryrun, :title, :fallback, :fields, :channel
|
|
6
|
+
attr_accessor :type, :dryrun, :title, :fallback, :fields, :blocks, :channel
|
|
7
7
|
|
|
8
8
|
def initialize(options = {})
|
|
9
9
|
@channel = validated_channel(options[:channel].to_s)
|
|
@@ -12,6 +12,7 @@ class SlackNotification
|
|
|
12
12
|
@fallback = options[:fallback]
|
|
13
13
|
@dryrun = options[:dryrun] || (defined?(Rails) && Rails.env.test?)
|
|
14
14
|
@fields = validated_fields(options[:fields])
|
|
15
|
+
@blocks = options[:blocks]
|
|
15
16
|
end
|
|
16
17
|
|
|
17
18
|
def data
|
|
@@ -25,7 +26,7 @@ class SlackNotification
|
|
|
25
26
|
end
|
|
26
27
|
|
|
27
28
|
def notify!
|
|
28
|
-
@dryrun ? data : notifier.post(attachments: [data])
|
|
29
|
+
@dryrun ? data : notifier.post(attachments: [data], blocks: @blocks)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
private
|
|
@@ -83,7 +84,7 @@ private
|
|
|
83
84
|
end
|
|
84
85
|
|
|
85
86
|
def validated_channel(channel = nil)
|
|
86
|
-
channel = channel.delete('#')
|
|
87
|
+
channel = channel.delete('#').gsub('_', '-')
|
|
87
88
|
unknown_channel(channel) unless slack_urls.keys.include?(channel)
|
|
88
89
|
|
|
89
90
|
channel ||= 'notifications'
|
|
@@ -99,7 +100,7 @@ private
|
|
|
99
100
|
return credentials_urls if credentials_urls?
|
|
100
101
|
|
|
101
102
|
ENV.select { |k, _| k.match?(/SLACK_URL_/) }.map do |key, url|
|
|
102
|
-
{ key.gsub('SLACK_URL_', '').downcase => url }
|
|
103
|
+
{ key.gsub('SLACK_URL_', '').gsub('_', '-').downcase => url }
|
|
103
104
|
end.reduce({}, :merge)
|
|
104
105
|
end
|
|
105
106
|
|
data/slack-notification.gemspec
CHANGED
|
@@ -5,8 +5,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = 'slack-notification'
|
|
8
|
-
spec.version = '0.1.
|
|
9
|
-
spec.date = '
|
|
8
|
+
spec.version = '0.1.11'
|
|
9
|
+
spec.date = '2023-03-12'
|
|
10
10
|
spec.authors = ['Julian Fiander']
|
|
11
11
|
spec.email = ['julian@fiander.one']
|
|
12
12
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slack-notification
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julian Fiander
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -127,6 +127,7 @@ extra_rdoc_files: []
|
|
|
127
127
|
files:
|
|
128
128
|
- ".gitignore"
|
|
129
129
|
- ".rubocop.yml"
|
|
130
|
+
- ".ruby-version"
|
|
130
131
|
- ".travis.yml"
|
|
131
132
|
- Gemfile
|
|
132
133
|
- Gemfile.lock
|
|
@@ -158,8 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
158
159
|
- !ruby/object:Gem::Version
|
|
159
160
|
version: '0'
|
|
160
161
|
requirements: []
|
|
161
|
-
|
|
162
|
-
rubygems_version: 2.7.6
|
|
162
|
+
rubygems_version: 3.2.30
|
|
163
163
|
signing_key:
|
|
164
164
|
specification_version: 4
|
|
165
165
|
summary: A simplified Slack API.
|