ruboty-slack_rtm 3.2.0 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruboty/adapters/slack_rtm.rb +19 -15
- data/lib/ruboty/slack_rtm/client.rb +7 -1
- data/lib/ruboty/slack_rtm/version.rb +1 -1
- data/ruboty-slack_rtm.gemspec +3 -3
- metadata +18 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcd8fe1175e9a47b5cb4428fd8ab3562d09c60ebc3e3974f104894759bef259b
|
4
|
+
data.tar.gz: a686e3ec96b2659a6ed08308ca24ef2774083562b1515f3fc3d28d9d330fe0a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6d8dad32d31f3bf3552c3217636670b2ae9b7c5a425994748076db394f55e97dbc0abfe80bdc8f955e1b500dd5d9ba277f1d0dba10c7ab61fcbc6159270214d
|
7
|
+
data.tar.gz: fb8b7eaa22b275c7601fc5c1a12b56a95549bdfe669a1d2075d335ce566f764425c17b95e77ba4bc6082508385a0a213dd8c003cf263cc87ab65beddefc0a1a5
|
@@ -29,35 +29,39 @@ module Ruboty
|
|
29
29
|
|
30
30
|
return unless channel
|
31
31
|
|
32
|
+
args = {
|
33
|
+
as_user: true
|
34
|
+
}
|
35
|
+
if message[:thread_ts] || (message[:original] && message[:original][:thread_ts])
|
36
|
+
args.merge!(thread_ts: message[:thread_ts] || message[:original][:thread_ts])
|
37
|
+
end
|
38
|
+
|
32
39
|
if message[:attachments] && !message[:attachments].empty?
|
33
|
-
|
40
|
+
args.merge!(
|
34
41
|
channel: channel,
|
35
|
-
text: message[:code] ?
|
42
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : message[:body],
|
36
43
|
parse: message[:parse] || 'full',
|
37
44
|
unfurl_links: true,
|
38
|
-
|
39
|
-
attachments: message[:attachments].to_json,
|
40
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
45
|
+
attachments: message[:attachments].to_json
|
41
46
|
)
|
47
|
+
client.chat_postMessage(args)
|
42
48
|
elsif message[:file]
|
43
49
|
path = message[:file][:path]
|
44
|
-
|
50
|
+
args.merge!(
|
45
51
|
channels: channel,
|
46
|
-
as_user: true,
|
47
52
|
file: Faraday::UploadIO.new(path, message[:file][:content_type]),
|
48
53
|
title: message[:file][:title] || path,
|
49
54
|
filename: File.basename(path),
|
50
|
-
initial_comment: message[:body] || ''
|
51
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
55
|
+
initial_comment: message[:body] || ''
|
52
56
|
)
|
57
|
+
client.files_upload(args)
|
53
58
|
else
|
54
|
-
|
59
|
+
args.merge!(
|
55
60
|
channel: channel,
|
56
|
-
text: message[:code] ?
|
57
|
-
|
58
|
-
mrkdwn: true,
|
59
|
-
thread_ts: message[:thread_ts] || message[:original][:thread_ts]
|
61
|
+
text: message[:code] ? "```\n#{message[:body]}\n```" : resolve_send_mention(message[:body]),
|
62
|
+
mrkdwn: true
|
60
63
|
)
|
64
|
+
client.chat_postMessage(args)
|
61
65
|
end
|
62
66
|
end
|
63
67
|
|
@@ -329,7 +333,7 @@ module Ruboty
|
|
329
333
|
@channel_info_caches[channel_id] ||= begin
|
330
334
|
resp = case channel_id
|
331
335
|
when /^C/
|
332
|
-
client.
|
336
|
+
client.conversations_info(channel: channel_id)
|
333
337
|
else
|
334
338
|
{}
|
335
339
|
end
|
@@ -65,7 +65,13 @@ module Ruboty
|
|
65
65
|
Thread.start do
|
66
66
|
loop do
|
67
67
|
sleep(30)
|
68
|
-
|
68
|
+
begin
|
69
|
+
@client.send('', type: 'ping')
|
70
|
+
rescue => e
|
71
|
+
Ruboty.logger.error("#{e.class}: #{e.message}\n#{e.backtrace.join("\n")}")
|
72
|
+
@queue.enq(CONNECTION_CLOSED)
|
73
|
+
break
|
74
|
+
end
|
69
75
|
end
|
70
76
|
end
|
71
77
|
end
|
data/ruboty-slack_rtm.gemspec
CHANGED
@@ -18,12 +18,12 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler'
|
22
|
-
spec.add_development_dependency 'rake'
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
23
|
spec.add_development_dependency 'rubocop', '>= 0.28.0'
|
24
24
|
|
25
25
|
spec.add_dependency 'ruboty', '>= 1.1.4'
|
26
26
|
spec.add_dependency 'slack-api', '~> 1.6'
|
27
|
-
spec.add_dependency 'websocket-client-simple', '
|
27
|
+
spec.add_dependency 'websocket-client-simple', '>= 0.5.0'
|
28
28
|
spec.add_dependency 'faraday', '~> 0.11'
|
29
29
|
end
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruboty-slack_rtm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Kusano
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +84,16 @@ dependencies:
|
|
84
84
|
name: websocket-client-simple
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0.
|
89
|
+
version: 0.5.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0.
|
96
|
+
version: 0.5.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: faraday
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,7 @@ homepage: https://github.com/rosylilly/ruboty-slack_rtm
|
|
132
132
|
licenses:
|
133
133
|
- MIT
|
134
134
|
metadata: {}
|
135
|
-
post_install_message:
|
135
|
+
post_install_message:
|
136
136
|
rdoc_options: []
|
137
137
|
require_paths:
|
138
138
|
- lib
|
@@ -147,8 +147,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.
|
151
|
-
signing_key:
|
150
|
+
rubygems_version: 3.3.2
|
151
|
+
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: Slack real time messaging adapter for Ruboty
|
154
154
|
test_files: []
|