slack-ruby-client 0.7.6 → 0.7.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b74c784c4085e18dfd0c6619ccd33d7b292e7b0
4
- data.tar.gz: 6d149b4b282b2e67f9ec42371efe738041da9d97
3
+ metadata.gz: 3f5e10e7b0b264ec6b852aad6693f3ce649b9ebc
4
+ data.tar.gz: 8f071b342768ac23044d1bef1cdff20677e7fb51
5
5
  SHA512:
6
- metadata.gz: a038220c39f84af09a2f1e57b1baa0a9d85843862a1be097233d0fc01eb2900cc1abfff8a3a5a85f27046b6af87129d494727ec658d128d5d71a86c79498cbbc
7
- data.tar.gz: c4d2837ab721dc74460040a511216f07d962a3dbb56111415a4015734c4eb71ed11c54157d26af2bd69d86a802a3baebc60a5aee8700c95e69a130fad2eb885e
6
+ metadata.gz: d2dc1764939357dcca97aeafa335615b9acb3d52e24290025c395f0ad38f52d4d69a232cb314956709ae0f3096350e60b0a60db0cdf0477c513d9ef338252892
7
+ data.tar.gz: 199bbeafef16af488a793cf57b58a335de87fa2a5b6249a59bda227385f87c4be230ed9fc04fa8ed1d1951c8c60f0eea127105e1cd63d0b2d8acda3741869faf
data/.travis.yml CHANGED
@@ -4,6 +4,9 @@ cache: bundler
4
4
 
5
5
  matrix:
6
6
  include:
7
+ - rvm: 2.3.0
8
+ script:
9
+ - bundle exec danger
7
10
  - rvm: 2.3.0
8
11
  env: CONCURRENCY=celluloid-io
9
12
  - rvm: 2.3.0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 0.7.7 (8/29/2016)
