slack-ruby-client 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +19 -17
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +8 -0
  5. data/README.md +24 -4
  6. data/bin/commands/chat.rb +10 -9
  7. data/bin/commands/files.rb +19 -1
  8. data/examples/hi_real_time/hi.rb +2 -0
  9. data/lib/slack-ruby-client.rb +4 -2
  10. data/lib/slack/config.rb +4 -0
  11. data/lib/slack/logger.rb +13 -0
  12. data/lib/slack/messages/message.rb +6 -0
  13. data/lib/slack/real_time/api/schema/event.json +1 -0
  14. data/lib/slack/real_time/api/templates/event_handler.erb +4 -18
  15. data/lib/slack/real_time/client.rb +29 -5
  16. data/lib/slack/real_time/concurrency/celluloid.rb +6 -0
  17. data/lib/slack/real_time/concurrency/eventmachine.rb +22 -1
  18. data/lib/slack/real_time/config.rb +5 -1
  19. data/lib/slack/real_time/socket.rb +5 -0
  20. data/lib/slack/real_time/stores.rb +10 -0
  21. data/lib/slack/real_time/stores/base.rb +34 -0
  22. data/lib/slack/real_time/stores/starter.rb +361 -0
  23. data/lib/slack/real_time/stores/store.rb +479 -0
  24. data/lib/slack/version.rb +1 -1
  25. data/lib/slack/web/api/endpoints/api.rb +1 -1
  26. data/lib/slack/web/api/endpoints/auth.rb +1 -1
  27. data/lib/slack/web/api/endpoints/channels.rb +14 -14
  28. data/lib/slack/web/api/endpoints/chat.rb +15 -13
  29. data/lib/slack/web/api/endpoints/dnd.rb +5 -5
  30. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  31. data/lib/slack/web/api/endpoints/files.rb +30 -6
  32. data/lib/slack/web/api/endpoints/groups.rb +16 -16
  33. data/lib/slack/web/api/endpoints/im.rb +5 -5
  34. data/lib/slack/web/api/endpoints/mpim.rb +5 -5
  35. data/lib/slack/web/api/endpoints/oauth.rb +1 -1
  36. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  37. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  38. data/lib/slack/web/api/endpoints/rtm.rb +1 -1
  39. data/lib/slack/web/api/endpoints/search.rb +3 -3
  40. data/lib/slack/web/api/endpoints/stars.rb +3 -3
  41. data/lib/slack/web/api/endpoints/team.rb +3 -3
  42. data/lib/slack/web/api/endpoints/usergroups.rb +6 -6
  43. data/lib/slack/web/api/endpoints/users.rb +5 -5
  44. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
  45. data/lib/slack/web/api/templates/method.erb +1 -1
  46. data/lib/slack/web/client.rb +1 -0
  47. data/lib/tasks/real_time.rake +27 -21
  48. data/slack-ruby-client.gemspec +1 -0
  49. data/spec/integration/integration_spec.rb +13 -1
  50. data/spec/slack/real_time/client_spec.rb +40 -5
  51. data/spec/slack/real_time/concurrency/celluloid_spec.rb +2 -1
  52. data/spec/slack/real_time/concurrency/eventmachine_spec.rb +3 -2
  53. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +15 -0
  54. data/spec/slack/real_time/event_handlers/team_spec.rb +54 -52
  55. data/spec/slack/web/api/endpoints/files_spec.rb +10 -0
  56. data/spec/slack/web/client_spec.rb +1 -1
  57. data/spec/support/real_time/connected_client.rb +3 -3
  58. metadata +23 -71
  59. data/lib/slack/real_time/api/templates/event_handlers.erb +0 -5
  60. data/lib/slack/real_time/event_handlers.rb +0 -66
  61. data/lib/slack/real_time/event_handlers/accounts_changed.rb +0 -18
  62. data/lib/slack/real_time/event_handlers/bot_added.rb +0 -16
  63. data/lib/slack/real_time/event_handlers/bot_changed.rb +0 -17
  64. data/lib/slack/real_time/event_handlers/channel_archive.rb +0 -17
  65. data/lib/slack/real_time/event_handlers/channel_created.rb +0 -17
  66. data/lib/slack/real_time/event_handlers/channel_deleted.rb +0 -16
  67. data/lib/slack/real_time/event_handlers/channel_history_changed.rb +0 -18
  68. data/lib/slack/real_time/event_handlers/channel_joined.rb +0 -22
  69. data/lib/slack/real_time/event_handlers/channel_left.rb +0 -17
  70. data/lib/slack/real_time/event_handlers/channel_marked.rb +0 -18
  71. data/lib/slack/real_time/event_handlers/channel_rename.rb +0 -17
  72. data/lib/slack/real_time/event_handlers/channel_unarchive.rb +0 -17
  73. data/lib/slack/real_time/event_handlers/commands_changed.rb +0 -18
  74. data/lib/slack/real_time/event_handlers/dnd_updated.rb +0 -18
  75. data/lib/slack/real_time/event_handlers/dnd_updated_user.rb +0 -18
  76. data/lib/slack/real_time/event_handlers/email_domain_changed.rb +0 -16
  77. data/lib/slack/real_time/event_handlers/emoji_changed.rb +0 -18
  78. data/lib/slack/real_time/event_handlers/file_change.rb +0 -18
  79. data/lib/slack/real_time/event_handlers/file_comment_added.rb +0 -18
  80. data/lib/slack/real_time/event_handlers/file_comment_deleted.rb +0 -18
  81. data/lib/slack/real_time/event_handlers/file_comment_edited.rb +0 -18
  82. data/lib/slack/real_time/event_handlers/file_created.rb +0 -18
  83. data/lib/slack/real_time/event_handlers/file_deleted.rb +0 -18
  84. data/lib/slack/real_time/event_handlers/file_private.rb +0 -18
  85. data/lib/slack/real_time/event_handlers/file_public.rb +0 -18
  86. data/lib/slack/real_time/event_handlers/file_shared.rb +0 -18
  87. data/lib/slack/real_time/event_handlers/file_unshared.rb +0 -18
  88. data/lib/slack/real_time/event_handlers/group_archive.rb +0 -17
  89. data/lib/slack/real_time/event_handlers/group_close.rb +0 -16
  90. data/lib/slack/real_time/event_handlers/group_history_changed.rb +0 -18
  91. data/lib/slack/real_time/event_handlers/group_joined.rb +0 -16
  92. data/lib/slack/real_time/event_handlers/group_left.rb +0 -17
  93. data/lib/slack/real_time/event_handlers/group_marked.rb +0 -18
  94. data/lib/slack/real_time/event_handlers/group_open.rb +0 -16
  95. data/lib/slack/real_time/event_handlers/group_rename.rb +0 -17
  96. data/lib/slack/real_time/event_handlers/group_unarchive.rb +0 -17
  97. data/lib/slack/real_time/event_handlers/im_close.rb +0 -16
  98. data/lib/slack/real_time/event_handlers/im_created.rb +0 -16
  99. data/lib/slack/real_time/event_handlers/im_history_changed.rb +0 -18
  100. data/lib/slack/real_time/event_handlers/im_marked.rb +0 -18
  101. data/lib/slack/real_time/event_handlers/im_open.rb +0 -16
  102. data/lib/slack/real_time/event_handlers/manual_presence_change.rb +0 -16
  103. data/lib/slack/real_time/event_handlers/pin_added.rb +0 -18
  104. data/lib/slack/real_time/event_handlers/pin_removed.rb +0 -18
  105. data/lib/slack/real_time/event_handlers/pref_change.rb +0 -16
  106. data/lib/slack/real_time/event_handlers/presence_change.rb +0 -17
  107. data/lib/slack/real_time/event_handlers/reaction_added.rb +0 -18
  108. data/lib/slack/real_time/event_handlers/reaction_removed.rb +0 -18
  109. data/lib/slack/real_time/event_handlers/reconnect_url.rb +0 -18
  110. data/lib/slack/real_time/event_handlers/star_added.rb +0 -18
  111. data/lib/slack/real_time/event_handlers/star_removed.rb +0 -18
  112. data/lib/slack/real_time/event_handlers/subteam_created.rb +0 -18
  113. data/lib/slack/real_time/event_handlers/subteam_self_added.rb +0 -18
  114. data/lib/slack/real_time/event_handlers/subteam_self_removed.rb +0 -18
  115. data/lib/slack/real_time/event_handlers/subteam_updated.rb +0 -18
  116. data/lib/slack/real_time/event_handlers/team_domain_change.rb +0 -17
  117. data/lib/slack/real_time/event_handlers/team_join.rb +0 -16
  118. data/lib/slack/real_time/event_handlers/team_migration_started.rb +0 -18
  119. data/lib/slack/real_time/event_handlers/team_plan_change.rb +0 -16
  120. data/lib/slack/real_time/event_handlers/team_pref_change.rb +0 -16
  121. data/lib/slack/real_time/event_handlers/team_profile_change.rb +0 -18
  122. data/lib/slack/real_time/event_handlers/team_profile_delete.rb +0 -18
  123. data/lib/slack/real_time/event_handlers/team_profile_reorder.rb +0 -18
  124. data/lib/slack/real_time/event_handlers/team_rename.rb +0 -16
  125. data/lib/slack/real_time/event_handlers/user_change.rb +0 -16
  126. data/lib/slack/real_time/event_handlers/user_typing.rb +0 -18
  127. data/lib/slack/real_time/store.rb +0 -47
