slackblocks 2.5.0 → 2.6.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: 9dcbdcf2798b0c73114cdf30db0afbf6606e3ea8a3533b29171621e5a3415f48
4
- data.tar.gz: 101404a4d300ac0ea813a0b70b31fb6301348158d3ee43794c391d35b5585296
3
+ metadata.gz: b86de1446371ca100792128ca4ac68107876bba98439e5340fdeb7e2a0b9eb07
4
+ data.tar.gz: 923192455a872458d28587fd5823a0fc6c04086be96c391f74eb3816aad56701
5
5
  SHA512:
6
- metadata.gz: 7d8206a548bda392603f75ca6f46e979945eb16842b9541997afc6bc39b7672b77556c0636e0e72c67c057c1a3f541c82bb2d6cf5795009b5dca6706b4fcecf9
7
- data.tar.gz: a9bc196c52ab8df1caefa398cfe30f818d3f4b0696a8e6bb3138e4997a3040ac3df1353f41e80f7856b63c3f59db742c1355b671a85ec70548c6120ba24cb64e
6
+ metadata.gz: 89659a3417af1cb4daa2ad3be2a74f6d4239bd765213ddb1f87a27d61faa7b286c3ca7112bb0454c66b116d9c8ca9b6cf76a9184992d27327abb861b368ae58d
7
+ data.tar.gz: 280ea4cc5cd88a23810e64a7b70a5beec4e3849394ceeea8c3f66515e22c7f21c13a9f1d3ef3b12907fa6005e4d096bb096f0dfa9881adba0def24d8a7c88ee2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [Unreleased]
4
+
5
+ ## [2.6.0] — 2026-10-09
6
+
7
+ - Keep application metadata outside message-wide Block Kit text totals.
8
+
9
+ - Release alongside the new native Rust implementation; supported language versions are unchanged.
10
+
3
11
  ## [2.5.0] — 2026-09-28
4
12
 
5
13
  - Initial Ruby implementation of the shared Block Kit model.
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # slackblocks for Ruby
2
2
 
3
+ [![RubyGems](https://img.shields.io/gem/v/slackblocks?logo=rubygems)](https://rubygems.org/gems/slackblocks)
4
+ [![Ruby CI](https://github.com/nicklambourne/slackblocks/actions/workflows/ruby.yml/badge.svg?branch=master)](https://github.com/nicklambourne/slackblocks/actions/workflows/ruby.yml)
5
+
3
6
  Build and validate Slack Block Kit payloads with Ruby 3.3 or newer. The gem implements shared spec 1.2.0 and uses only Ruby's JSON default gem at runtime.
4
7
 
5
- Install from the repository while the first Ruby release is being prepared:
8
+ Install from RubyGems:
6
9
 
7
- cd ruby
8
- gem build slackblocks.gemspec
9
- gem install ./slackblocks-2.5.0.gem
10
+ gem install slackblocks
10
11
 
11
12
  Use keyword arguments for every value:
12
13
 
@@ -159,7 +159,8 @@ module Slackblocks
159
159
  def self.message(wire, path)
160
160
  surface(wire["blocks"] || [], "message", "#{path}.blocks")
161
161
  totals = {"markdown" => 0, "data_table" => 0}
162
- tally(wire, totals)
162
+ tally(wire["blocks"], totals)
163
+ (wire["attachments"] || []).each { |attachment| tally(attachment["blocks"], totals) }
163
164
  if totals["markdown"] > limit("markdown.total_text.max_length")
164
165
  fail!("length-exceeded", path, "message markdown total exceeded")
165
166
  end
@@ -175,8 +176,8 @@ module Slackblocks
175
176
  totals["markdown"] += node.fetch("text").length
176
177
  elsif node["type"] == "data_table"
177
178
  totals["data_table"] += characters(node.fetch("rows"))
178
- else
179
- node.each_value { |child| tally(child, totals) }
179
+ elsif node["type"] == "container"
180
+ tally(node["child_blocks"], totals)
180
181
  end
181
182
  when Array
182
183
  node.each { |child| tally(child, totals) }
@@ -1,4 +1,4 @@
1
1
  module Slackblocks
2
- VERSION = "2.5.0"
2
+ VERSION = "2.6.0"
3
3
  SPEC_VERSION = "1.2.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slackblocks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Lambourne