slack-ruby-block-kit 0.18.0 → 0.19.0

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: e1dbf4c507a258057e4268545eb470d52283d73f24911adedf77f4cb3bd63dea
4
- data.tar.gz: fbb29fb003bc969ca8d9dc7eb3db3f025afd7585dc671009f5aa482d79fd711f
3
+ metadata.gz: 122d7e0273762e60628682a4874b0c5c148312b3cc62e9659c0c42dff2f200d6
4
+ data.tar.gz: c5d1685745d2bf0bc12813e96ecd14c87a1a21fad9d81c27a29dac243891b1a9
5
5
  SHA512:
6
- metadata.gz: 9838653c7f9641515da8433252f34123dff455b3619c3ba32fbdccaffdb8b16144f830d6ed53a246afd04acbce4ed8887a66ba45079eca99cce50b370afcbae4
7
- data.tar.gz: 4d079f8202a4d9b3a8966adf4f01e37eb0c08a22e074a3dc149a09466ea63124eb7841f8585cfc295880754a68bf2352e33a6b9de8e68afa7b5092c0e9a812c0
6
+ metadata.gz: 6e9df8d14a98baff1b3783c159527277d9e25d61f8fd68ff113d2449ad447611f80d1b023950733c1d159345d3359f6fe08c6bd70254b085ffbfa77613abd97b
7
+ data.tar.gz: 3cd7a5724578d354345bfbe11014c37f8ce4d2515c59bfe2cfdd139aaee4fa8bd71418811abe59500c0bac3950d14bf91891053c247144df0d76b9f70142f165
@@ -16,9 +16,10 @@ jobs:
16
16
  - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: 2.7
19
- - run: |
20
- otp=${{github.event.inputs.otp}}
21
- echo "::add-mask::$otp"
19
+ - name: Mask OTP
20
+ run: |
21
+ OTP=$(jq -r '.inputs.otp' $GITHUB_EVENT_PATH)
22
+ echo "::add-mask::$OTP"
22
23
  - run: gem update --system
23
24
  - run: git config --global user.email github-action@users.noreply.github.com
24
25
  - run: git config --global user.name GitHub Actions
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
- /.bundle/
1
+ /.bundle
2
+ /vendor/bundle
2
3
  /.yardoc
3
4
  /_yardoc/
4
5
  /coverage/
data/.rubocop.yml CHANGED
@@ -83,5 +83,8 @@ Metrics/ClassLength:
83
83
  Metrics/CyclomaticComplexity:
84
84
  Max: 8
85
85
 
86
+ Metrics/MethodLength:
87
+ Max: 25
88
+
86
89
  RSpec/ExampleLength:
87
- Max: 6
90
+ Max: 25
data/CHANGELOG.md CHANGED
@@ -25,6 +25,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
25
  ### Security
26
26
  - N/A
27
27
 
28
+ ## [0.19.0] - 2022-09-05
29
+
30
+ ### Added
31
+ - Added `Slack::BlockKit::Layout::Video` (#152 by @jcat4)
32
+
33
+ This adds support for Slack's new Video Block.
34
+
35
+ See: https://api.slack.com/reference/block-kit/blocks#video
36
+
37
+
28
38
  ## [0.18.0] - 2022-08-26
29
39
 
30
40
  ### Added
@@ -125,8 +135,9 @@ This release contains a breaking change on the `Layout::Actions` interface.
125
135
  - Fixed initial options in multi select blocks (#46 by @caalberts)
126
136
 
127
137
 
128
- [Unreleased]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.18.0...HEAD
129
- [0.17.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.17.0...v0.18.0
138
+ [Unreleased]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.19.0...HEAD
139
+ [0.19.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.18.0...v0.19.0
140
+ [0.18.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.17.0...v0.18.0
130
141
  [0.17.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.16.0...v0.17.0
131
142
  [0.16.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.15.0...v0.16.0
132
143
  [0.15.0]: https://github.com/CGA1123/slack-ruby-block-kit/compare/v0.14.1...v0.15.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- slack-ruby-block-kit (0.18.0)
4
+ slack-ruby-block-kit (0.19.0)
5
5
  zeitwerk (~> 2.6)
6
6
 
7
7
  GEM
@@ -55,6 +55,19 @@ module Slack
55
55
  append(block)
56
56
  end
57
57
 
58
+ def video(alt_text:, thumbnail_url:, video_url:, title:, description:, **optional_args)
59
+ block = Layout::Video.new(
60
+ alt_text: alt_text,
61
+ thumbnail_url: thumbnail_url,
62
+ video_url: video_url,
63
+ title: title,
64
+ description: description,
65
+ **optional_args
66
+ )
67
+
68
+ append(block)
69
+ end
70
+
58
71
  def section(block_id: nil)
59
72
  block = Layout::Section.new(block_id: block_id)
60
73
 
@@ -0,0 +1,51 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Slack
4
+ module BlockKit
5
+ module Layout
6
+ # A video block is designed to embed videos in all app surfaces
7
+ # (e.g. link unfurls, messages, modals, App Home) — anywhere you can put blocks!
8
+ # To use the video block within your app, you must have the links.embed:write scope.
9
+ #
10
+ # https://api.slack.com/reference/messaging/blocks#context
11
+ class Video
12
+ TYPE = 'video'
13
+
14
+ def initialize(alt_text:, thumbnail_url:, video_url:, title:, description:, **optional_args)
15
+ @alt_text = alt_text
16
+ @thumbnail_url = thumbnail_url
17
+ @video_url = video_url
18
+ @author_name = optional_args[:author_name]
19
+ @block_id = optional_args[:block_id]
20
+ @provider_icon_url = optional_args[:provider_icon_url]
21
+ @provider_name = optional_args[:provider_name]
22
+ @title_url = optional_args[:title_url]
23
+ @description = Composition::PlainText.new(
24
+ text: description,
25
+ emoji: optional_args[:emoji]
26
+ )
27
+ @title = Composition::PlainText.new(
28
+ text: title,
29
+ emoji: optional_args[:emoji]
30
+ )
31
+ end
32
+
33
+ def as_json(*)
34
+ {
35
+ type: TYPE,
36
+ alt_text: @alt_text,
37
+ thumbnail_url: @thumbnail_url,
38
+ video_url: @video_url,
39
+ author_name: @author_name,
40
+ block_id: @block_id,
41
+ provider_icon_url: @provider_icon_url,
42
+ provider_name: @provider_name,
43
+ title_url: @title_url,
44
+ description: @description.as_json,
45
+ title: @title.as_json
46
+ }.compact
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Slack
4
4
  module BlockKit
5
- VERSION = '0.18.0'
5
+ VERSION = '0.19.0'
6
6
  end
7
7
  end
@@ -57,7 +57,7 @@ module Slack
57
57
  self
58
58
  end
59
59
 
60
- def as_json(*) # rubocop:disable Metrics/MethodLength
60
+ def as_json(*)
61
61
  {
62
62
  type: TYPE,
63
63
  blocks: @blocks.as_json,
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.18.0
4
+ version: 0.19.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: 2022-08-26 00:00:00.000000000 Z
11
+ date: 2022-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: zeitwerk
@@ -83,6 +83,7 @@ files:
83
83
  - lib/slack/block_kit/layout/input.rb
84
84
  - lib/slack/block_kit/layout/section.rb
85
85
  - lib/slack/block_kit/layout/section/multi_select_elements.rb
86
+ - lib/slack/block_kit/layout/video.rb
86
87
  - lib/slack/block_kit/version.rb
87
88
  - lib/slack/surfaces/home.rb
88
89
  - lib/slack/surfaces/message.rb