@@ -44,12 +44,12 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
44
44
  end
45
45
  end
46
46
  context 'client' do
47
- let(:client) { Slack::RealTime::Client.new }
48
47
  context 'started' do
48
+ let(:client) { Slack::RealTime::Client.new(store_class: Slack::RealTime::Stores::Store) }
49
49
  describe '#start!' do
50
50
  let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
51
51
  before do
52
- allow(Slack::RealTime::Socket).to receive(:new).with(url, ping: 30).and_return(socket)
52
+ allow(Slack::RealTime::Socket).to receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket)
53
53
  allow(socket).to receive(:connect!)
54
54
  allow(socket).to receive(:start_sync).and_yield
55
55
  client.start!
@@ -70,7 +70,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
70
70
  end
71
71
  it 'sets users' do
72
72
  expect(client.users.count).to eq 18
73
- expect(client.users.values.first['id']).to eq 'U092BDCLV'
73
+ expect(client.users.values.first['id']).to eq 'U07518DTL'
74
74
  end
75
75
  it 'sets channels' do
76
76
  expect(client.channels.count).to eq 37
@@ -138,7 +138,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
138
138
  end
139
139
  end
140
140
  context 'subclassed' do
141
- let(:client) { Class.new(Slack::RealTime::Client).new }
141
+ let(:client) { Class.new(Slack::RealTime::Client).new(store_class: Slack::RealTime::Stores::Store) }
142
142
  it 'runs event handlers' do
143
143
  event = Slack::RealTime::Event.new(
144
144
  'type' => 'team_rename',
@@ -151,6 +151,7 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
151
151
  end
152
152
  end
153
153
  context 'with defaults' do
154
+ let(:client) { Slack::RealTime::Client.new }
154
155
  describe '#initialize' do
155
156
  it 'sets ping' do
156
157
  expect(client.websocket_ping).to eq 30
@@ -158,7 +159,13 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
158
159
  it "doesn't set proxy" do
159
160
  expect(client.websocket_proxy).to be nil
160
161
  end
161
- Slack::RealTime::Config::ATTRIBUTES.each do |key|
162
+ it 'defaults logger' do
163
+ expect(client.send(:logger)).to be_a ::Logger
164
+ end
165
+ it 'sets default store_class' do
166
+ expect(client.send(:store_class)).to eq Slack::RealTime::Store
167
+ end
168
+ (Slack::RealTime::Config::ATTRIBUTES - [:logger, :store_class]).each do |key|
162
169
  it "sets #{key}" do
163
170
  expect(client.send(key)).to eq Slack::RealTime::Config.send(key)
164
171
  end
@@ -256,5 +263,33 @@ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' }
256
263
  end
257
264
  end
258
265
  end
266
+ context 'store_class' do
267
+ before do
268
+ Slack::RealTime::Client.configure do |config|
269
+ config.store_class = Slack::RealTime::Stores::Starter
270
+ end
271
+ end
272
+ describe '#initialize' do
273
+ it 'can be overriden explicitly' do
274
+ client = Slack::RealTime::Client.new(store_class: Slack::RealTime::Store)
275
+ expect(client.send(:store_class)).to eq Slack::RealTime::Store
276
+ end
277
+ it 'sets store_class' do
278
+ expect(client.send(:store_class)).to eq(Slack::RealTime::Stores::Starter)
279
+ end
280
+ context 'start!' do
281
+ let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
282
+ before do
283
+ allow(Slack::RealTime::Socket).to receive(:new).and_return(socket)
284
+ allow(socket).to receive(:connect!)
285
+ allow(socket).to receive(:start_sync).and_yield
286
+ end
287
+ it 'instantiates the correct store class' do
288
+ client.start!
289
+ expect(client.store).to be_a Slack::RealTime::Stores::Starter
290
+ end
291
+ end
292
+ end
293
+ end
259
294
  end
260
295
  end
@@ -4,7 +4,8 @@ begin
4
4
  RSpec.describe Slack::RealTime::Concurrency::Celluloid::Socket do
5
5
  context 'with url' do
6
6
  let(:url) { 'wss://echo.websocket.org/websocket/xyz' }
7
- subject(:socket) { described_class.new(url, ping: 42) }
7
+ let(:logger) { ::Logger.new(STDOUT) }
8
+ subject(:socket) { described_class.new(url, ping: 42, logger: logger) }
8
9
  let(:driver) { WebSocket::Driver::Client }
9
10
  let(:ws) { double(driver) }
10
11
 
@@ -4,7 +4,8 @@ begin
4
4
  RSpec.describe Slack::RealTime::Concurrency::Eventmachine::Socket do
5
5
  context 'with url' do
6
6
  let(:url) { 'wss://ms174.slack-msgs.com/websocket/xyz' }
7
- let(:socket) { described_class.new(url, ping: 42) }
7
+ let(:logger) { ::Logger.new($stdout) }
8
+ let(:socket) { described_class.new(url, ping: 42, logger: logger) }
8
9
  let(:ws) { double(Faye::WebSocket::Client) }
9
10
  describe '#initialize' do
10
11
  it 'sets url' do
@@ -21,7 +22,7 @@ begin
21
22
  expect(socket.instance_variable_get('@driver')).to eq ws
22
23
  end
23
24
  it 'pings every 30s' do
24
- expect(Faye::WebSocket::Client).to receive(:new).with(url, nil, ping: 42).and_return(ws)
25
+ expect(Faye::WebSocket::Client).to receive(:new).with(url, nil, ping: 42, logger: logger).and_return(ws)
25
26
  socket.connect!
26
27
  end
27
28
  end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' } do
4
+ include_context 'connected client'
5
+
6
+ it 'is not fatal' do
7
+ event = Slack::RealTime::Event.new(
8
+ 'type' => 'pref_change',
9
+ 'name' => 'push_sound',
10
+ 'value' => 'updated.mp3'
11
+ )
12
+ expect(client.self).to receive(:prefs) { fail ArgumentError }
13
+ expect { client.send(:dispatch, event) }.to_not raise_error
14
+ end
15
+ end
@@ -1,58 +1,60 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Slack::RealTime::Client, vcr: { cassette_name: 'web/rtm_start' } do
4
- include_context 'connected client'
3
+ [Slack::RealTime::Stores::Store, Slack::RealTime::Stores::Starter].each do |store_class|
4
+ RSpec.describe store_class, vcr: { cassette_name: 'web/rtm_start' } do
5
+ include_context 'connected client', store_class: store_class
5
6
 
6
- context 'team' do
7
- it 'sets team data on rtm.start' do
8
- expect(client.team.name).to eq 'dblock'
9
- expect(client.team.domain).to eq 'dblockdotorg'
10
- expect(client.team.email_domain).to eq 'dblock.org'
11
- expect(client.team.prefs.invites_only_admins).to be true
12
- expect(client.team.plan).to eq ''
13
- end
14
- it 'team_domain_change' do
15
- event = Slack::RealTime::Event.new(
16
- 'type' => 'team_domain_change',
17
- 'url' => 'https://my.slack.com',
18
- 'domain' => 'my'
19
- )
20
- client.send(:dispatch, event)
21
- expect(client.team.domain).to eq 'my'
22
- expect(client.team['url']).to eq 'https://my.slack.com'
23
- end
24
- it 'email_domain_changed' do
25
- event = Slack::RealTime::Event.new(
26
- 'type' => 'email_domain_changed',
27
- 'email_domain' => 'example.com'
28
- )
29
- client.send(:dispatch, event)
30
- expect(client.team.email_domain).to eq 'example.com'
31
- end
32
- it 'team_pref_change' do
33
- event = Slack::RealTime::Event.new(
34
- 'type' => 'team_pref_change',
35
- 'name' => 'invites_only_admins',
36
- 'value' => false
37
- )
38
- client.send(:dispatch, event)
39
- expect(client.team.prefs.invites_only_admins).to be false
40
- end
41
- it 'team_rename' do
42
- event = Slack::RealTime::Event.new(
43
- 'type' => 'team_rename',
44
- 'name' => 'New Team Name Inc.'
45
- )
46
- client.send(:dispatch, event)
47
- expect(client.team.name).to eq 'New Team Name Inc.'
48
- end
49
- it 'team_plan_change' do
50
- event = Slack::RealTime::Event.new(
51
- 'type' => 'team_plan_change',
52
- 'plan' => 'std'
53
- )
54
- client.send(:dispatch, event)
55
- expect(client.team.plan).to eq 'std'
7
+ context 'team' do
8
+ it 'sets team data on rtm.start' do
9
+ expect(client.team.name).to eq 'dblock'
10
+ expect(client.team.domain).to eq 'dblockdotorg'
11
+ expect(client.team.email_domain).to eq 'dblock.org'
12
+ expect(client.team.prefs.invites_only_admins).to be true
13
+ expect(client.team.plan).to eq ''
14
+ end
15
+ it 'team_domain_change' do
16
+ event = Slack::RealTime::Event.new(
17
+ 'type' => 'team_domain_change',
18
+ 'url' => 'https://my.slack.com',
19
+ 'domain' => 'my'
20
+ )
21
+ client.send(:dispatch, event)
22
+ expect(client.team.domain).to eq 'my'
23
+ expect(client.team['url']).to eq 'https://my.slack.com'
24
+ end
25
+ it 'email_domain_changed' do
26
+ event = Slack::RealTime::Event.new(
27
+ 'type' => 'email_domain_changed',
28
+ 'email_domain' => 'example.com'
29
+ )
30
+ client.send(:dispatch, event)
31
+ expect(client.team.email_domain).to eq 'example.com'
32
+ end
33
+ it 'team_pref_change' do
34
+ event = Slack::RealTime::Event.new(
35
+ 'type' => 'team_pref_change',
36
+ 'name' => 'invites_only_admins',
37
+ 'value' => false
38
+ )
39
+ client.send(:dispatch, event)
40
+ expect(client.team.prefs.invites_only_admins).to be false
41
+ end
42
+ it 'team_rename' do
43
+ event = Slack::RealTime::Event.new(
44
+ 'type' => 'team_rename',
45
+ 'name' => 'New Team Name Inc.'
46
+ )
47
+ client.send(:dispatch, event)
48
+ expect(client.team.name).to eq 'New Team Name Inc.'
49
+ end
50
+ it 'team_plan_change' do
51
+ event = Slack::RealTime::Event.new(
52
+ 'type' => 'team_plan_change',
53
+ 'plan' => 'std'
54
+ )
55
+ client.send(:dispatch, event)
56
+ expect(client.team.plan).to eq 'std'
57
+ end
56
58
  end
57
59
  end
58
60
  end
@@ -25,6 +25,16 @@ RSpec.describe Slack::Web::Api::Endpoints::Files do
25
25
  expect { client.files_info }.to raise_error ArgumentError, /Required arguments :file missing/
26
26
  end
27
27
  end
28
+ context 'files_revokePublicURL' do
29
+ it 'requires file' do
30
+ expect { client.files_revokePublicURL }.to raise_error ArgumentError, /Required arguments :file missing/
31
+ end
32
+ end
33
+ context 'files_sharedPublicURL' do
34
+ it 'requires file' do
35
+ expect { client.files_sharedPublicURL }.to raise_error ArgumentError, /Required arguments :file missing/
36
+ end
37
+ end
28
38
  context 'files_upload' do
29
39
  it 'requires file' do
30
40
  expect { client.files_upload(filename: 'foo.txt') }.to raise_error ArgumentError, /Required arguments :file missing/
@@ -11,7 +11,7 @@ RSpec.describe Slack::Web::Client do
11
11
  expect(client.user_agent).to eq Slack::Web::Config.user_agent
12
12
  expect(client.user_agent).to include Slack::VERSION
13
13
  end
14
- Slack::Web::Config::ATTRIBUTES.each do |key|
14
+ (Slack::Web::Config::ATTRIBUTES - [:logger]).each do |key|
15
15
  it "sets #{key}" do
16
16
  expect(client.send(key)).to eq Slack::Web::Config.send(key)
17
17
  end
@@ -1,5 +1,5 @@
1
- RSpec.shared_context 'connected client' do
2
- let(:client) { Slack::RealTime::Client.new }
1
+ RSpec.shared_context 'connected client' do |opts|
2
+ let(:client) { Slack::RealTime::Client.new(opts || {}) }
3
3
  let(:ws) { double(Slack::RealTime::Concurrency::Mock::WebSocket) }
4
4
  let(:url) { 'wss://ms173.slack-msgs.com/websocket/lqcUiAvrKTP-uuid=' }
5
5
  let(:socket) { double(Slack::RealTime::Socket, connected?: true) }
@@ -7,7 +7,7 @@ RSpec.shared_context 'connected client' do
7
7
  Slack::RealTime.configure do |config|
8
8
  config.concurrency = Slack::RealTime::Concurrency::Mock
9
9
  end
10
- allow(Slack::RealTime::Socket).to receive(:new).with(url, ping: 30).and_return(socket)
10
+ allow(Slack::RealTime::Socket).to receive(:new).with(url, ping: 30, logger: Slack::Logger.default).and_return(socket)
11
11
  allow(socket).to receive(:start_sync).and_yield
12
12
  allow(socket).to receive(:connect!).and_yield(ws)
13
13
  allow(ws).to receive(:on)
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slack-ruby-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
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-02-04 00:00:00.000000000 Z
11
+ date: 2016-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activesupport
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: faraday
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -250,6 +264,7 @@ files:
250
264
  - lib/slack-ruby-client.rb
251
265
  - lib/slack.rb
252
266
  - lib/slack/config.rb
267
+ - lib/slack/logger.rb
253
268
  - lib/slack/messages/formatting.rb
254
269
  - lib/slack/messages/message.rb
255
270
  - lib/slack/real_time/api/message.rb
@@ -257,80 +272,12 @@ files:
257
272
  - lib/slack/real_time/api/ping.rb
258
273
  - lib/slack/real_time/api/schema/event.json
259
274
  - lib/slack/real_time/api/templates/event_handler.erb
260
- - lib/slack/real_time/api/templates/event_handlers.erb
261
275
  - lib/slack/real_time/api/typing.rb
262
276
  - lib/slack/real_time/client.rb
263
277
  - lib/slack/real_time/concurrency.rb
264
278
  - lib/slack/real_time/concurrency/celluloid.rb
265
279
  - lib/slack/real_time/concurrency/eventmachine.rb
266
280
  - lib/slack/real_time/config.rb
267
- - lib/slack/real_time/event_handlers.rb
268
- - lib/slack/real_time/event_handlers/accounts_changed.rb
269
- - lib/slack/real_time/event_handlers/bot_added.rb
270
- - lib/slack/real_time/event_handlers/bot_changed.rb
271
- - lib/slack/real_time/event_handlers/channel_archive.rb
272
- - lib/slack/real_time/event_handlers/channel_created.rb
273
- - lib/slack/real_time/event_handlers/channel_deleted.rb
274
- - lib/slack/real_time/event_handlers/channel_history_changed.rb
275
- - lib/slack/real_time/event_handlers/channel_joined.rb
276
- - lib/slack/real_time/event_handlers/channel_left.rb
277
- - lib/slack/real_time/event_handlers/channel_marked.rb
278
- - lib/slack/real_time/event_handlers/channel_rename.rb
279
- - lib/slack/real_time/event_handlers/channel_unarchive.rb
280
- - lib/slack/real_time/event_handlers/commands_changed.rb
281
- - lib/slack/real_time/event_handlers/dnd_updated.rb
282
- - lib/slack/real_time/event_handlers/dnd_updated_user.rb
283
- - lib/slack/real_time/event_handlers/email_domain_changed.rb
284
- - lib/slack/real_time/event_handlers/emoji_changed.rb
285
- - lib/slack/real_time/event_handlers/file_change.rb
286
- - lib/slack/real_time/event_handlers/file_comment_added.rb
287
- - lib/slack/real_time/event_handlers/file_comment_deleted.rb
288
- - lib/slack/real_time/event_handlers/file_comment_edited.rb
289
- - lib/slack/real_time/event_handlers/file_created.rb
290
- - lib/slack/real_time/event_handlers/file_deleted.rb
291
- - lib/slack/real_time/event_handlers/file_private.rb
292
- - lib/slack/real_time/event_handlers/file_public.rb
293
- - lib/slack/real_time/event_handlers/file_shared.rb
294
- - lib/slack/real_time/event_handlers/file_unshared.rb
295
- - lib/slack/real_time/event_handlers/group_archive.rb
296
- - lib/slack/real_time/event_handlers/group_close.rb
297
- - lib/slack/real_time/event_handlers/group_history_changed.rb
298
- - lib/slack/real_time/event_handlers/group_joined.rb
299
- - lib/slack/real_time/event_handlers/group_left.rb
300
- - lib/slack/real_time/event_handlers/group_marked.rb
301
- - lib/slack/real_time/event_handlers/group_open.rb
302
- - lib/slack/real_time/event_handlers/group_rename.rb
303
- - lib/slack/real_time/event_handlers/group_unarchive.rb
304
- - lib/slack/real_time/event_handlers/im_close.rb
305
- - lib/slack/real_time/event_handlers/im_created.rb
306
- - lib/slack/real_time/event_handlers/im_history_changed.rb
307
- - lib/slack/real_time/event_handlers/im_marked.rb
308
- - lib/slack/real_time/event_handlers/im_open.rb
309
- - lib/slack/real_time/event_handlers/manual_presence_change.rb
310
- - lib/slack/real_time/event_handlers/pin_added.rb
311
- - lib/slack/real_time/event_handlers/pin_removed.rb
312
- - lib/slack/real_time/event_handlers/pref_change.rb
313
- - lib/slack/real_time/event_handlers/presence_change.rb
314
- - lib/slack/real_time/event_handlers/reaction_added.rb
315
- - lib/slack/real_time/event_handlers/reaction_removed.rb
316
- - lib/slack/real_time/event_handlers/reconnect_url.rb
317
- - lib/slack/real_time/event_handlers/star_added.rb
318
- - lib/slack/real_time/event_handlers/star_removed.rb
319
- - lib/slack/real_time/event_handlers/subteam_created.rb
320
- - lib/slack/real_time/event_handlers/subteam_self_added.rb
321
- - lib/slack/real_time/event_handlers/subteam_self_removed.rb
322
- - lib/slack/real_time/event_handlers/subteam_updated.rb
323
- - lib/slack/real_time/event_handlers/team_domain_change.rb
324
- - lib/slack/real_time/event_handlers/team_join.rb
325
- - lib/slack/real_time/event_handlers/team_migration_started.rb
326
- - lib/slack/real_time/event_handlers/team_plan_change.rb
327
- - lib/slack/real_time/event_handlers/team_pref_change.rb
328
- - lib/slack/real_time/event_handlers/team_profile_change.rb
329
- - lib/slack/real_time/event_handlers/team_profile_delete.rb
330
- - lib/slack/real_time/event_handlers/team_profile_reorder.rb
331
- - lib/slack/real_time/event_handlers/team_rename.rb
332
- - lib/slack/real_time/event_handlers/user_change.rb
333
- - lib/slack/real_time/event_handlers/user_typing.rb
334
281
  - lib/slack/real_time/models.rb
335
282
  - lib/slack/real_time/models/base.rb
336
283
  - lib/slack/real_time/models/bot.rb
@@ -340,7 +287,10 @@ files:
340
287
  - lib/slack/real_time/models/team.rb
341
288
  - lib/slack/real_time/models/user.rb
342
289
  - lib/slack/real_time/socket.rb
343
- - lib/slack/real_time/store.rb
290
+ - lib/slack/real_time/stores.rb
291
+ - lib/slack/real_time/stores/base.rb
292
+ - lib/slack/real_time/stores/starter.rb
293
+ - lib/slack/real_time/stores/store.rb
344
294
  - lib/slack/version.rb
345
295
  - lib/slack/web/api/endpoints.rb
346
296
  - lib/slack/web/api/endpoints/api.rb
@@ -414,6 +364,7 @@ files:
414
364
  - spec/slack/real_time/concurrency/eventmachine_spec.rb
415
365
  - spec/slack/real_time/event_handlers/bot_spec.rb
416
366
  - spec/slack/real_time/event_handlers/channel_spec.rb
367
+ - spec/slack/real_time/event_handlers/event_handlers_spec.rb
417
368
  - spec/slack/real_time/event_handlers/group_spec.rb
418
369
  - spec/slack/real_time/event_handlers/im_spec.rb
419
370
  - spec/slack/real_time/event_handlers/team_spec.rb
@@ -497,6 +448,7 @@ test_files:
497
448
  - spec/slack/real_time/concurrency/eventmachine_spec.rb
498
449
  - spec/slack/real_time/event_handlers/bot_spec.rb
499
450
  - spec/slack/real_time/event_handlers/channel_spec.rb
451
+ - spec/slack/real_time/event_handlers/event_handlers_spec.rb
500
452
  - spec/slack/real_time/event_handlers/group_spec.rb
501
453
  - spec/slack/real_time/event_handlers/im_spec.rb
502
454
  - spec/slack/real_time/event_handlers/team_spec.rb
@@ -1,5 +0,0 @@
1
- # This file was auto-generated by lib/tasks/real_time.rake
2
-
3
- <% events.each do |f| %>
4
- require 'slack/real_time/event_handlers/<%= f %>'
5
- <% end %>
@@ -1,66 +0,0 @@
1
- # require 'slack/real_time/event_handlers/accounts_changed'
2
- require 'slack/real_time/event_handlers/bot_added'
3
- require 'slack/real_time/event_handlers/bot_changed'
4
- require 'slack/real_time/event_handlers/channel_archive'
5
- require 'slack/real_time/event_handlers/channel_created'
6
- require 'slack/real_time/event_handlers/channel_deleted'
7
- # require 'slack/real_time/event_handlers/channel_history_changed'
8
- require 'slack/real_time/event_handlers/channel_joined'
9
- require 'slack/real_time/event_handlers/channel_left'
10
- # require 'slack/real_time/event_handlers/channel_marked'
11
- require 'slack/real_time/event_handlers/channel_rename'
12
- require 'slack/real_time/event_handlers/channel_unarchive'
13
- # require 'slack/real_time/event_handlers/commands_changed'
14
- # require 'slack/real_time/event_handlers/dnd_updated'
15
- # require 'slack/real_time/event_handlers/dnd_updated_user'
16
- require 'slack/real_time/event_handlers/email_domain_changed'
17
- # require 'slack/real_time/event_handlers/emoji_changed'
18
- # require 'slack/real_time/event_handlers/file_change'
19
- # require 'slack/real_time/event_handlers/file_comment_added'
20
- # require 'slack/real_time/event_handlers/file_comment_deleted'
21
- # require 'slack/real_time/event_handlers/file_comment_edited'
22
- # require 'slack/real_time/event_handlers/file_created'
23
- # require 'slack/real_time/event_handlers/file_deleted'
24
- # require 'slack/real_time/event_handlers/file_private'
25
- # require 'slack/real_time/event_handlers/file_public'
26
- # require 'slack/real_time/event_handlers/file_shared'
27
- # require 'slack/real_time/event_handlers/file_unshared'
28
- require 'slack/real_time/event_handlers/group_archive'
29
- require 'slack/real_time/event_handlers/group_close'
30
- # require 'slack/real_time/event_handlers/group_history_changed'
31
- require 'slack/real_time/event_handlers/group_joined'
32
- require 'slack/real_time/event_handlers/group_left'
33
- # require 'slack/real_time/event_handlers/group_marked'
34
- require 'slack/real_time/event_handlers/group_open'
35
- require 'slack/real_time/event_handlers/group_rename'
36
- require 'slack/real_time/event_handlers/group_unarchive'
37
- require 'slack/real_time/event_handlers/im_close'
38
- require 'slack/real_time/event_handlers/im_created'
39
- # require 'slack/real_time/event_handlers/im_history_changed'
40
- # require 'slack/real_time/event_handlers/im_marked'
41
- require 'slack/real_time/event_handlers/im_open'
42
- require 'slack/real_time/event_handlers/manual_presence_change'
43
- # require 'slack/real_time/event_handlers/pin_added'
44
- # require 'slack/real_time/event_handlers/pin_removed'
45
- require 'slack/real_time/event_handlers/pref_change'
46
- require 'slack/real_time/event_handlers/presence_change'
47
- # require 'slack/real_time/event_handlers/reaction_added'
48
- # require 'slack/real_time/event_handlers/reaction_removed'
49
- # require 'slack/real_time/event_handlers/reconnect_url'
50
- # require 'slack/real_time/event_handlers/star_added'
51
- # require 'slack/real_time/event_handlers/star_removed'
52
- # require 'slack/real_time/event_handlers/subteam_created'
53
- # require 'slack/real_time/event_handlers/subteam_self_added'
54
- # require 'slack/real_time/event_handlers/subteam_self_removed'
55
- # require 'slack/real_time/event_handlers/subteam_updated'
56
- require 'slack/real_time/event_handlers/team_domain_change'
57
- require 'slack/real_time/event_handlers/team_join'
58
- # require 'slack/real_time/event_handlers/team_migration_started'
59
- require 'slack/real_time/event_handlers/team_plan_change'
60
- require 'slack/real_time/event_handlers/team_pref_change'
61
- # require 'slack/real_time/event_handlers/team_profile_change'
62
- # require 'slack/real_time/event_handlers/team_profile_delete'
63
- # require 'slack/real_time/event_handlers/team_profile_reorder'
64
- require 'slack/real_time/event_handlers/team_rename'
65
- require 'slack/real_time/event_handlers/user_change'
66
- # require 'slack/real_time/event_handlers/user_typing'