2
+
3
+ * [#103](https://github.com/slack-ruby/slack-ruby-client/pull/103): Added Danger, PR linting - [@dblock](https://github.com/dblock).
4
+ * [#101](https://github.com/slack-ruby/slack-ruby-client/issues/101): Fix: protected method `close` called with EventMachine - [@dblock](https://github.com/dblock).
5
+ * [#104](https://github.com/slack-ruby/slack-ruby-client/issues/104): Fix: thread leak in `start_async` with Celluloid - [@dblock](https://github.com/dblock).
6
+
1
7
  ### 0.7.6 (8/7/2016)
2
8
 
3
9
  * Added `url_verification`, `message.mpim`, `message.im`, `message.groups` and `message.channels` RealTime events - [@dblock](https://github.com/dblock).
@@ -13,56 +19,56 @@
13
19
 
14
20
  ### 0.7.4 (5/28/2016)
15
21
 
16
- * [#93](https://github.com/dblock/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).
22
+ * [#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).
17
23
  * Added `auth_revoke` and `users_identity` to Web API - [@dblock](https://github.com/dblock).
18
24
  * Added `channel` parameter to `files_comments_add` Web API - [@dblock](https://github.com/dblock).
19
25
 
20
26
  ### 0.7.3 (5/14/2016)
21
27
 
22
- * [#90](https://github.com/dblock/slack-ruby-client/issues/90): Fix: Celluloid concurrency handles server-side connection closing - [@dblock](https://github.com/dblock).
28
+ * [#90](https://github.com/slack-ruby/slack-ruby-client/issues/90): Fix: Celluloid concurrency handles server-side connection closing - [@dblock](https://github.com/dblock).
23
29
 
24
30
  ### 0.7.2 (5/5/2016)
25
31
 
26
- * [#84](https://github.com/dblock/slack-ruby-client/issues/84): Fix: Celluloid concurrency doesn't parallelize the connection setup - [@dblock](https://github.com/dblock).
32
+ * [#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).
27
33
 
28
34
  ### 0.7.1 (5/2/2016)
29
35
 
30
- * [#82](https://github.com/dblock/slack-ruby-client/pull/82): Fix `usergroups.users.{list,update}` and `files.comments.{add,edit,delete}` APIs - [@masatomo](https://github.com/masatomo).
31
- * [#73](https://github.com/dblock/slack-ruby-client/issues/73): Add a `closed` event - [@rkadyb](https://github.com/rkadyb).
32
- * [#69](https://github.com/dblock/slack-ruby-client/issues/69): Add attachments support for `Slack::Web::Api::Endpoints::Chat.chat_update` - [@nicka](https://github.com/nicka).
33
- * [#85](https://github.com/dblock/slack-ruby-client/issues/85): Compatibility with WebMock 2.0 - [@dblock](https://github.com/dblock).
36
+ * [#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).
37
+ * [#73](https://github.com/slack-ruby/slack-ruby-client/issues/73): Add a `closed` event - [@rkadyb](https://github.com/rkadyb).
38
+ * [#69](https://github.com/slack-ruby/slack-ruby-client/issues/69): Add attachments support for `Slack::Web::Api::Endpoints::Chat.chat_update` - [@nicka](https://github.com/nicka).
39
+ * [#85](https://github.com/slack-ruby/slack-ruby-client/issues/85): Compatibility with WebMock 2.0 - [@dblock](https://github.com/dblock).
34
40
  * Added `as_user` to `chat_delete` Web API - [@dblock](https://github.com/dblock).
35
41
  * Added `reminders_add`, `reminders_complete`, `reminders_delete`, `reminders_info` and `reminders_list` to Web API - [@dblock](https://github.com/dblock).
36
42
 
37
43
  ### 0.7.0 (3/6/2016)
38
44
 
39
- * [#68](https://github.com/dblock/slack-ruby-client/issues/68): The `Slack::RealTime::Config#store_class` is now globally configurable - [@dblock](https://github.com/dblock).
40
- * [#67](https://github.com/dblock/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).
45
+ * [#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).
46
+ * [#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).
41
47
  * Added `Slack::RealTime::Stores::Store` and `Slack::RealTime::Stores::Starter` - [@dblock](https://github.com/dblock).
42
48
  * Added `files_revokePublicURL` and `files_sharedPublicURL` to Web API - [@dblock](https://github.com/dblock).
43
- * [#60](https://github.com/dblock/slack-ruby-client/issues/60): Exceptions in event handlers and commands are no longer fatal - [@dblock](https://github.com/dblock).
49
+ * [#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).
44
50
 
45
51
  ### 0.6.0 (2/4/2016)
46
52
 
47
- * [#54](https://github.com/dblock/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).
48
- * [#56](https://github.com/dblock/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).
49
- * [#57](https://github.com/dblock/slack-ruby-client/issues/57): Configure arguments to pass to `rtm.start` via `config.start_options` - [@dblock](https://github.com/dblock).
50
- * [#52](https://github.com/dblock/slack-ruby-client/issues/52): Added `users_search` - [@dblock](https://github.com/dblock).
53
+ * [#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).
54
+ * [#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).
55
+ * [#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).
56
+ * [#52](https://github.com/slack-ruby/slack-ruby-client/issues/52): Added `users_search` - [@dblock](https://github.com/dblock).
51
57
 
52
58
  ### 0.5.4 (1/23/2016)
53
59
 
54
- * [#45](https://github.com/dblock/slack-ruby-client/issues/45): Added `channels_id`, `groups_id` and `users_id` - [@dblock](https://github.com/dblock).
55
- * [#45](https://github.com/dblock/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).
56
- * [#49](https://github.com/dblock/slack-ruby-client/pull/49): Fix: Celluloid `#connected?` method. - [@mikz](https://github.com/mikz), [@kandadaboggu](https://github.com/kandadaboggu).
60
+ * [#45](https://github.com/slack-ruby/slack-ruby-client/issues/45): Added `channels_id`, `groups_id` and `users_id` - [@dblock](https://github.com/dblock).
61
+ * [#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).
62
+ * [#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).
57
63
 
58
64
  ### 0.5.3 (1/11/2016)
59
65
 
60
- * [#47](https://github.com/dblock/slack-ruby-client/pull/47): Fix: default to Celluloid newer API - [@jlyonsmith](https://github.com/jlyonsmith), [@dblock](https://github.com/dblock).
66
+ * [#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).
61
67
  * Fixed JRuby file encoding regression - [@dblock](https://github.com/dblock).
62
68
 
63
69
  ### 0.5.2 (1/8/2016)
64
70
 
65
- * [#41](https://github.com/dblock/slack-ruby-client/issues/41): Added `Slack::Messages::Formatting#unescape` - [@dblock](https://github.com/dblock).
71
+ * [#41](https://github.com/slack-ruby/slack-ruby-client/issues/41): Added `Slack::Messages::Formatting#unescape` - [@dblock](https://github.com/dblock).
66
72
  * Added `files_comments` to Web API - [@dblock](https://github.com/dblock).
67
73
 
68
74
  ### 0.5.1 (1/4/2016)
@@ -74,18 +80,18 @@
74
80
 
75
81
  * Added `usergroups_create`, `usergroups_disable`, `usergroups_enable`, `usergroups_list`, `usergroups_update` and `usergroups_users` to Web API - [@dblock](https://github.com/dblock).
76
82
  * Added command-line `slack` client - [@dblock](https://github.com/dblock).
77
- * [#5](https://github.com/dblock/slack-ruby-client/issues/5): Added Celluloid support - [@mikz](https://github.com/mikz), [@dblock](https://github.com/dblock).
78
- * [#34](https://github.com/dblock/slack-ruby-client/pull/34): Added `Slack::RealTime::Client#start_async` - [@mikz](https://github.com/mikz), [@dblock](https://github.com/dblock).
83
+ * [#5](https://github.com/slack-ruby/slack-ruby-client/issues/5): Added Celluloid support - [@mikz](https://github.com/mikz), [@dblock](https://github.com/dblock).
84
+ * [#34](https://github.com/slack-ruby/slack-ruby-client/pull/34): Added `Slack::RealTime::Client#start_async` - [@mikz](https://github.com/mikz), [@dblock](https://github.com/dblock).
79
85
  * `Slack::RealTime::Client` supports `:open` and `:close` callbacks - [@dblock](https://github.com/dblock).
80
- * [#32](https://github.com/dblock/slack-ruby-client/issues/32): Fix: `on_complete: undefined method [] for nil:NilClass` when responding to Slack 400-500 errors - [@dblock](https://github.com/dblock).
81
- * [#22](https://github.com/dblock/slack-ruby-client/issues/22): Added `Slack::Web::Api::Error#response` - [@dblock](https://github.com/dblock).
86
+ * [#32](https://github.com/slack-ruby/slack-ruby-client/issues/32): Fix: `on_complete: undefined method [] for nil:NilClass` when responding to Slack 400-500 errors - [@dblock](https://github.com/dblock).
87
+ * [#22](https://github.com/slack-ruby/slack-ruby-client/issues/22): Added `Slack::Web::Api::Error#response` - [@dblock](https://github.com/dblock).
82
88
  * Added `logger` to `Slack::Web::Client` configuration that logs HTTP requests - [@dblock](https://github.com/dblock).
83
89
 
84
90
  ### 0.4.0 (11/8/2015)
85
91
 
86
92
  * Added `team_integrationLogs` to Web API - [@dblock](https://github.com/dblock).
87
- * [#11](https://github.com/dblock/slack-ruby-client/pull/11) - Web API `chat_postMessage` errors only if both `attachments` and `text` are missing - [@dblock](https://github.com/dblock).
88
- * [#20](https://github.com/dblock/slack-ruby-client/issues/20) - Web API `chat_postMessage` will automatically `to_json` attachments - [@dblock](https://github.com/dblock).
93
+ * [#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).
94
+ * [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20): Web API `chat_postMessage` will automatically `to_json` attachments - [@dblock](https://github.com/dblock).
89
95
  * Added `mpim_aware` to `rtm_start` to Web API - [@dblock](https://github.com/dblock).
90
96
  * Added `mpim_close`, `mpim_history`, `mpim_list`, `mpim_mark` and `mpim_open` to Web API - [@dblock](https://github.com/dblock).
91
97
  * Added `unreads` to `channels_history`, `groups_history` and `im_history` to Web API - [@dblock](https://github.com/dblock).
@@ -107,7 +113,7 @@
107
113
  * Added `files_delete` to Web API - [@dblock](https://github.com/dblock).
108
114
  * Added `as_user` to `chat_postMessage` in Web API - [@dblock](https://github.com/dblock).
109
115
  * Use API reference schema from [github.com/dblock/slack-api-ref](https://github.com/dblock/slack-api-ref) - [@dblock](https://github.com/dblock).
110
- * Added `reactions_add`, `reactions_list`, `reactions_get` and `reactions_remove` to Web API - [@jakedahn](https://github.com/jakedahn)
116
+ * Added `reactions_add`, `reactions_list`, `reactions_get` and `reactions_remove` to Web API - [@jakedahn](https://github.com/jakedahn).
111
117
 
112
118
  ### 0.2.1 (8/2/2015)
113
119
 
@@ -116,10 +122,10 @@
116
122
 
117
123
  ### 0.2.0 (7/31/2015)
118
124
 
119
- * [#2](https://github.com/dblock/slack-ruby-client/pull/2): `Slack::RealTime::Socket` now pings frames every 30s, as recommended by Slack - [@samdoiron](https://github.com/samdoiron).
120
- * [#3](https://github.com/dblock/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).
121
- * [#3](https://github.com/dblock/slack-ruby-client/issues/3): RealTime client WebSocket proxy is now configurable with `Slack::RealTime::Client.websocket_proxy` - [@dblock](https://github.com/dblock).
122
- * [#3](https://github.com/dblock/slack-ruby-client/issues/3): Added global `Slack::Web::Client` and `Slack::RealTime::Client` configuration options via `Slack::Web::Client.configure` and `Slack::RealTime::Client.configure` - [@dblock](https://github.com/dblock).
125
+ * [#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).
126
+ * [#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).
127
+ * [#3](https://github.com/slack-ruby/slack-ruby-client/issues/3): RealTime client WebSocket proxy is now configurable with `Slack::RealTime::Client.websocket_proxy` - [@dblock](https://github.com/dblock).
128
+ * [#3](https://github.com/slack-ruby/slack-ruby-client/issues/3): Added global `Slack::Web::Client` and `Slack::RealTime::Client` configuration options via `Slack::Web::Client.configure` and `Slack::RealTime::Client.configure` - [@dblock](https://github.com/dblock).
123
129
  * Exposed `Slack::RealTime::Client.url`, `team`, `self`, `users`, `channels`, `groups`, `ims` and `bots` - [@dblock](https://github.com/dblock).
124
130
  * Default user-agent for `Slack::Web::Client` now includes a slash, eg. _Slack Ruby Client/0.1.1_ - [@dblock](https://github.com/dblock).
125
131
  * Fix: set `Slack::Web::Client` connection options for `ca_path`, `ca_file`, and `proxy` - [@dblock](https://github.com/dblock).
data/CONTRIBUTING.md CHANGED
@@ -1,19 +1,19 @@
1
1
  # Contributing to Slack-Ruby-Client
2
2
 
3
- This project is work of [many contributors](https://github.com/dblock/slack-ruby-client/graphs/contributors).
3
+ This project is work of [many contributors](https://github.com/slack-ruby/slack-ruby-client/graphs/contributors).
4
4
 
5
- You're encouraged to submit [pull requests](https://github.com/dblock/slack-ruby-client/pulls), [propose features and discuss issues](https://github.com/dblock/slack-ruby-client/issues).
5
+ You're encouraged to submit [pull requests](https://github.com/slack-ruby/slack-ruby-client/pulls), [propose features and discuss issues](https://github.com/slack-ruby/slack-ruby-client/issues).
6
6
 
7
7
  In the examples below, substitute your Github username for `contributor` in URLs.
8
8
 
9
9
  ### Fork the Project
10
10
 
11
- Fork the [project on Github](https://github.com/dblock/slack-ruby-client) and check out your copy.
11
+ Fork the [project on Github](https://github.com/slack-ruby/slack-ruby-client) and check out your copy.
12
12
 
13
13
  ```
14
14
  git clone https://github.com/contributor/slack-ruby-client.git
15
15
  cd slack-ruby-client
16
- git remote add upstream https://github.com/dblock/slack-ruby-client.git
16
+ git remote add upstream https://github.com/slack-ruby/slack-ruby-client.git
17
17
  ```
18
18
 
19
19
  ### Bundle Install and Test
@@ -73,7 +73,7 @@ rake slack:api:update
73
73
 
74
74
  #### Patching Slack Web API
75
75
 
76
- Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/dblock/slack-ruby-client/issues/20).
76
+ Sometimes it's necessary to patch auto-generated Slack Web API methods. For example, we want to help clients with calling `to_json` on the `attachments` parameter sent to `chat_postMessage`. See [#20](https://github.com/slack-ruby/slack-ruby-client/issues/20).
77
77
 
78
78
  Make a change to a generated file, for example `lib/slack/web/api/endpoints/chat.rb` and generate a patch.
79
79
 
@@ -124,7 +124,7 @@ Go to https://github.com/contributor/slack-ruby-client and select your feature b
124
124
  Update the [CHANGELOG](CHANGELOG.md) with the pull request number. A typical entry looks as follows.
125
125
 
126
126
  ```
127
- * [#123](https://github.com/dblock/slack-ruby-client/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
127
+ * [#123](https://github.com/slack-ruby/slack-ruby-client/pull/123): Reticulated splines - [@contributor](https://github.com/contributor).
128
128
  ```
129
129
 
130
130
  Amend your previous commit and force push the changes.
data/Dangerfile ADDED
@@ -0,0 +1 @@
1
+ # inherits from https://github.com/slack-ruby/danger
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ gemspec
4
4
 
5
5
  gem ENV['CONCURRENCY'], require: false if ENV.key?('CONCURRENCY')
6
6
  gem 'picky' unless RUBY_PLATFORM == 'java'
7
+ gem 'activesupport', '~> 4.0'
8
+ gem 'danger', '~> 2.0'
data/README.md CHANGED
@@ -2,8 +2,8 @@ Slack Ruby Client
2
2
  =================
3
3
 
4
4
  [![Gem Version](https://badge.fury.io/rb/slack-ruby-client.svg)](http://badge.fury.io/rb/slack-ruby-client)
5
- [![Build Status](https://travis-ci.org/dblock/slack-ruby-client.svg?branch=master)](https://travis-ci.org/dblock/slack-ruby-client)
6
- [![Code Climate](https://codeclimate.com/github/dblock/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/dblock/slack-ruby-client)
5
+ [![Build Status](https://travis-ci.org/slack-ruby/slack-ruby-client.svg?branch=master)](https://travis-ci.org/slack-ruby/slack-ruby-client)
6
+ [![Code Climate](https://codeclimate.com/github/slack-ruby/slack-ruby-client/badges/gpa.svg)](https://codeclimate.com/github/slack-ruby/slack-ruby-client)
7
7
 
8
8
  A Ruby client for the Slack [Web](https://api.slack.com/web) and [RealTime Messaging](https://api.slack.com/rtm) APIs. Comes with a handy command-line client, too. If you are not familiar with these concepts, you might want to watch [this video](http://code.dblock.org/2016/03/11/your-first-slack-bot-service-video.html).
9
9
 
data/RELEASING.md CHANGED
@@ -11,7 +11,7 @@ bundle install
11
11
  rake
12
12
  ```
13
13
 
14
- Check that the last build succeeded in [Travis CI](https://travis-ci.org/dblock/slack-ruby-client) for all supported platforms.
14
+ Check that the last build succeeded in [Travis CI](https://travis-ci.org/slack-ruby/slack-ruby-client) for all supported platforms.
15
15
 
16
16
  Increment the version, modify [lib/slack/version.rb](lib/slack/version.rb).
17
17
 
data/UPGRADING.md CHANGED
@@ -19,7 +19,7 @@ After:
19
19
  puts "Welcome #{client.self.name} to the #{client.team.name} team."
20
20
  ```
21
21
 
22
- See [#56](https://github.com/dblock/slack-ruby-client/issues/56) for more information.
22
+ See [#56](https://github.com/slack-ruby/slack-ruby-client/issues/56) for more information.
23
23
 
24
24
  #### Changes to RealTime Local Store
25
25
 
@@ -37,7 +37,7 @@ The `client.team` object is now a `Slack::RealTime::Models::Team`, which is a ch
37
37
 
38
38
  The `client.users`, `.channels`, `.groups` and `.ims` collections have been changed from `Array` to `Hash`, with object ID as key. Replace any code iterating over the array, eg. `client.users.values.each` or `client.channels.each_pair { |id, channel| ... }`.
39
39
 
40
- See [#55](https://github.com/dblock/slack-ruby-client/issues/55) for more information.
40
+ See [#55](https://github.com/slack-ruby/slack-ruby-client/issues/55) for more information.
41
41
 
42
42
  ### Upgrading to >= 0.5.0
43
43
 
@@ -59,6 +59,6 @@ gem 'celluloid-io'
59
59
 
60
60
  When in doubt, use `faye-websocket`.
61
61
 
62
- See [#5](https://github.com/dblock/slack-ruby-client/issues/5) for more information.
62
+ See [#5](https://github.com/slack-ruby/slack-ruby-client/issues/5) for more information.
63
63
 
64
64
 
@@ -38,11 +38,14 @@ module Slack
38
38
  rescue EOFError => e
39
39
  logger.debug("#{self.class}##{__method__}") { e }
40
40
  driver.emit(:close, WebSocket::Driver::CloseEvent.new(1001, 'server closed connection')) unless @closing
41
+ ensure
42
+ current_actor.terminate if current_actor.alive?
41
43
  end
42
44
 
43
45
  def close
44
46
  @closing = true
45
47
  driver.close
48
+ super
46
49
  end
47
50
 
48
51
  def read
@@ -53,6 +53,10 @@ module Slack
53
53
  fail NotImplementedError, "Expected #{self.class} to implement #{__method__}."
54
54
  end
55
55
 
56
+ def close
57
+ @driver = nil
58
+ end
59
+
56
60
  protected
57
61
 
58
62
  def addr
@@ -77,10 +81,6 @@ module Slack
77
81
  def connect
78
82
  fail NotImplementedError, "Expected #{self.class} to implement #{__method__}."
79
83
  end
80
-
81
- def close(_event)
82
- @driver = nil
83
- end
84
84
  end
85
85
  end
86
86
  end
data/lib/slack/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slack
2
- VERSION = '0.7.6'.freeze
2
+ VERSION = '0.7.7'.freeze
3
3
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.test_files = `git ls-files -- spec/*`.split("\n")
15
15
  s.require_paths = ['lib']
16
- s.homepage = 'http://github.com/dblock/slack-ruby-client'
16
+ s.homepage = 'http://github.com/slack-ruby/slack-ruby-client'
17
17
  s.licenses = ['MIT']
18
18
  s.summary = 'Slack Web and RealTime API client.'
19
19
  s.add_dependency 'activesupport'
@@ -1,7 +1,9 @@
1
1
  require 'spec_helper'
2
+ require_relative './it_behaves_like_a_realtime_socket'
2
3
 
3
4
  begin
4
5
  RSpec.describe Slack::RealTime::Concurrency::Celluloid::Socket do
6
+ it_behaves_like 'a realtime socket'
5
7
  context 'with url' do
6
8
  let(:url) { 'wss://echo.websocket.org/websocket/xyz' }
7
9
  let(:logger) { ::Logger.new(STDOUT) }
@@ -9,12 +11,6 @@ begin
9
11
  let(:driver) { WebSocket::Driver::Client }
10
12
  let(:ws) { double(driver) }
11
13
 
12
- describe '#initialize' do
13
- it 'sets url' do
14
- expect(socket.url).to eq url
15
- end
16
- end
17
-
18
14
  describe '#connect!' do
19
15
  pending 'connects'
20
16
  pending 'pings every 30s'
@@ -1,17 +1,14 @@
1
1
  require 'spec_helper'
2
+ require_relative './it_behaves_like_a_realtime_socket'
2
3
 
3
4
  begin
4
5
  RSpec.describe Slack::RealTime::Concurrency::Eventmachine::Socket do
6
+ it_behaves_like 'a realtime socket'
5
7
  context 'with url' do
6
8
  let(:url) { 'wss://ms174.slack-msgs.com/websocket/xyz' }
7
9
  let(:logger) { ::Logger.new($stdout) }
8
10
  let(:socket) { described_class.new(url, ping: 42, logger: logger) }
9
11
  let(:ws) { double(Faye::WebSocket::Client) }
10
- describe '#initialize' do
11
- it 'sets url' do
12
- expect(socket.url).to eq url
13
- end
14
- end
15
12
  describe '#connect!' do
16
13
  before do
17
14
  allow(ws).to receive(:on).with(:close)
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.shared_examples_for 'a realtime socket' do
4
+ let(:url) { 'wss://ms174.slack-msgs.com/websocket/xyz' }
5
+ let(:logger) { ::Logger.new($stdout) }
6
+ let(:socket) { described_class.new(url, ping: 42, logger: logger) }
7
+ describe '#initialize' do
8
+ it 'sets url' do
9
+ expect(socket.url).to eq url
10
+ end
11
+ end
12
+ describe 'api' do
13
+ [:start_sync, :start_sync, :disconnect!, :connect!, :connected?, :send_data, :close].each do |m|
14
+ it m do
15
+ expect(socket).to respond_to(m)
16
+ end
17
+ end
18
+ end
19
+ end
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.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Doubrovkine
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-07 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -221,6 +221,7 @@ files:
221
221
  - ".travis.yml"
222
222
  - CHANGELOG.md
223
223
  - CONTRIBUTING.md
224
+ - Dangerfile
224
225
  - Gemfile
225
226
  - LICENSE.md
226
227
  - README.md
@@ -379,6 +380,7 @@ files:
379
380
  - spec/slack/real_time/client_spec.rb
380
381
  - spec/slack/real_time/concurrency/celluloid_spec.rb
381
382
  - spec/slack/real_time/concurrency/eventmachine_spec.rb
383
+ - spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb
382
384
  - spec/slack/real_time/event_handlers/bot_spec.rb
383
385
  - spec/slack/real_time/event_handlers/channel_spec.rb
384
386
  - spec/slack/real_time/event_handlers/event_handlers_spec.rb
@@ -427,7 +429,7 @@ files:
427
429
  - spec/support/real_time/event.rb
428
430
  - spec/support/token.rb
429
431
  - spec/support/vcr.rb
430
- homepage: http://github.com/dblock/slack-ruby-client
432
+ homepage: http://github.com/slack-ruby/slack-ruby-client
431
433
  licenses:
432
434
  - MIT
433
435
  metadata: {}
@@ -469,6 +471,7 @@ test_files:
469
471
  - spec/slack/real_time/client_spec.rb
470
472
  - spec/slack/real_time/concurrency/celluloid_spec.rb
471
473
  - spec/slack/real_time/concurrency/eventmachine_spec.rb
474
+ - spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb
472
475
  - spec/slack/real_time/event_handlers/bot_spec.rb
473
476
  - spec/slack/real_time/event_handlers/channel_spec.rb
474
477
  - spec/slack/real_time/event_handlers/event_handlers_spec.rb