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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6fe53f5f1ea77a7ff88743d73f86b47b88ccb4e99e824bc4b989d5f5f83ca54
4
- data.tar.gz: a9ad9991be8827fc775e59ebd516e7d7e56c5a6883fa62adf1e45284e81b1be6
3
+ metadata.gz: f2abf1d04fa88a9b0e2db66e72cbf23c96767e82127e34ade0186e52cfe21a62
4
+ data.tar.gz: 1278148aa051b26391ceacc0b8e6c5400617a7ecb17079a7c6b16ea672d31b17
5
5
  SHA512:
6
- metadata.gz: 0cb2ec78c87648d9fdc9303e1204df6bd1ceca36abc1a4306e7fa53493ab592a7ff8c782daa23bf9e5f29accd2bfbc95770a13b7a59365fa72dd9e207815d8ff
7
- data.tar.gz: e44227ab03fc8f5cf8ba0fc9205ed4bcc3a928e526973be72e1f33e178ca8c2ddf4e68bcb142b3b7d7e5655d0aa6114b92e87bff398d7e800f1d03de246ec653
6
+ metadata.gz: aa414c69a7025c78b377c0286cac4474f03d1d5ba0e70eaea3ddd883dc08520a74ae00ded0683aa474970a973003202ef3082faf35cc042b92f071b4b5168573
7
+ data.tar.gz: 2f35a1c9c4e4f5693e29b37dd28ef11fdcfdac9181935e0780ae9c31b004c8e1cf4e442c51696513e7311a4918520975acc3a41e650f448da17a3528072b2bb3
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.5.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slack-notification (0.1.9)
4
+ slack-notification (0.1.11)
5
5
  slack-notifier (~> 2.3)
6
6
 
7
7
  GEM
@@ -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
 
@@ -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'
9
- spec.date = '2021-08-26'
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.9
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: 2021-08-26 00:00:00.000000000 Z
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
- rubyforge_project:
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.