slack_message 3.0.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100c64a0e3204d4715ffde4c0a11e0b380c7966289b8b841ef2ab7cb73f657b2
4
- data.tar.gz: 3213f9c1817a211f57685002025dc72929f41652ba7c9e69e62d5314508fc3dd
3
+ metadata.gz: 2b4cc88c84b2a958d75262b0d1fea97de8b7b694555159e4962a4a9fa16c55f6
4
+ data.tar.gz: 750afd5d7321952cc9dbf344d6db3659f85d916f988ca7ac3e56ec615cde4b34
5
5
  SHA512:
6
- metadata.gz: 238cdf0160b6c2101cbabdadef3818dd0bcd2163d9a3ababba854affa0fbaca2533489aa203b27a2309af8e85aa7e814786a9ce8eb29dd51d949cefc1d209921
7
- data.tar.gz: b0ad7654cfcac475f32eb81ede6e730046ef3721190ae1f255ceaff58331fbf6d4ee570a290dc16e660ca32611cc8639998677c5980f2eaaedd72388293b22df
6
+ metadata.gz: 7eb4393b8e51b899a65abe790f4e217522441274bc6cc418ea21e43257716d218ad87fbddfce2fd7521f4305840312967249f4faf20261f5f7b665ec01d55896
7
+ data.tar.gz: ce790defaa92aeea75683771a85ef827386a1275524ac6006139aa3db58e387797ae5f8b8623e6896f07c5af0e6fd881b2878bac1cadf1be398333ab20066a2c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.0] - TBD
4
+ - Methods from the calling context can now be called within a section block.
5
+
3
6
  ## [3.0.2] - 2022-04-16
4
7
  - Fix tests on ruby 3.0.
5
8
  - More adjustments and additions to docs.
@@ -272,6 +272,10 @@ class SlackMessage::Dsl
272
272
 
273
273
  body
274
274
  end
275
+
276
+ def method_missing(meth, *args, &blk)
277
+ @parent.send meth, *args, &blk
278
+ end
275
279
  end
276
280
 
277
281
  class List
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'slack_message'
3
- gem.version = "3.0.2"
3
+ gem.version = "3.1.0"
4
4
  gem.summary = "A nice DSL for composing rich messages in Slack"
5
5
  gem.authors = ["Joe Mastey"]
6
6
  gem.email = 'hello@joemastey.com'
@@ -4,6 +4,10 @@ RSpec.describe SlackMessage do
4
4
 
5
5
  describe "DSL" do
6
6
  describe "#build" do
7
+ def outer_method
8
+ "foo"
9
+ end
10
+
7
11
  it "renders some JSON" do
8
12
  SlackMessage.configure do |config|
9
13
  config.clear_profiles!
@@ -13,11 +17,17 @@ RSpec.describe SlackMessage do
13
17
  expected_output = [
14
18
  { type: "section",
15
19
  text: { text: "foo", type: "mrkdwn" }
16
- }
20
+ },
21
+ { type: "section",
22
+ text: { text: "foo", type: "mrkdwn" }
23
+ },
17
24
  ]
18
25
 
19
26
  output = SlackMessage.build do
20
- text "foo"
27
+ text outer_method()
28
+ section do
29
+ text outer_method()
30
+ end
21
31
  end
22
32
 
23
33
  expect(output).to eq(expected_output)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack_message
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Mastey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-16 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec