slack-ruby-client 0.13.0 → 0.13.1

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: 7a9bf266ef0726336ea6cdd36426970d5a21663646cf066e72a74a23b4c175d6
4
- data.tar.gz: e36dd13202ddfe6bb65cc2bfde27f8ac27350da4114dfdf9545d1c6f2d0f0611
3
+ metadata.gz: ab472063785c95f073bf42b275abd64d6189eb81d93187710b0be994216af4c5
4
+ data.tar.gz: 3c3621f8dd346a3e6cb87510547b455493a95ba89e27fc8abf844d25a9b1bf88
5
5
  SHA512:
6
- metadata.gz: 5ab13f62322d8f5b9f3b6723a003fc7303806b03f42a68d53eaf2bf12d6f96375d895c03ce6a4657cd26f74ce2c137fb04c4b88946ff0e3c5dbd8076ea285ee2
7
- data.tar.gz: cf23b660a516ce28249b8de57e814bd997e828f712c467db46c28a6ea9be64827cf82d594369df686b4ab3c00c4a4968a40f83308b73d49b19469d667c385551
6
+ metadata.gz: 0aafa2c9b320423d1d60e6edfb7ab5683ce574a6cb6af8a5585be988ea87864e43fe2cea32a387c25716e699a5ff7cbcc353418151f89105d6427954fa24c0fb
7
+ data.tar.gz: 559cba90e5ab1906c035399b598a6279441696418c2c5d77ec2040aa6445e244a71c97d5f6d39dcd8c5ded21841e4c0bf1d3c05d2f02b066b233beb6524dc4bf
@@ -1,11 +1,14 @@
1
- ### 0.13.0 (Next)
1
+ ### 0.13.1 (2018/9/30)
2
+
3
+ * [#228](https://github.com/slack-ruby/slack-ruby-client/pull/228): Replace `Thread` with `Actor` in Celluloid async support - [@dblock](https://github.com/dblock).
4
+
5
+ ### 0.13.0 (2018/9/8)
2
6
 
3
7
  * [#219](https://github.com/slack-ruby/slack-ruby-client/pull/219): Added support for `async-websocket` - [@dblock](https://github.com/dblock), [@ioquatix](https://github.com/ioquatix).
4
- * [#224](https://github.com/slack-ruby/slack-ruby-client/pull/224): Celluloid async support now uses a thread per client - [@dblock](https://github.com/dblock).
8
+ * [#224](https://github.com/slack-ruby/slack-ruby-client/pull/224): Celluloid async support now uses a thread per client - [@dblock](https://github.com/dblock).
5
9
  * [#224](https://github.com/slack-ruby/slack-ruby-client/pull/224): Attempt to shutdown EventMachine if a reactor wasn't already running on start - [@dblock](https://github.com/dblock).
6
- * Your contribution here.
7
10
 
8
- ### 0.12.0 (8/20/2018)
11
+ ### 0.12.0 (2018/8/20)
9
12
 
10
13
  * [#216](https://github.com/slack-ruby/slack-ruby-client/pull/216): Handle `Errno::ECONNRESET` and empty buffer reads with celluloid-io - [@dblock](https://github.com/dblock).
11
14
  * [#215](https://github.com/slack-ruby/slack-ruby-client/pull/215): Web API `groups_list`, `files_info`, `mpim_list`, `reactions_list` and `stars_list` now support cursor pagination - [@hotwatermorning](https://github.com/hotwatermorning).
@@ -17,14 +20,14 @@
17
20
  * [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): Upgraded RuboCop to 0.58.2 - [@dblock](https://github.com/dblock).
18
21
  * [#217](https://github.com/slack-ruby/slack-ruby-client/pull/217): No longer tested with Ruby 2.1, added 2.5 - [@dblock](https://github.com/dblock).
19
22
 
20
- ### 0.11.1 (1/23/2018)
23
+ ### 0.11.1 (2018/1/23)
21
24
 
22
25
  * [#187](https://github.com/slack-ruby/slack-ruby-client/pull/187): Concatenate error message when multiple errors present - [@chrislopresto](https://github.com/chrislopresto).
23
26
  * [#188](https://github.com/slack-ruby/slack-ruby-client/pull/188): Fixed `NoMethodError` when Slack is unavailable - [@sonicdoe](https://github.com/sonicdoe).
24
27
  * [#196](https://github.com/slack-ruby/slack-ruby-client/pull/196): Added `users_lookupByEmail` - [@manuelmeurer](https://github.com/manuelmeurer).
25
28
  * [#185](https://github.com/slack-ruby/slack-ruby-client/pull/185): Calling undocumented endpoints will now produce a warning - [@aviflombaum](https://github.com/aviflombaum).
26
29
 
27
- ### 0.11.0 (11/25/2017)
30
+ ### 0.11.0 (2017/11/25)
28
31
 
29
32
  * [#173](https://github.com/slack-ruby/slack-ruby-client/issues/173): Added dialog support - [@alexagranov](https://github.com/alexagranov).
30
33
  * [#176](https://github.com/slack-ruby/slack-ruby-client/issues/176): Drop dependency on `json` gem - [@seuros](https://github.com/seuros).
@@ -33,7 +36,7 @@
33
36
  * [#181](https://github.com/slack-ruby/slack-ruby-client/pull/181): Added `chat_getPermalink`, `migration_exchange` - [@dblock](https://github.com/dblock).
34
37
  * [#182](https://github.com/slack-ruby/slack-ruby-client/pull/182): Added undocumented methods support with `channels_delete`, `chat_command`, `files_edit`, `files_share`, `users_admin_invite`, `users_admin_setInactive` and `users_prefs_get` - [@dblock](https://github.com/dblock).
35
38
 
36
- ### 0.10.0 (9/19/2017)
39
+ ### 0.10.0 (2017/9/19)
37
40
 
38
41
  * [#169](https://github.com/slack-ruby/slack-ruby-client/pull/169): Added [Conversations API](https://api.slack.com/docs/conversations-api) - [@jmanian](https://github.com/jmanian).
39
42
  * [#169](https://github.com/slack-ruby/slack-ruby-client/pull/169): Added `include_locale` parameter to several methods (`channels_info`, `groups_info`, `im_open`, `rtm_start`, `users_info`, `users_list`) - [@jmanian](https://github.com/jmanian).
@@ -44,25 +47,25 @@
44
47
  * [#162](https://github.com/slack-ruby/slack-ruby-client/pull/162): Gracefully close websocket on `Errno::EPIPE` - [@johanoskarsson](https://github.com/johanoskarsson).
45
48
  * [#172](https://github.com/slack-ruby/slack-ruby-client/pull/172): Use `rtm.start` when store is a subclass of `Slack::RealTime::Stores::Store` (default) - [@kstole](https://github.com/kstole).
46
49
 
47
- ### 0.9.1 (8/24/2017)
50
+ ### 0.9.1 (2017/8/24)
48
51
 
49
52
  * [#158](https://github.com/slack-ruby/slack-ruby-client/issues/158): Updated to latest slack-api-ref; Updated chat.3.update patch to reflect argument reordering; Added chat.4.postEphemeral patch to apply the attachments JSON fix (whitespace last line of diff matters! ;-) - [@alexagranov](https://github.com/alexagranov).
50
53
 
51
- ### 0.9.0 (8/6/2017)
54
+ ### 0.9.0 (2017/8/6)
52
55
 
53
56
  * [#146](https://github.com/slack-ruby/slack-ruby-client/issues/146): Fix: `undefined method running?` and `ThreadError: Target thread must not be current thread` with `Celluloid::IO` - [@dblock](https://github.com/dblock).
54
57
  * [#145](https://github.com/slack-ruby/slack-ruby-client/pull/145): Automatically select `rtm_connect` vs. `rtm_start` - [@dblock](https://github.com/dblock).
55
58
  * [#154](https://github.com/slack-ruby/slack-ruby-client/pull/154): Raise a dedicated error class with 429 responses - [@greggroth](https://github.com/greggroth).
56
59
  * [#154](https://github.com/slack-ruby/slack-ruby-client/pull/154): Namespace error classes under `Slack::Web::Api::Errors` module - [@greggroth](https://github.com/greggroth).
57
60
 
58
- ### 0.8.1 (4/28/2017)
61
+ ### 0.8.1 (2017/4/28)
59
62
 
60
63
  * Added `exclude_members` option to `channels_list` Web API - [@dblock](https://github.com/dblock).
61
64
  * Added `chat_unfurl` to Web API - [@dblock](https://github.com/dblock).
62
65
  * Added `rtm_connect` to RTM API - [@dblock](https://github.com/dblock).
63
66
  * Added `no_latest` support to `rm_start` RTM API - [@dblock](https://github.com/dblock).
64
67
 
65
- ### 0.8.0 (3/12/2017)
68
+ ### 0.8.0 (2017/3/12)
66
69
 
67
70
  * [#135](https://github.com/slack-ruby/slack-ruby-client/issues/135): Added `timeout` and `open_timeout` options to Web API - [@dblock](https://github.com/dblock).
68
71
  * [#134](https://github.com/slack-ruby/slack-ruby-client/issues/134): Set `start_options[:request][:timeout]`, used with `rtm.start` in `Slack::RealTime::Client`, to 180 seconds - [@dblock](https://github.com/dblock).
@@ -71,11 +74,11 @@
71
74
  * [#138](https://github.com/slack-ruby/slack-ruby-client/pull/138): Added `validate` option to `channels_create`, `channels_join`, `channels_rename`, `groups_create` and `groups_rename` Web APIs - [@dblock](https://github.com/dblock).
72
75
  * [#138](https://github.com/slack-ruby/slack-ruby-client/pull/138): Removed `channel` option from `files_comments_add` Web API - [@dblock](https://github.com/dblock).
73
76
 
74
- ### 0.7.9 (2/9/2017)
77
+ ### 0.7.9 (2017/2/9)
75
78
 
76
79
  * [#132](https://github.com/slack-ruby/slack-ruby-client/issues/132): Fix: you are setting a key that conflicts with a built-in method Slack::Messages::Message#presence - [@dblock](https://github.com/dblock).
77
80
 
78
- ### 0.7.8 (1/23/2017)
81
+ ### 0.7.8 (2017/1/23)
79
82
 
80
83
  * [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `thread_ts` and `reply_broadcast` options to `chat_postMessage` in Web API - [@dblock](https://github.com/dblock).
81
84
  * [#127](https://github.com/slack-ruby/slack-ruby-client/pull/127): Added `channels_replies`, `groups_replies` and `im_replies` to Web API - [@dblock](https://github.com/dblock).
@@ -87,18 +90,18 @@
87
90
  * [#81](https://github.com/slack-ruby/slack-ruby-client/pull/81): Require faraday 0.9.0 or newer - [@leppert](https://github.com/leppert).
88
91
  * [#123](https://github.com/slack-ruby/slack-ruby-client/pull/123): Fix a warning about duplicate definitions - [@michaelherold](https://github.com/michaelherold).
89
92
 
90
- ### 0.7.7 (8/29/2016)
93
+ ### 0.7.7 (2016/8/29)
91
94
 
92
95
  * [#103](https://github.com/slack-ruby/slack-ruby-client/pull/103): Added Danger, PR linting - [@dblock](https://github.com/dblock).
93
96
  * [#101](https://github.com/slack-ruby/slack-ruby-client/issues/101): Fix: protected method `close` called with EventMachine - [@dblock](https://github.com/dblock).
94
97
  * [#104](https://github.com/slack-ruby/slack-ruby-client/issues/104): Fix: thread leak in `start_async` with Celluloid - [@dblock](https://github.com/dblock).
95
98
 
96
- ### 0.7.6 (8/7/2016)
99
+ ### 0.7.6 (2016/8/7)
97
100
 
98
101
  * Added `url_verification`, `message.mpim`, `message.im`, `message.groups` and `message.channels` RealTime events - [@dblock](https://github.com/dblock).
99
102
  * The `im_open` method accepts `return_im` - [@dblock](https://github.com/dblock).
100
103
 
101
- ### 0.7.5 (6/27/2016)
104
+ ### 0.7.5 (2016/6/27)
102
105
 
103
106
  * Added `bots_info` to Web API - [@dblock](https://github.com/dblock).
104
107
  * Added `team_profile_get` and `team_billableInfo` to Web API - [@dblock](https://github.com/dblock).
@@ -106,21 +109,21 @@
106
109
  * Added `users_profile_get` and `users_profile_set` to Web API - [@dblock](https://github.com/dblock).
107
110
  * The `stars_list` method no longer takes a user - [@dblock](https://github.com/dblock).
108
111
 
109
- ### 0.7.4 (5/28/2016)
112
+ ### 0.7.4 (2016/5/28)
110
113
 
111
114
  * [#93](https://github.com/slack-ruby/slack-ruby-client/pull/93): Fix: When using Celluloid concurrency, handle input from the TCP socket asynchronously from reading more - [@benzrf](https://github.com/benzrf).
112
115
  * Added `auth_revoke` and `users_identity` to Web API - [@dblock](https://github.com/dblock).
113
116
  * Added `channel` parameter to `files_comments_add` Web API - [@dblock](https://github.com/dblock).
114
117
 
115
- ### 0.7.3 (5/14/2016)
118
+ ### 0.7.3 (2016/5/14)
116
119
 
117
120
  * [#90](https://github.com/slack-ruby/slack-ruby-client/issues/90): Fix: Celluloid concurrency handles server-side connection closing - [@dblock](https://github.com/dblock).
118
121
 
119
- ### 0.7.2 (5/5/2016)
122
+ ### 0.7.2 (2016/5/5)
120
123
 
121
124
  * [#84](https://github.com/slack-ruby/slack-ruby-client/issues/84): Fix: Celluloid concurrency doesn't parallelize the connection setup - [@dblock](https://github.com/dblock).
122
125
 
123
- ### 0.7.1 (5/2/2016)
126
+ ### 0.7.1 (2016/5/2)
124
127
 
125
128
  * [#82](https://github.com/slack-ruby/slack-ruby-client/pull/82): Fix `usergroups.users.{list,update}` and `files.comments.{add,edit,delete}` APIs - [@masatomo](https://github.com/masatomo).
126
129
  * [#73](https://github.com/slack-ruby/slack-ruby-client/issues/73): Add a `closed` event - [@rkadyb](https://github.com/rkadyb).
@@ -129,7 +132,7 @@
129
132
  * Added `as_user` to `chat_delete` Web API - [@dblock](https://github.com/dblock).
130
133
  * Added `reminders_add`, `reminders_complete`, `reminders_delete`, `reminders_info` and `reminders_list` to Web API - [@dblock](https://github.com/dblock).
131
134
 
132
- ### 0.7.0 (3/6/2016)
135
+ ### 0.7.0 (2016/3/6)
133
136
 
134
137
  * [#68](https://github.com/slack-ruby/slack-ruby-client/issues/68): The `Slack::RealTime::Config#store_class` is now globally configurable - [@dblock](https://github.com/dblock).
135
138
  * [#67](https://github.com/slack-ruby/slack-ruby-client/pull/67): Make `logger` configurable and log HTTP requests and responses as well as RealTime events and socket data - [@mikz](https://github.com/mikz), [@dblock](https://github.com/dblock).
@@ -137,35 +140,35 @@
137
140
  * Added `files_revokePublicURL` and `files_sharedPublicURL` to Web API - [@dblock](https://github.com/dblock).
138
141
  * [#60](https://github.com/slack-ruby/slack-ruby-client/issues/60): Exceptions in event handlers and commands are no longer fatal - [@dblock](https://github.com/dblock).
139
142
 
140
- ### 0.6.0 (2/4/2016)
143
+ ### 0.6.0 (2016/2/4)
141
144
 
142
145
  * [#54](https://github.com/slack-ruby/slack-ruby-client/issues/54): RealTime client maintains a local store of team data for `client.self`, `team`, `users`, `channels`, `groups`, `ims` and `bots` data - [@dblock](https://github.com/dblock).
143
146
  * [#56](https://github.com/slack-ruby/slack-ruby-client/issues/56): API responses in both Web and RealTime clients are now instances of [Slack::Messages::Message](lib/slack/messages/message), which provides method access to properties - [@dblock](https://github.com/dblock).
144
147
  * [#57](https://github.com/slack-ruby/slack-ruby-client/issues/57): Configure arguments to pass to `rtm.start` via `config.start_options` - [@dblock](https://github.com/dblock).
145
148
  * [#52](https://github.com/slack-ruby/slack-ruby-client/issues/52): Added `users_search` - [@dblock](https://github.com/dblock).
146
149
 
147
- ### 0.5.4 (1/23/2016)
150
+ ### 0.5.4 (2016/1/23)
148
151
 
149
152
  * [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Added `channels_id`, `groups_id` and `users_id` - [@dblock](https://github.com/dblock).
150
153
  * [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Automatically lookup channel, group and user ID in Web API methods when Slack API doesn't accept #channel or @user names - [@dblock](https://github.com/dblock).
151
154
  * [#49](https://github.com/slack-ruby/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method - [@mikz](https://github.com/mikz), [@kandadaboggu](https://github.com/kandadaboggu).
152
155
 
153
- ### 0.5.3 (1/11/2016)
156
+ ### 0.5.3 (2016/1/11)
154
157
 
155
158
  * [#47](https://github.com/slack-ruby/slack-ruby-client/pull/47): Fix: default to Celluloid newer API - [@jlyonsmith](https://github.com/jlyonsmith), [@dblock](https://github.com/dblock).
156
159
  * Fixed JRuby file encoding regression - [@dblock](https://github.com/dblock).
157
160
 
158
- ### 0.5.2 (1/8/2016)
161
+ ### 0.5.2 (2016/1/8)
159
162
 
160
163
  * [#41](https://github.com/slack-ruby/slack-ruby-client/issues/41): Added `Slack::Messages::Formatting#unescape` - [@dblock](https://github.com/dblock).
161
164
  * Added `files_comments` to Web API - [@dblock](https://github.com/dblock).
162
165
 
163
- ### 0.5.1 (1/4/2016)
166
+ ### 0.5.1 (2016/1/4)
164
167
 
165
168
  * Added `dnd_teamInfo`, `dnd_setSnooze`, `dnd_info`, `dnd_endSnooze` and `dnd_endDnd` to Web API - [@dblock](https://github.com/dblock).
166
169
  * The `files_upload` method now requires both `file` and `filename` to Web API - [@dblock](https://github.com/dblock).
167
170
 
168
- ### 0.5.0 (12/7/2015)
171
+ ### 0.5.0 (2015/12/7)
169
172
 
170
173
  * Added `usergroups_create`, `usergroups_disable`, `usergroups_enable`, `usergroups_list`, `usergroups_update` and `usergroups_users` to Web API - [@dblock](https://github.com/dblock).
171
174
  * Added command-line `slack` client - [@dblock](https://github.com/dblock).
@@ -176,7 +179,7 @@
176
179
  * [#22](https://github.com/slack-ruby/slack-ruby-client/issues/22): Added `Slack::Web::Api::Error#response` - [@dblock](https://github.com/dblock).
177
180
  * Added `logger` to `Slack::Web::Client` configuration that logs HTTP requests - [@dblock](https://github.com/dblock).
178
181
 
179
- ### 0.4.0 (11/8/2015)
182
+ ### 0.4.0 (2015/11/8)
180
183
 
181
184
  * Added `team_integrationLogs` to Web API - [@dblock](https://github.com/dblock).
182
185
  * [#11](https://github.com/slack-ruby/slack-ruby-client/pull/11): Web API `chat_postMessage` errors only if both `attachments` and `text` are missing - [@dblock](https://github.com/dblock).
@@ -186,12 +189,12 @@
186
189
  * Added `unreads` to `channels_history`, `groups_history` and `im_history` to Web API - [@dblock](https://github.com/dblock).
187
190
  * Added `stars_add` and `stars_remove` to Web API - [@dblock](https://github.com/dblock).
188
191
 
189
- ### 0.3.1 (10/16/2015)
192
+ ### 0.3.1 (2015/10/16)
190
193
 
191
194
  * Added `stars_list`, `stars_add` and `stars_remove` to Web API - [@dblock](https://github.com/dblock).
192
195
  * Added `attachments`, `parse` and `link_names` to `chat_update` in Web API - [@dblock](https://github.com/dblock).
193
196
 
194
- ### 0.3.0 (9/1/2015)
197
+ ### 0.3.0 (2015/9/1)
195
198
 
196
199
  * Added `team.info` and `accessLogs` to Web API - [@dblock](https://github.com/dblock).
197
200
  * Removed obsolete `presence` Web API - [@dblock](https://github.com/dblock).
@@ -204,12 +207,12 @@
204
207
  * Use API reference schema from [github.com/dblock/slack-api-ref](https://github.com/dblock/slack-api-ref) - [@dblock](https://github.com/dblock).
205
208
  * Added `reactions_add`, `reactions_list`, `reactions_get` and `reactions_remove` to Web API - [@jakedahn](https://github.com/jakedahn).
206
209
 
207
- ### 0.2.1 (8/2/2015)
210
+ ### 0.2.1 (2015/8/2)
208
211
 
209
212
  * Set Slack API token via `Slack::RealTime::Client.new(token: 'token')` and `Slack::Web::Client.new(token: 'token')` - [@dblock](https://github.com/dblock).
210
213
  * Set Slack API token via `Slack::RealTime::Client.configure` and `Slack::Web::Client.configure` - [@dblock](https://github.com/dblock).
211
214
 
212
- ### 0.2.0 (7/31/2015)
215
+ ### 0.2.0 (2015/7/31)
213
216
 
214
217
  * [#2](https://github.com/slack-ruby/slack-ruby-client/pull/2): `Slack::RealTime::Socket` now pings frames every 30s, as recommended by Slack - [@samdoiron](https://github.com/samdoiron).
215
218
  * [#3](https://github.com/slack-ruby/slack-ruby-client/issues/3): RealTime client WebSocket frame ping frequency is now configurable with `Slack::RealTime::Client.websocket_ping` - [@dblock](https://github.com/dblock).
@@ -219,6 +222,6 @@
219
222
  * Default user-agent for `Slack::Web::Client` now includes a slash, eg. _Slack Ruby Client/0.1.1_ - [@dblock](https://github.com/dblock).
220
223
  * Fix: set `Slack::Web::Client` connection options for `ca_path`, `ca_file`, and `proxy` - [@dblock](https://github.com/dblock).
221
224
 
222
- ### 0.1.0 (7/25/2015)
225
+ ### 0.1.0 (2015/7/25)
223
226
 
224
227
  * Initial public release with Web and RealTime Messaging API support - [@dblock](https://github.com/dblock).
data/README.md CHANGED
@@ -18,7 +18,7 @@ A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messa
18
18
 
19
19
  ## Stable Release
20
20
 
21
- You're reading the documentation for the **stable** release of slack-ruby-client, v0.13.0. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
21
+ You're reading the documentation for the **stable** release of slack-ruby-client, 0.13.1. See [UPGRADING](UPGRADING.md) when upgrading from an older version.
22
22
 
23
23
  ## Installation
24
24
 
@@ -68,9 +68,12 @@ module Slack
68
68
  end
69
69
 
70
70
  def start_async(client)
71
- Thread.new do
72
- client.run_loop
73
- end
71
+ @client = client
72
+ Actor.new(future.run_client_loop)
73
+ end
74
+
75
+ def run_client_loop
76
+ @client.run_loop
74
77
  end
75
78
 
76
79
  def connected?
@@ -79,6 +82,18 @@ module Slack
79
82
 
80
83
  protected
81
84
 
85
+ class Actor
86
+ attr_reader :future
87
+
88
+ def initialize(future)
89
+ @future = future
90
+ end
91
+
92
+ def join
93
+ @future.value
94
+ end
95
+ end
96
+
82
97
  def build_socket
83
98
  socket = ::Celluloid::IO::TCPSocket.new(addr, port)
84
99
  socket = ::Celluloid::IO::SSLSocket.new(socket, build_ssl_context) if secure?
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.13.0'.freeze
2
+ VERSION = '0.13.1'.freeze
3
3
  end
@@ -29,7 +29,7 @@ RSpec.describe 'integration test', skip: (!ENV['SLACK_API_TOKEN'] || !ENV['CONCU
29
29
 
30
30
  let(:client) { Slack::RealTime::Client.new(token: ENV['SLACK_API_TOKEN']) }
31
31
 
32
- let(:connection) do
32
+ def start
33
33
  # starts the client and pushes an item on a queue when connected
34
34
  client.start_async do |driver|
35
35
  driver.on :open do |data|
@@ -55,8 +55,8 @@ RSpec.describe 'integration test', skip: (!ENV['SLACK_API_TOKEN'] || !ENV['CONCU
55
55
  logger.debug "#start_server, waiting #{dt} second(s)"
56
56
  sleep dt # prevent Slack 429 rate limit errors
57
57
  # start server and wait for on :open
58
- c = connection
59
- logger.debug "connection is #{c}"
58
+ @server = start
59
+ logger.debug "started #{@server}"
60
60
  queue.pop_with_timeout(5)
61
61
  end
62
62
 
@@ -74,7 +74,7 @@ RSpec.describe 'integration test', skip: (!ENV['SLACK_API_TOKEN'] || !ENV['CONCU
74
74
 
75
75
  after do
76
76
  wait_for_server
77
- connection.join
77
+ @server.join if @server.is_a?(::Thread)
78
78
  end
79
79
 
80
80
  context 'client connected' do
@@ -126,7 +126,6 @@ RSpec.describe 'integration test', skip: (!ENV['SLACK_API_TOKEN'] || !ENV['CONCU
126
126
 
127
127
  client.on :close do |data|
128
128
  logger.debug "client.on :close, data=#{data}"
129
- expect(client.started?).to be true
130
129
  @close_called = true
131
130
  end
132
131
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-08 00:00:00.000000000 Z
11
+ date: 2018-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport