block-kit 1.0.5 → 1.0.6
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/.tool-versions +1 -1
- data/lib/block_kit/concerns/has_initial_option.rb +1 -1
- data/lib/block_kit/configuration.rb +25 -0
- data/lib/block_kit/version.rb +1 -1
- data/lib/block_kit.rb +14 -3
- metadata +3 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a142c83644eae7923a991bffd10fab97d37a473a9b1cd0f272ffe095bec84e76
|
|
4
|
+
data.tar.gz: b85f5fd6a7bc53e2c10ea911aa12c6a1eb04ff5534ba9b204c65636ac429ef29
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7c2e1713de7c0136bf9fc7a6180876214c345a16d51d0f9a1391128f58bd6d9b5ec0c2f3c820b0b425b25db81e524e6a3c185890c199cd17454f5efed050c30
|
|
7
|
+
data.tar.gz: 7b7537a078c37df48f3ff1a468c4f495cdd6e21777a6267f3c4595889e4be9858903f2859843f1489068e8491da4fab441c13bb7e9566560d9d3d9f5e14a294f
|
data/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ruby
|
|
1
|
+
ruby 4.0.1
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module BlockKit
|
|
2
|
+
class Configuration
|
|
3
|
+
# Controls whether or not calling `valid?` or `validate` on a block or surface
|
|
4
|
+
# will automatically apply any fixes that would make the block or surface valid.
|
|
5
|
+
attr_accessor :autofix_on_validation
|
|
6
|
+
|
|
7
|
+
# Controls whether or not calling `as_json` on a block or surface will automatically
|
|
8
|
+
# apply any fixes that would make the block or surface valid.
|
|
9
|
+
attr_accessor :autofix_on_render
|
|
10
|
+
|
|
11
|
+
# Controls whether or not autofixes that may change the behavior of your view should
|
|
12
|
+
# be called. This is useful if you would rather post messages or publish views at the
|
|
13
|
+
# cost of behavioral quirks or changes rather than suffer from `invalid_blocks` errors.
|
|
14
|
+
#
|
|
15
|
+
# If you'd prefer to run dangerous autofixers on demand, you can do this by
|
|
16
|
+
# calling `fix_validation_errors(dangerous: true)` on your blocks or surfaces.
|
|
17
|
+
attr_accessor :autofix_dangerously
|
|
18
|
+
|
|
19
|
+
def initialize
|
|
20
|
+
@autofix_on_validation = false
|
|
21
|
+
@autofix_on_render = false
|
|
22
|
+
@autofix_dangerously = false
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/block_kit/version.rb
CHANGED
data/lib/block_kit.rb
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "active_support/
|
|
3
|
+
require "active_support/core_ext/module/attribute_accessors"
|
|
4
4
|
|
|
5
5
|
module BlockKit
|
|
6
|
-
include ActiveSupport::Configurable
|
|
7
|
-
|
|
8
6
|
autoload :Base, "block_kit/base"
|
|
9
7
|
autoload :Blocks, "block_kit/blocks"
|
|
10
8
|
autoload :Composition, "block_kit/composition"
|
|
@@ -18,8 +16,21 @@ module BlockKit
|
|
|
18
16
|
autoload :Types, "block_kit/types"
|
|
19
17
|
autoload :Validators, "block_kit/validators"
|
|
20
18
|
|
|
19
|
+
autoload :Configuration, "block_kit/configuration"
|
|
21
20
|
autoload :VERSION, "block_kit/version"
|
|
22
21
|
|
|
22
|
+
mattr_reader :configuration, default: Configuration.new, instance_reader: false, instance_accessor: false
|
|
23
|
+
|
|
24
|
+
class << self
|
|
25
|
+
alias_method :config, :configuration
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.configure(&block)
|
|
29
|
+
raise ArgumentError, "BlockKit.configure requires a block" unless block_given?
|
|
30
|
+
|
|
31
|
+
yield(configuration)
|
|
32
|
+
end
|
|
33
|
+
|
|
23
34
|
def self.blocks(attributes = {}, &block)
|
|
24
35
|
Blocks.new(attributes, &block)
|
|
25
36
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: block-kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Celis
|
|
@@ -23,20 +23,6 @@ dependencies:
|
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
25
|
version: 7.0.0
|
|
26
|
-
- !ruby/object:Gem::Dependency
|
|
27
|
-
name: activesupport
|
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
|
29
|
-
requirements:
|
|
30
|
-
- - ">="
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: 7.0.0
|
|
33
|
-
type: :runtime
|
|
34
|
-
prerelease: false
|
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
-
requirements:
|
|
37
|
-
- - ">="
|
|
38
|
-
- !ruby/object:Gem::Version
|
|
39
|
-
version: 7.0.0
|
|
40
26
|
description: A powerful and flexible DSL-based library for Slack's Block Kit framework,
|
|
41
27
|
built on ActiveModel.
|
|
42
28
|
email:
|
|
@@ -82,6 +68,7 @@ files:
|
|
|
82
68
|
- lib/block_kit/concerns/has_placeholder.rb
|
|
83
69
|
- lib/block_kit/concerns/has_rich_text_elements.rb
|
|
84
70
|
- lib/block_kit/concerns/plain_text_emoji_assignment.rb
|
|
71
|
+
- lib/block_kit/configuration.rb
|
|
85
72
|
- lib/block_kit/elements.rb
|
|
86
73
|
- lib/block_kit/elements/base.rb
|
|
87
74
|
- lib/block_kit/elements/base_button.rb
|
|
@@ -185,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
185
172
|
- !ruby/object:Gem::Version
|
|
186
173
|
version: '0'
|
|
187
174
|
requirements: []
|
|
188
|
-
rubygems_version:
|
|
175
|
+
rubygems_version: 4.0.3
|
|
189
176
|
specification_version: 4
|
|
190
177
|
summary: A powerful DSL-based library for Slack's Block Kit framework.
|
|
191
178
|
test_files: []
|