Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mcr.microsoft.com/vscode/devcontainers/ruby:0-2.7
FROM mcr.microsoft.com/vscode/devcontainers/ruby:4.0
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '3.1', '3.2', '3.3' ]
ruby: [ '3.3', '3.4', '4.0' ]
experimental: [ false ]
name: Ruby ${{ matrix.ruby }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: '4.0'
bundler-cache: true
- uses: rubygems/release-gem@v1
4 changes: 2 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require:
plugins:
- rubocop-rake
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5.3
TargetRubyVersion: 3.3
NewCops: enable

Layout/LineLength:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ gem 'debug', '~> 1.9', require: false
gem 'retest', '~> 1.13', require: false
gem 'rubocop', '~> 1', require: false
gem 'rubocop-rake', '~> 0.6', require: false
gem 'rubocop-rspec', '~> 2', require: false
gem 'rubocop-rspec', '~> 3', require: false
gem 'simplecov', '~> 0.22', require: false
gem 'simplecov-cobertura', require: false
136 changes: 81 additions & 55 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ PATH
GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
ast (2.4.3)
coderay (1.1.3)
debug (1.9.1)
date (3.5.1)
debug (1.11.1)
irb (~> 1.10)
reline (>= 0.3.8)
diff-lcs (1.5.1)
docile (1.4.0)
diff-lcs (1.6.2)
docile (1.4.1)
dotenv (2.8.1)
faraday (1.10.3)
erb (6.0.3)
faraday (1.10.5)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
Expand All @@ -28,100 +30,124 @@ GEM
faraday-retry (~> 1.0)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-em_synchrony (1.0.1)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-multipart (1.0.4)
multipart-post (~> 2)
faraday-net_http (1.0.1)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (1.0.2)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday-retry (1.0.3)
ffi (1.16.3)
io-console (0.7.2)
irb (1.12.0)
rdoc
faraday-retry (1.0.4)
ffi (1.17.4)
ffi (1.17.4-x86_64-darwin)
ffi (1.17.4-x86_64-linux-gnu)
io-console (0.8.2)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
listen (3.9.0)
json (2.19.4)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
method_source (1.0.0)
multipart-post (2.3.0)
logger (1.7.0)
method_source (1.1.0)
multipart-post (2.4.1)
observer (0.1.2)
parallel (1.22.1)
parser (3.1.2.0)
parallel (2.0.1)
parser (3.3.11.1)
ast (~> 2.4.1)
pry (0.14.2)
racc
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
psych (5.1.2)
reline (>= 0.6.0)
psych (5.3.1)
date
stringio
racc (1.8.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
rake (13.4.2)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rdoc (6.6.3.1)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
regexp_parser (2.3.1)
reline (0.4.3)
tsort
regexp_parser (2.12.0)
reline (0.6.3)
io-console (~> 0.5)
retest (1.13.2)
listen (~> 3.9)
observer (~> 0.1)
string-similarity (~> 2.1)
tty-option (~> 0.1)
rexml (3.2.8)
strscan (>= 3.0.9)
rspec (3.13.0)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.0)
rspec-support (3.13.7)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.28.2)
parallel (~> 1.10)
parser (>= 3.1.0.0)
rubocop (1.86.1)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.17.0, < 2.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.17.0)
parser (>= 3.1.1.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
rubocop-rspec (2.10.0)
rubocop (~> 1.19)
ruby-progressbar (1.11.0)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-rake (0.7.1)
lint_roller (~> 1.1)
rubocop (>= 1.72.1)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.81)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
simplecov-cobertura (3.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.12.3)
simplecov-html (0.13.2)
simplecov_json_formatter (0.1.4)
string-similarity (2.1.0)
stringio (3.1.0)
strscan (3.1.0)
stringio (3.2.0)
tsort (0.2.0)
tty-option (0.3.0)
unicode-display_width (2.1.0)
zeitwerk (2.6.18)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
zeitwerk (2.7.5)

PLATFORMS
ruby
Expand All @@ -141,7 +167,7 @@ DEPENDENCIES
rspec_junit_formatter (~> 0.6)
rubocop (~> 1)
rubocop-rake (~> 0.6)
rubocop-rspec (~> 2)
rubocop-rspec (~> 3)
simplecov (~> 0.22)
simplecov-cobertura
slack-ruby-block-kit!
Expand Down
4 changes: 2 additions & 2 deletions examples/comprehensive_rich_text_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# frozen_string_literal: true

