slack-ruby-block-kit 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +7 -0
- data/Gemfile.lock +13 -1
- data/README.md +2 -2
- data/bin/console +13 -0
- data/lib/slack/block_kit.rb +1 -1
- data/lib/slack/block_kit/composition/confirmation_dialog.rb +9 -2
- data/lib/slack/block_kit/composition/option.rb +7 -3
- data/lib/slack/block_kit/element/overflow_menu.rb +3 -2
- data/slack-ruby-block-kit.gemspec +3 -0
- metadata +45 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98d7b9d263e5a169d46a97f64512f013580d455ef0c928a095e417bbccc77d52
|
4
|
+
data.tar.gz: ee8488ad4d4bb36317f93a556bc0728d07dc16e38da892fb8067ba9efe5fa661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0e114f5f7e4455a9773e16cd8bf906cc94d1052601d85d0ea5af83d8597cc40c3b462912a6174832ff22ae54c91a9d9f8f79dab864963ec907f8da47e7e0107
|
7
|
+
data.tar.gz: eddb7b032cd53b0c5974204c518d279311a76ba5f9a88455882ff691f6984ca0f94e6acbfc37b143315519c19fc79a4800c8cdaf581bf962948303d376ee6b6f
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,18 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
slack-ruby-block-kit (0.
|
4
|
+
slack-ruby-block-kit (0.6.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
ast (2.4.0)
|
10
|
+
coderay (1.1.2)
|
10
11
|
diff-lcs (1.3)
|
12
|
+
dotenv (2.7.5)
|
13
|
+
faraday (1.0.1)
|
14
|
+
multipart-post (>= 1.2, < 3)
|
11
15
|
jaro_winkler (1.5.2)
|
16
|
+
method_source (1.0.0)
|
17
|
+
multipart-post (2.1.1)
|
12
18
|
parallel (1.13.0)
|
13
19
|
parser (2.6.0.0)
|
14
20
|
ast (~> 2.4.0)
|
15
21
|
powerpack (0.1.2)
|
22
|
+
pry (0.13.1)
|
23
|
+
coderay (~> 1.1)
|
24
|
+
method_source (~> 1.0)
|
16
25
|
rainbow (3.0.0)
|
17
26
|
rake (13.0.1)
|
18
27
|
rspec (3.8.0)
|
@@ -48,6 +57,9 @@ PLATFORMS
|
|
48
57
|
|
49
58
|
DEPENDENCIES
|
50
59
|
bundler (< 2.0)
|
60
|
+
dotenv
|
61
|
+
faraday
|
62
|
+
pry
|
51
63
|
rake
|
52
64
|
rspec
|
53
65
|
rspec_junit_formatter
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![CircleCI](https://circleci.com/gh/CGA1123/slack-ruby-block-kit/tree/master.svg?style=svg)](https://circleci.com/gh/CGA1123/
|
1
|
+
[![CircleCI](https://circleci.com/gh/CGA1123/slack-ruby-block-kit/tree/master.svg?style=svg)](https://circleci.com/gh/CGA1123/slack-ruby-block-kit/tree/master)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/slack-ruby-block-kit.svg)](https://badge.fury.io/rb/slack-ruby-block-kit)
|
3
3
|
|
4
4
|
# Slack::BlockKit
|
@@ -86,7 +86,7 @@ You can also check out the [`slackerduty`](https://github.com/CGA1123/slackerdut
|
|
86
86
|
|
87
87
|
## Contributing
|
88
88
|
|
89
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/CGA1123/
|
89
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/CGA1123/slack-ruby-block-kit
|
90
90
|
|
91
91
|
See [issues](https://github.com/CGA1123/slack-ruby-block-kit/issues) if you want any inspiration as to what to help with!
|
92
92
|
|
data/bin/console
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path('../lib', __dir__)
|
5
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
|
+
|
7
|
+
require 'bundler/setup'
|
8
|
+
require 'dotenv/load'
|
9
|
+
require 'slack-ruby-block-kit'
|
10
|
+
require 'faraday'
|
11
|
+
require 'pry'
|
12
|
+
|
13
|
+
Pry.start
|
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.
|
9
|
+
VERSION = '0.6.0'
|
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 }
|
@@ -33,6 +33,12 @@ module Slack
|
|
33
33
|
self
|
34
34
|
end
|
35
35
|
|
36
|
+
def style(value)
|
37
|
+
@style = value
|
38
|
+
|
39
|
+
self
|
40
|
+
end
|
41
|
+
|
36
42
|
def mrkdwn(text:, verbatim: nil)
|
37
43
|
@text = Mrkdwn.new(text: text, verbatim: verbatim)
|
38
44
|
|
@@ -44,8 +50,9 @@ module Slack
|
|
44
50
|
title: @title.as_json,
|
45
51
|
text: @text.as_json,
|
46
52
|
confirm: @confirm.as_json,
|
47
|
-
deny: @deny.as_json
|
48
|
-
|
53
|
+
deny: @deny.as_json,
|
54
|
+
style: @style
|
55
|
+
}.compact
|
49
56
|
end
|
50
57
|
end
|
51
58
|
end
|
@@ -8,16 +8,20 @@ module Slack
|
|
8
8
|
# https://api.slack.com/reference/messaging/composition-objects#option
|
9
9
|
# https://api.slack.com/reference/messaging/block-elements#select
|
10
10
|
class Option
|
11
|
-
def initialize(value:, text:, emoji: nil)
|
11
|
+
def initialize(value:, text:, emoji: nil, description: nil, url: nil)
|
12
12
|
@text = PlainText.new(text: text, emoji: emoji)
|
13
13
|
@value = value
|
14
|
+
@description = PlainText.new(text: description, emoji: emoji) if description
|
15
|
+
@url = url
|
14
16
|
end
|
15
17
|
|
16
18
|
def as_json(*)
|
17
19
|
{
|
18
20
|
text: @text.as_json,
|
19
|
-
value: @value
|
20
|
-
|
21
|
+
value: @value,
|
22
|
+
description: @description&.as_json,
|
23
|
+
url: @url
|
24
|
+
}.compact
|
21
25
|
end
|
22
26
|
end
|
23
27
|
end
|
@@ -26,11 +26,12 @@ module Slack
|
|
26
26
|
yield(self) if block_given?
|
27
27
|
end
|
28
28
|
|
29
|
-
def option(value:, text:, emoji: nil)
|
29
|
+
def option(value:, text:, emoji: nil, url: nil)
|
30
30
|
@options << Composition::Option.new(
|
31
31
|
value: value,
|
32
32
|
text: text,
|
33
|
-
emoji: emoji
|
33
|
+
emoji: emoji,
|
34
|
+
url: url
|
34
35
|
)
|
35
36
|
|
36
37
|
self
|
@@ -29,6 +29,9 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.required_ruby_version = '>= 2.5'
|
30
30
|
|
31
31
|
spec.add_development_dependency 'bundler', '< 2.0'
|
32
|
+
spec.add_development_dependency 'dotenv'
|
33
|
+
spec.add_development_dependency 'faraday'
|
34
|
+
spec.add_development_dependency 'pry'
|
32
35
|
spec.add_development_dependency 'rake'
|
33
36
|
spec.add_development_dependency 'rspec'
|
34
37
|
spec.add_development_dependency 'rspec_junit_formatter'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack-ruby-block-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Gregg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,48 @@ dependencies:
|
|
24
24
|
- - "<"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dotenv
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: faraday
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
27
69
|
- !ruby/object:Gem::Dependency
|
28
70
|
name: rake
|
29
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,6 +153,7 @@ files:
|
|
111
153
|
- LICENSE.txt
|
112
154
|
- README.md
|
113
155
|
- Rakefile
|
156
|
+
- bin/console
|
114
157
|
- lib/slack-ruby-block-kit.rb
|
115
158
|
- lib/slack/block_kit.rb
|
116
159
|
- lib/slack/block_kit/blocks.rb
|