slack_block_kit 0.3.0 → 0.3.1
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/.rubocop_todo.yml +8 -3
- data/Gemfile.lock +1 -1
- data/lib/slack/block_kit.rb +1 -1
- data/lib/slack/block_kit/element/button.rb +3 -1
- data/lib/slack/block_kit/layout/actions.rb +2 -1
- data/lib/slack/block_kit/layout/section.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93a5ce991f196689da6234a392358496a2f6be18a8d4aeb76306230c3d2bf057
|
|
4
|
+
data.tar.gz: bc1562e6bc215dff1237b2110ffbdf9189c12af0325f89540c1bb0bbea814016
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d9077b46e6cddd69e29d3e329823a1f8b8bd6395c990ddacdd7981bfb8e8f06fb528d09c680e01d487e41501f46662e509d70136d95444e5f3d83b0fffbb791
|
|
7
|
+
data.tar.gz: d0e515f20f4f36183531e3fd1b4d5dd1527af8f8e52a7dac86513a25b5b6de6be87b9fe65715723b1f051479946f530d03628c43a939e73af282cc3d52cd2002
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
|
-
# `rubocop --auto-gen-config`
|
|
3
|
-
#
|
|
2
|
+
# `rubocop --auto-gen-config --no-auto-gen-timestamp`
|
|
3
|
+
# using RuboCop version 0.63.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -15,7 +15,12 @@ Metrics/BlockLength:
|
|
|
15
15
|
# Offense count: 1
|
|
16
16
|
# Configuration parameters: CountComments.
|
|
17
17
|
Metrics/ClassLength:
|
|
18
|
-
Max:
|
|
18
|
+
Max: 117
|
|
19
|
+
|
|
20
|
+
# Offense count: 3
|
|
21
|
+
# Configuration parameters: CountKeywordArgs.
|
|
22
|
+
Metrics/ParameterLists:
|
|
23
|
+
Max: 6
|
|
19
24
|
|
|
20
25
|
# Offense count: 5
|
|
21
26
|
# Configuration parameters: Max.
|
data/Gemfile.lock
CHANGED
data/lib/slack/block_kit.rb
CHANGED
|
@@ -6,7 +6,7 @@ module Slack
|
|
|
6
6
|
module Element; end
|
|
7
7
|
module Layout; end
|
|
8
8
|
|
|
9
|
-
VERSION = '0.3.
|
|
9
|
+
VERSION = '0.3.1'
|
|
10
10
|
|
|
11
11
|
Dir[File.join(__dir__, 'block_kit', 'composition', '*.rb')].each { |file| require file }
|
|
12
12
|
Dir[File.join(__dir__, 'block_kit', 'element', '*.rb')].each { |file| require file }
|
|
@@ -13,10 +13,11 @@ module Slack
|
|
|
13
13
|
|
|
14
14
|
attr_accessor :confirm
|
|
15
15
|
|
|
16
|
-
def initialize(text:, action_id:, emoji: nil, url: nil, value: nil)
|
|
16
|
+
def initialize(text:, action_id:, style: nil, emoji: nil, url: nil, value: nil)
|
|
17
17
|
@text = Composition::PlainText.new(text: text, emoji: emoji)
|
|
18
18
|
@action_id = action_id
|
|
19
19
|
@url = url
|
|
20
|
+
@style = style
|
|
20
21
|
@value = value
|
|
21
22
|
|
|
22
23
|
yield(self) if block_given?
|
|
@@ -37,6 +38,7 @@ module Slack
|
|
|
37
38
|
action_id: @action_id,
|
|
38
39
|
url: @url,
|
|
39
40
|
value: @value,
|
|
41
|
+
style: @style,
|
|
40
42
|
confirm: @confirm&.as_json
|
|
41
43
|
}.compact
|
|
42
44
|
end
|
|
@@ -18,10 +18,11 @@ module Slack
|
|
|
18
18
|
yield(self) if block_given?
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
-
def button(text:, action_id:, emoji: nil, url: nil, value: nil)
|
|
21
|
+
def button(text:, action_id:, style: nil, emoji: nil, url: nil, value: nil)
|
|
22
22
|
element = Element::Button.new(
|
|
23
23
|
text: text,
|
|
24
24
|
action_id: action_id,
|
|
25
|
+
style: style,
|
|
25
26
|
emoji: emoji,
|
|
26
27
|
url: url,
|
|
27
28
|
value: value
|
|
@@ -47,10 +47,11 @@ module Slack
|
|
|
47
47
|
self
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
def button(text:, action_id:, emoji: nil, url: nil, value: nil)
|
|
50
|
+
def button(text:, action_id:, style:, emoji: nil, url: nil, value: nil)
|
|
51
51
|
element = Element::Button.new(
|
|
52
52
|
text: text,
|
|
53
53
|
action_id: action_id,
|
|
54
|
+
style: style,
|
|
54
55
|
emoji: emoji,
|
|
55
56
|
url: url,
|
|
56
57
|
value: value
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slack_block_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Gregg
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-05
|
|
11
|
+
date: 2019-06-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|