require_relative '../lib/slack-ruby-block-kit'
require_relative './config'
require_relative './example_helper'
require_relative 'config'
require_relative 'example_helper'
require 'json'

# rubocop:disable Metrics/BlockLength
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# frozen_string_literal: true

require_relative '../lib/slack-ruby-block-kit'
require_relative './config'
require_relative './example_helper'
require_relative 'config'
require_relative 'example_helper'
require 'json'

a_prebuilt_block = Slack::BlockKit::Layout::Section.new
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_rich_text_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# frozen_string_literal: true

require_relative '../lib/slack-ruby-block-kit'
require_relative './config'
require_relative './example_helper'
require_relative 'config'
require_relative 'example_helper'
require 'json'

a_prebuilt_block = Slack::BlockKit::Layout::RichText.new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module RichTextElements
# https://api.slack.com/reference/block-kit/blocks#element-types
class Channel
include RichTextElements::StyleHelper

TYPE = 'channel'
VALID_STYLES = %w[bold italic strike highlight client_highlight unlink].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module RichTextElements
# https://api.slack.com/reference/block-kit/blocks#element-types
class Link
include RichTextElements::StyleHelper

TYPE = 'link'
VALID_STYLES = %w[bold italic strike code].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def validate_styles(provided_styles, valid_styles)
def styles_as_json(styles)
return if styles.empty?

styles.each_with_object({}) { |style, block| block[style] = true }
styles.to_h { |style| [style, true] }
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module RichTextElements
# https://api.slack.com/reference/block-kit/blocks#element-types
class Text
include RichTextElements::StyleHelper

TYPE = 'text'
VALID_STYLES = %w[bold italic strike code].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module RichTextElements
# https://api.slack.com/reference/block-kit/blocks#element-types
class User
include RichTextElements::StyleHelper

TYPE = 'user'
VALID_STYLES = %w[bold italic strike highlight client_highlight unlink].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module RichTextElements
# https://api.slack.com/reference/block-kit/blocks#element-types
class Usergroup
include RichTextElements::StyleHelper

TYPE = 'usergroup'
VALID_STYLES = %w[bold italic strike highlight client_highlight unlink].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class RichText
# https://api.slack.com/reference/block-kit/blocks#rich_text_preformatted
class RichTextPreformatted
include RichTextElements

TYPE = 'rich_text_preformatted'

attr_accessor :elements, :border
Expand Down
1 change: 1 addition & 0 deletions lib/slack/block_kit/layout/rich_text/rich_text_quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class RichText
# https://api.slack.com/reference/block-kit/blocks#rich_text_quote
class RichTextQuote
include RichTextElements

TYPE = 'rich_text_quote'

attr_accessor :elements, :border
Expand Down
1 change: 1 addition & 0 deletions lib/slack/block_kit/layout/rich_text/rich_text_section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class RichText
# https://api.slack.com/reference/block-kit/blocks#rich_text_section
class RichTextSection
include RichTextElements

TYPE = 'rich_text_section'

attr_accessor :elements
Expand Down
1 change: 1 addition & 0 deletions lib/slack/block_kit/layout/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ module Layout
# https://api.slack.com/reference/messaging/blocks#section
class Section
include Section::MultiSelectElements

TYPE = 'section'

attr_accessor :fields, :text, :accessory
Expand Down
2 changes: 1 addition & 1 deletion slack-ruby-block-kit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
.reject { |f| f.match(%r{^(test|spec|features)/}) }
end
spec.require_paths = ['lib']
spec.required_ruby_version = '>= 2.5'
spec.required_ruby_version = '>= 3.3'
spec.metadata = {
'rubygems_mfa_required' => 'true'
}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/slack/block_kit/element/checkboxes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@
end

it 'correctly serializes' do
instance.option(**option.merge(initial: true))
instance.option(**option_description.merge(initial: true))
instance.option(**option, initial: true)
instance.option(**option_description, initial: true)
instance.option(**another_option)

expect(as_json).to eq(expected_json)
Expand Down
Loading