slack_line 1.3 → 1.4
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/CHANGELOG.md +9 -0
- data/README.md +7 -5
- data/lib/slack_line/section_context.rb +2 -0
- data/lib/slack_line/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cd84ee81b09ef89c3f46abcd5c595c29f3ced087632368f343aded9e20ac731
|
|
4
|
+
data.tar.gz: b17c80d061d6c9a72ae68321079414213905baaed8d9f2b976a95d3c8fcbc4cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1ff7cc5918a5b9395496814e1bbdb8494449ec202fd08ebd584afb1991d532cd9c62581e3c561d95acf2f308c5abea071c6b697a2754204103c15b8da81ef790
|
|
7
|
+
data.tar.gz: bfb562e958ec5d2b71a1d8bb1c895f2fd34b4e1a6c9cd5d557de4454f584cd77cc95db2e916ebc9e769b79128d62ea10e71da8a6de75a686e1cf93ef82674e4f
|
data/CHANGELOG.md
CHANGED
|
@@ -21,3 +21,12 @@ Added disk-caching for the users and groups lists, through the `cache_path` and
|
|
|
21
21
|
`message` and `thread` now accept `to:`, as the README showed. Declared `reline`
|
|
22
22
|
as a runtime dependency, which fixes a warning or `LoadError` under Bundler on
|
|
23
23
|
Ruby 4.0. The invalid content error now lists the classes of the bad arguments.
|
|
24
|
+
|
|
25
|
+
## Version 1.4
|
|
26
|
+
|
|
27
|
+
**Breaking change:** calling `text` more than once in a `section` now raises an
|
|
28
|
+
`ArgumentError`. It used to silently keep only the last text, because a Slack
|
|
29
|
+
section block has one text field. Use one `section` per text.
|
|
30
|
+
|
|
31
|
+
Fixed README examples that didn't run, including `context` inside a `section`,
|
|
32
|
+
which Slack doesn't allow.
|
data/README.md
CHANGED
|
@@ -13,13 +13,15 @@ sent_message = SlackLine.message("Something happened!", to: "#general").post
|
|
|
13
13
|
|
|
14
14
|
# Construct a more complex message, then send it
|
|
15
15
|
msg = SlackLine.message do
|
|
16
|
+
context "Don't worry! If this message surprises you, context @foobar"
|
|
17
|
+
|
|
18
|
+
# Like a Slack section block, a section holds one text and one link
|
|
16
19
|
section do
|
|
17
|
-
context "Don't worry! If this message surprises you, context @foobar"
|
|
18
20
|
text "A thing has happened"
|
|
19
|
-
text "Yeah, it happened for sure"
|
|
20
21
|
link "How bad?", problems_path(problem.id)
|
|
21
22
|
end
|
|
22
23
|
|
|
24
|
+
text "Yeah, it happened for sure"
|
|
23
25
|
text "More details.."
|
|
24
26
|
end
|
|
25
27
|
sent_message = msg.post(to: "#general")
|
|
@@ -51,7 +53,7 @@ To update a SentThread, you'll need to choose message:
|
|
|
51
53
|
```ruby
|
|
52
54
|
sent_message.update "Edit: never mind, false alarm"
|
|
53
55
|
sent_thread.first.update "Problem Resolved!"
|
|
54
|
-
sent_thread.detect { |m| m
|
|
56
|
+
sent_thread.detect { |m| m.content.to_s.include?("Not yet safe") }&.update do
|
|
55
57
|
text "it's safe now"
|
|
56
58
|
end
|
|
57
59
|
```
|
|
@@ -119,7 +121,7 @@ SlackLine methods dispatch to), but you can construct additional clients
|
|
|
119
121
|
with their own configs easily:
|
|
120
122
|
|
|
121
123
|
```ruby
|
|
122
|
-
|
|
124
|
+
SlackLine.configure do |config|
|
|
123
125
|
config.slack_token = ENV["TOKEN"]
|
|
124
126
|
config.default_channel = "#general"
|
|
125
127
|
config.bot_name = "FooBot"
|
|
@@ -128,7 +130,7 @@ end
|
|
|
128
130
|
# Now SlackLine.message (et al) will use SlackLine.client,
|
|
129
131
|
# configured as above.
|
|
130
132
|
|
|
131
|
-
BAR_SLACK = SlackLine::Client.new(default_channel: "#team-bar", bot_name: "BarBot")
|
|
133
|
+
BAR_SLACK = SlackLine::Client.new(SlackLine.configuration, default_channel: "#team-bar", bot_name: "BarBot")
|
|
132
134
|
|
|
133
135
|
# And now you can call those methods on `BAR_SLACK` to use a different
|
|
134
136
|
# default channel and name
|
data/lib/slack_line/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: slack_line
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.4'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Mueller
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|