slkecho 1.3.0 → 1.4.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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -0
- data/lib/slkecho/cli.rb +2 -1
- data/lib/slkecho/option_parser.rb +2 -1
- data/lib/slkecho/options.rb +1 -1
- data/lib/slkecho/slack_request/post_message.rb +3 -2
- data/lib/slkecho/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: 60840e25954d5f27219da1751cc8afd0659d8fad0011d9801f392d73eff0fbdd
|
4
|
+
data.tar.gz: 01146cb293d39c8e1d7b01ff6748dbca25c3f6a35316b24ec5ef2ddb951d5f62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a61dc7880593a6cd2f4b53be89f5db6ec22431d086640e770092925751e6cb049f4fe852e061cc8524e69ee99c765134de4a178b31a343cb922aa6d5fcb9be1
|
7
|
+
data.tar.gz: fc30c5af4a5fca0defd1a3e87651ff4389e1a19767a5ab16915864d95341caa47abaa34a28d3afdfceb113fcc44f8767e24978565b9859934a41c2040b0221c1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -50,6 +50,10 @@ Specify mention to post message. user email or user id (starts `U`).
|
|
50
50
|
|
51
51
|
Specify the username for the published message.
|
52
52
|
|
53
|
+
#### --icon-emoji <emoji> (optional)
|
54
|
+
|
55
|
+
Specify an emoji for the speaker's icon. e.g.) `:smile:`
|
56
|
+
|
53
57
|
## Contributing
|
54
58
|
|
55
59
|
Bug reports and pull requests are welcome on GitHub at https://github.com/okonomi/slkecho.
|
data/lib/slkecho/cli.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Slkecho
|
4
4
|
class OptionParser
|
5
|
-
def option_parser # rubocop:disable Metrics/AbcSize
|
5
|
+
def option_parser # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
|
6
6
|
@option_parser ||= ::OptionParser.new do |o|
|
7
7
|
o.banner = "Usage: slkecho [options] message"
|
8
8
|
o.program_name = "slkecho"
|
@@ -12,6 +12,7 @@ module Slkecho
|
|
12
12
|
o.on("-m", "--mention EMAIL", "Mention to user by email") { @options.mention = _1 }
|
13
13
|
o.on("--username USERNAME", "Set your bot's user name") { @options.username = _1 }
|
14
14
|
o.on("--icon-url ICON_URL", "URL to an image to use as the icon for this message") { @options.icon_url = _1 }
|
15
|
+
o.on("--icon-emoji ICON_EMOJI", "Emoji to use as the icon for this message") { @options.icon_emoji = _1 }
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
data/lib/slkecho/options.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Slkecho
|
4
4
|
module SlackRequest
|
5
5
|
class PostMessage
|
6
|
-
Params = Struct.new(:channel, :message, :subject, :user_id, :username, :icon_url, keyword_init: true)
|
6
|
+
Params = Struct.new(:channel, :message, :subject, :user_id, :username, :icon_url, :icon_emoji, keyword_init: true)
|
7
7
|
|
8
8
|
def initialize(slack_api_token:)
|
9
9
|
@slack_api_token = slack_api_token
|
@@ -36,7 +36,8 @@ module Slkecho
|
|
36
36
|
"channel" => params.channel,
|
37
37
|
"blocks" => [],
|
38
38
|
"username" => params.username,
|
39
|
-
"icon_url" => params.icon_url
|
39
|
+
"icon_url" => params.icon_url,
|
40
|
+
"icon_emoji" => params.icon_emoji
|
40
41
|
}
|
41
42
|
body["blocks"] << header_block(params.subject) unless params.subject.nil?
|
42
43
|
body["blocks"] << section_block(params.message, user_id: params.user_id)
|
data/lib/slkecho/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slkecho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- okonomi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Post message to Slack like echo command.
|
14
14
|
email:
|