slack-ruby-client 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +3 -0
  4. data/.rubocop_todo.yml +30 -34
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +9 -0
  7. data/CONTRIBUTING.md +2 -2
  8. data/Gemfile +3 -1
  9. data/README.md +1 -1
  10. data/Rakefile +1 -1
  11. data/bin/commands/channels.rb +18 -9
  12. data/bin/commands/chat.rb +24 -3
  13. data/bin/commands/dialog.rb +14 -0
  14. data/bin/commands/files.rb +21 -0
  15. data/bin/commands/groups.rb +10 -10
  16. data/bin/commands/migration.rb +14 -0
  17. data/bin/commands/rtm.rb +2 -4
  18. data/bin/commands/users.rb +18 -18
  19. data/bin/commands/users_admin.rb +28 -0
  20. data/bin/commands/users_prefs.rb +12 -0
  21. data/bin/commands.rb +5 -1
  22. data/bin/slack +1 -1
  23. data/examples/hi_real_time/hi.rb +1 -1
  24. data/examples/hi_real_time_and_web/hi.rb +1 -1
  25. data/examples/hi_real_time_async_celluloid/hi.rb +1 -1
  26. data/examples/hi_real_time_async_eventmachine/hi.rb +1 -1
  27. data/examples/hi_web/hi.rb +1 -1
  28. data/examples/new_ticket/new_ticket.rb +1 -1
  29. data/lib/slack/messages/formatting.rb +4 -4
  30. data/lib/slack/messages/message.rb +1 -2
  31. data/lib/slack/real_time/api/templates/event_handler.erb +1 -1
  32. data/lib/slack/real_time/client.rb +10 -9
  33. data/lib/slack/real_time/concurrency/celluloid.rb +5 -1
  34. data/lib/slack/real_time/config.rb +11 -11
  35. data/lib/slack/real_time/models/base.rb +1 -2
  36. data/lib/slack/real_time/socket.rb +2 -2
  37. data/lib/slack/real_time/stores/base.rb +1 -2
  38. data/lib/slack/real_time/stores/starter.rb +76 -76
  39. data/lib/slack/real_time/stores/store.rb +104 -94
  40. data/lib/slack/version.rb +1 -1
  41. data/lib/slack/web/api/endpoints/api.rb +1 -1
  42. data/lib/slack/web/api/endpoints/apps_permissions.rb +2 -2
  43. data/lib/slack/web/api/endpoints/auth.rb +2 -2
  44. data/lib/slack/web/api/endpoints/bots.rb +1 -1
  45. data/lib/slack/web/api/endpoints/channels.rb +27 -15
  46. data/lib/slack/web/api/endpoints/chat.rb +42 -9
  47. data/lib/slack/web/api/endpoints/conversations.rb +17 -17
  48. data/lib/slack/web/api/endpoints/dialog.rb +32 -0
  49. data/lib/slack/web/api/endpoints/dnd.rb +5 -5
  50. data/lib/slack/web/api/endpoints/emoji.rb +1 -1
  51. data/lib/slack/web/api/endpoints/files.rb +37 -6
  52. data/lib/slack/web/api/endpoints/files_comments.rb +3 -3
  53. data/lib/slack/web/api/endpoints/groups.rb +17 -17
  54. data/lib/slack/web/api/endpoints/im.rb +6 -6
  55. data/lib/slack/web/api/endpoints/migration.rb +25 -0
  56. data/lib/slack/web/api/endpoints/mpim.rb +6 -6
  57. data/lib/slack/web/api/endpoints/oauth.rb +2 -2
  58. data/lib/slack/web/api/endpoints/pins.rb +3 -3
  59. data/lib/slack/web/api/endpoints/presence.rb +1 -1
  60. data/lib/slack/web/api/endpoints/reactions.rb +4 -4
  61. data/lib/slack/web/api/endpoints/reminders.rb +5 -5
  62. data/lib/slack/web/api/endpoints/rtm.rb +3 -7
  63. data/lib/slack/web/api/endpoints/search.rb +3 -3
  64. data/lib/slack/web/api/endpoints/stars.rb +3 -3
  65. data/lib/slack/web/api/endpoints/team.rb +4 -4
  66. data/lib/slack/web/api/endpoints/team_profile.rb +1 -1
  67. data/lib/slack/web/api/endpoints/usergroups.rb +5 -5
  68. data/lib/slack/web/api/endpoints/usergroups_users.rb +2 -2
  69. data/lib/slack/web/api/endpoints/users.rb +8 -8
  70. data/lib/slack/web/api/endpoints/users_admin.rb +46 -0
  71. data/lib/slack/web/api/endpoints/users_prefs.rb +19 -0
  72. data/lib/slack/web/api/endpoints/users_profile.rb +2 -2
  73. data/lib/slack/web/api/endpoints.rb +10 -2
  74. data/lib/slack/web/api/mixins/ids.id.rb +1 -1
  75. data/lib/slack/web/api/mixins/users.search.rb +38 -36
  76. data/lib/slack/web/api/patches/chat.1.text-attachments-required.patch +1 -1
  77. data/lib/slack/web/api/patches/chat.3.update-attachments-support.patch +1 -1
  78. data/lib/slack/web/api/patches/dialog.1.open-json-support.patch +17 -0
  79. data/lib/slack/web/api/templates/command.erb +2 -1
  80. data/lib/slack/web/api/templates/commands.erb +1 -1
  81. data/lib/slack/web/api/templates/endpoints.erb +2 -2
  82. data/lib/slack/web/api/templates/method.erb +8 -3
  83. data/lib/slack/web/api/templates/method_spec.erb +1 -1
  84. data/lib/slack/web/config.rb +12 -12
  85. data/lib/slack/web/faraday/response/raise_error.rb +3 -3
  86. data/lib/tasks/git.rake +1 -1
  87. data/lib/tasks/real_time.rake +1 -1
  88. data/lib/tasks/web.rake +4 -1
  89. data/slack-ruby-client.gemspec +2 -3
  90. data/spec/slack/messages/formatting_spec.rb +1 -1
  91. data/spec/slack/real_time/client_spec.rb +3 -2
  92. data/spec/slack/real_time/concurrency/celluloid_spec.rb +1 -1
  93. data/spec/slack/real_time/concurrency/it_behaves_like_a_realtime_socket.rb +1 -1
  94. data/spec/slack/real_time/event_handlers/bot_spec.rb +4 -2
  95. data/spec/slack/real_time/event_handlers/event_handlers_spec.rb +1 -1
  96. data/spec/slack/real_time/event_handlers/user_spec.rb +4 -2
  97. data/spec/slack/web/api/endpoints/custom_specs/dialog_spec.rb +28 -0
  98. data/spec/slack/web/api/endpoints/custom_specs/users_spec.rb +8 -6
  99. data/spec/slack/web/api/endpoints/files_spec.rb +16 -0
  100. data/spec/slack/web/api/endpoints/migration_spec.rb +12 -0
  101. data/spec/slack/web/api/endpoints/users_admin_spec.rb +17 -0
  102. data/spec/slack/web/api/endpoints/users_prefs_spec.rb +7 -0
  103. data/spec/slack/web/api/error_spec.rb +1 -1
  104. data/spec/slack/web/api/errors/slack_error_spec.rb +1 -1
  105. data/spec/slack/web/api/mixins/users_spec.rb +6 -4
  106. data/spec/support/queue_with_timeout.rb +1 -1
  107. data/spec/support/real_time/concurrency/mock.rb +1 -2
  108. metadata +34 -31
@@ -0,0 +1,19 @@
1
+ # This file was auto-generated by lib/tasks/web.rake
2
+
3
+ module Slack
4
+ module Web
5
+ module Api
6
+ module Endpoints
7
+ module UsersPrefs
8
+ #
9
+ # Returns the user's preferences (undocumented)
10
+ #
11
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/users.prefs/users.prefs.get.json
12
+ def users_prefs_get(options = {})
13
+ post('users.prefs.get', options)
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -13,7 +13,7 @@ module Slack
13
13
  # @option options [user] :user
14
14
  # User to retrieve profile info for.
15
15
  # @see https://api.slack.com/methods/users.profile.get
16
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/users.profile/users.profile.get.json
16
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users.profile/users.profile.get.json
17
17
  def users_profile_get(options = {})
18
18
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
19
19
  post('users.profile.get', options)
@@ -31,7 +31,7 @@ module Slack
31
31
  # @option options [Object] :value
32
32
  # Value to set a single key to. Usable only if profile is not passed.
33
33
  # @see https://api.slack.com/methods/users.profile.set
34
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/users.profile/users.profile.set.json
34
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/users.profile/users.profile.set.json
35
35
  def users_profile_set(options = {})
36
36
  options = options.merge(user: users_id(options)['user']['id']) if options[:user]
37
37
  post('users.profile.set', options)
@@ -7,12 +7,14 @@ require_relative 'endpoints/bots'
7
7
  require_relative 'endpoints/channels'
8
8
  require_relative 'endpoints/chat'
9
9
  require_relative 'endpoints/conversations'
10
+ require_relative 'endpoints/dialog'
10
11
  require_relative 'endpoints/dnd'
11
12
  require_relative 'endpoints/emoji'
12
- require_relative 'endpoints/files_comments'
13
13
  require_relative 'endpoints/files'
14
+ require_relative 'endpoints/files_comments'
14
15
  require_relative 'endpoints/groups'
15
16
  require_relative 'endpoints/im'
17
+ require_relative 'endpoints/migration'
16
18
  require_relative 'endpoints/mpim'
17
19
  require_relative 'endpoints/oauth'
18
20
  require_relative 'endpoints/pins'
@@ -26,6 +28,8 @@ require_relative 'endpoints/team_profile'
26
28
  require_relative 'endpoints/usergroups'
27
29
  require_relative 'endpoints/usergroups_users'
28
30
  require_relative 'endpoints/users'
31
+ require_relative 'endpoints/users_admin'
32
+ require_relative 'endpoints/users_prefs'
29
33
  require_relative 'endpoints/users_profile'
30
34
 
31
35
  module Slack
@@ -43,12 +47,14 @@ module Slack
43
47
  include Channels
44
48
  include Chat
45
49
  include Conversations
50
+ include Dialog
46
51
  include Dnd
47
52
  include Emoji
48
- include FilesComments
49
53
  include Files
54
+ include FilesComments
50
55
  include Groups
51
56
  include Im
57
+ include Migration
52
58
  include Mpim
53
59
  include Oauth
54
60
  include Pins
@@ -62,6 +68,8 @@ module Slack
62
68
  include Usergroups
63
69
  include UsergroupsUsers
64
70
  include Users
71
+ include UsersAdmin
72
+ include UsersPrefs
65
73
  include UsersProfile
66
74
  end
67
75
  end
@@ -14,7 +14,7 @@ module Slack
14
14
  end
15
15
  end
16
16
 
17
- fail Slack::Web::Api::Errors::SlackError, not_found_error
17
+ raise Slack::Web::Api::Errors::SlackError, not_found_error
18
18
  end
19
19
  end
20
20
  end
@@ -1,43 +1,45 @@
1
- module Slack
2
- module Web
3
- module Api
4
- module Mixins
5
- module Users
6
- Member = Struct.new :id, :name, :first_name, :last_name, :real_name, :email
1
+ if defined?(Picky)
2
+ module Slack
3
+ module Web
4
+ module Api
5
+ module Mixins
6
+ module Users
7
+ Member = Struct.new :id, :name, :first_name, :last_name, :real_name, :email
7
8
 
8
- #
9
- # This method searches for users.
10
- #
11
- # @option options [user] :user
12
- # Free-formed text to search for.
13
- def users_search(options = {})
14
- query = options[:user]
15
- throw ArgumentError.new('Required arguments :user missing') if query.nil?
16
- index = Picky::Index.new(:users) do
17
- category :name
18
- category :first_name
19
- category :last_name
20
- category :real_name
21
- category :email
9
+ #
10
+ # This method searches for users.
11
+ #
12
+ # @option options [user] :user
13
+ # Free-formed text to search for.
14
+ def users_search(options = {})
15
+ query = options[:user]
16
+ throw ArgumentError.new('Required arguments :user missing') if query.nil?
17
+ index = Picky::Index.new(:users) do
18
+ category :name
19
+ category :first_name
20
+ category :last_name
21
+ category :real_name
22
+ category :email
23
+ end
24
+ members = users_list.members
25
+ members.each_with_index do |member, id|
26
+ user = Member.new(
27
+ id,
28
+ member.name,
29
+ member.profile.first_name,
30
+ member.profile.last_name,
31
+ member.profile.real_name,
32
+ member.profile.email
33
+ )
34
+ index.add(user)
35
+ end
36
+ ids = Picky::Search.new(index).search(query, 5, 0, unique: true).ids
37
+ results = ids.map { |id| members[id] }
38
+ Slack::Messages::Message.new('ok' => true, 'members' => results)
22
39
  end
23
- members = users_list.members
24
- members.each_with_index do |member, id|
25
- user = Member.new(
26
- id,
27
- member.name,
28
- member.profile.first_name,
29
- member.profile.last_name,
30
- member.profile.real_name,
31
- member.profile.email
32
- )
33
- index.add(user)
34
- end
35
- ids = Picky::Search.new(index).search(query, 5, 0, unique: true).ids
36
- results = ids.map { |id| members[id] }
37
- Slack::Messages::Message.new('ok' => true, 'members' => results)
38
40
  end
39
41
  end
40
42
  end
41
43
  end
42
44
  end
43
- end if defined?(Picky)
45
+ end
@@ -3,7 +3,7 @@ index 1f7a8d7..2ec4bed 100644
3
3
  --- a/lib/slack/web/api/endpoints/chat.rb
4
4
  +++ b/lib/slack/web/api/endpoints/chat.rb
5
5
  @@ -49,7 +49,7 @@ module Slack
6
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
6
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.postMessage.json
7
7
  def chat_postMessage(options = {})
8
8
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
9
9
  - throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
@@ -3,7 +3,7 @@ index 5186416..490bc91 100644
3
3
  --- a/lib/slack/web/api/endpoints/chat.rb
4
4
  +++ b/lib/slack/web/api/endpoints/chat.rb
5
5
  @@ -154,9 +154,15 @@ module Slack
6
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/chat/chat.update.json
6
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/chat/chat.update.json
7
7
  def chat_update(options = {})
8
8
  throw ArgumentError.new('Required arguments :channel missing') if options[:channel].nil?
9
9
  - throw ArgumentError.new('Required arguments :text missing') if options[:text].nil?
@@ -0,0 +1,17 @@
1
+ diff --git a/lib/slack/web/api/endpoints/dialog.rb b/lib/slack/web/api/endpoints/dialog.rb
2
+ index 01f9dfd..d017adf 100644
3
+ --- a/lib/slack/web/api/endpoints/dialog.rb
4
+ +++ b/lib/slack/web/api/endpoints/dialog.rb
5
+ @@ -17,6 +17,12 @@ module Slack
6
+ def dialog_open(options = {})
7
+ throw ArgumentError.new('Required arguments :dialog missing') if options[:dialog].nil?
8
+ throw ArgumentError.new('Required arguments :trigger_id missing') if options[:trigger_id].nil?
9
+ + # dialog must be passed as an encoded JSON string
10
+ + if options.key?(:dialog)
11
+ + dialog = options[:dialog]
12
+ + dialog = JSON.dump(dialog) unless dialog.is_a?(String)
13
+ + options = options.merge(dialog: dialog)
14
+ + end
15
+ post('dialog.open', options)
16
+ end
17
+ end
@@ -7,11 +7,12 @@ desc "<%= desc %>"
7
7
  desc '<%= desc %>'
8
8
  <% end %>
9
9
  command '<%= group['name'].gsub(".", "_") %>' do |g|
10
- <% names.each_with_index do |(name, data), index| %>
10
+ <% names.sort.each_with_index do |(name, data), index| %>
11
11
  <% if index > 0 %>
12
12
 
13
13
  <% end %>
14
14
  <% short_desc = data["desc"].split("\n").first %>
15
+ <% short_desc += ' (undocumented)' if data['undocumented'] %>
15
16
  <% if short_desc.include?("'") %>
16
17
  g.desc "<%= short_desc %>"
17
18
  <% else %>
@@ -1,5 +1,5 @@
1
1
  # This file was auto-generated by lib/tasks/web.rake
2
2
 
3
- <% files.each do |f| %>
3
+ <% files.sort.each do |f| %>
4
4
  require 'commands/<%= f %>'
5
5
  <% end %>
@@ -1,6 +1,6 @@
1
1
  # This file was auto-generated by lib/tasks/web.rake
2
2
 
3
- <% files.each do |f| %>
3
+ <% files.sort.each do |f| %>
4
4
  require_relative 'endpoints/<%= f %>'
5
5
  <% end %>
6
6
 
@@ -12,7 +12,7 @@ module Slack
12
12
  include Slack::Web::Api::Mixins::Users
13
13
  include Slack::Web::Api::Mixins::Groups
14
14
 
15
- <% files.each do |f| %>
15
+ <% files.sort.each do |f| %>
16
16
  include <%= f.camelize %>
17
17
  <% end %>
18
18
  end
@@ -5,13 +5,14 @@ module Slack
5
5
  module Api
6
6
  module Endpoints
7
7
  module <%= group.gsub(".", "_").camelize %>
8
- <% names.each_with_index do |(name, data), index| %>
8
+ <% names.sort.each_with_index do |(name, data), index| %>
9
9
  <% next if data['mixin'] %>
10
10
  <% if index > 0 %>
11
11
 
12
12
  <% end %>
13
13
  #
14
- <% data['desc'].split("\n").each do |line| %>
14
+ <% data['desc'].split("\n").each_with_index do |line, index| %>
15
+ <% line += ' (undocumented)' if data['undocumented'] && index == 0 %>
15
16
  # <%= line %>
16
17
  <% end %>
17
18
  #
@@ -25,8 +26,12 @@ module Slack
25
26
  <% end %>
26
27
  <% end %>
27
28
  <% end %>
29
+ <% if data['undocumented'] %>
30
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/undocumented/<%= group %>/<%= group %>.<%= name %>.json
31
+ <% else %>
28
32
  # @see https://api.slack.com/methods/<%= group %>.<%= name %>
29
- # @see https://github.com/dblock/slack-api-ref/blob/master/methods/<%= group %>/<%= group %>.<%= name %>.json
33
+ # @see https://github.com/slack-ruby/slack-api-ref/blob/master/methods/<%= group %>/<%= group %>.<%= name %>.json
34
+ <% end %>
30
35
  def <%= group.gsub(".", "_") %>_<%= name %>(options = {})
31
36
  <% data['args'].select{ |k, v| v['required'] }.each do |arg_name, arg_v| %>
32
37
  throw ArgumentError.new('Required arguments :<%= arg_name %> missing') if options[:<%= arg_name %>].nil?
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
 
5
5
  RSpec.describe Slack::Web::Api::Endpoints::<%= group.gsub(".", "_").camelize %> do
6
6
  let(:client) { Slack::Web::Client.new }
7
- <% names.each_with_index do |(name, data), index| %>
7
+ <% names.sort.each_with_index do |(name, data), index| %>
8
8
  <% next if data['mixin'] %>
9
9
  <% required_params = data['args'].select{ |k, v| v['required'] } %>
10
10
  <% next if required_params.none? %>
@@ -3,18 +3,18 @@ module Slack
3
3
  module Config
4
4
  extend self
5
5
 
6
- ATTRIBUTES = [
7
- :proxy,
8
- :user_agent,
9
- :ca_path,
10
- :ca_file,
11
- :logger,
12
- :endpoint,
13
- :token,
14
- :timeout,
15
- :open_timeout,
16
- :default_page_size,
17
- :default_max_retries
6
+ ATTRIBUTES = %i[
7
+ proxy
8
+ user_agent
9
+ ca_path
10
+ ca_file
11
+ logger
12
+ endpoint
13
+ token
14
+ timeout
15
+ open_timeout
16
+ default_page_size
17
+ default_max_retries
18
18
  ].freeze
19
19
 
20
20
  attr_accessor(*Config::ATTRIBUTES)
@@ -5,11 +5,11 @@ module Slack
5
5
  class RaiseError < ::Faraday::Response::Middleware
6
6
  def on_complete(env)
7
7
  if env.status == 429
8
- fail Slack::Web::Api::Errors::TooManyRequestsError, env.response
8
+ raise Slack::Web::Api::Errors::TooManyRequestsError, env.response
9
9
  elsif (body = env.body) && body['ok']
10
- return
10
+ nil
11
11
  else
12
- fail Slack::Web::Api::Errors::SlackError.new(body['error'], env.response)
12
+ raise Slack::Web::Api::Errors::SlackError.new(body['error'], env.response)
13
13
  end
14
14
  end
15
15
  end
data/lib/tasks/git.rake CHANGED
@@ -1,5 +1,5 @@
1
1
  namespace :slack do
2
- # update slack-api-ref from https://github.com/dblock/slack-api-ref
2
+ # update slack-api-ref from https://github.com/slack-ruby/slack-api-ref
3
3
  task :git_update do
4
4
  sh 'git submodule update --init --recursive'
5
5
  sh 'git submodule foreach git pull origin master'
@@ -14,7 +14,7 @@ namespace :slack do
14
14
  name = File.basename(path, '.json')
15
15
  parsed = JSON.parse(File.read(path))
16
16
  JSON::Validator.validate(event_schema, parsed, insert_defaults: true)
17
- next if %w(message hello).include?(name)
17
+ next if %w[message hello].include?(name)
18
18
  result[name] = parsed
19
19
  end
20
20
 
data/lib/tasks/web.rake CHANGED
@@ -13,6 +13,7 @@ namespace :slack do
13
13
  groups = Dir.glob('lib/slack/web/api/slack-api-ref/groups/**/*.json').each_with_object({}) do |path, result|
14
14
  name = File.basename(path, '.json')
15
15
  parsed = JSON.parse(File.read(path))
16
+ parsed['undocumented'] = true if path =~ /undocumented/
16
17
  JSON::Validator.validate(group_schema, parsed, insert_defaults: true)
17
18
  result[name] = parsed
18
19
  end
@@ -27,6 +28,7 @@ namespace :slack do
27
28
  name = file_name.split('.')[-1]
28
29
  result[prefix] ||= {}
29
30
  parsed = JSON.parse(File.read(path))
31
+ parsed['undocumented'] = true if path =~ /undocumented/
30
32
  JSON::Validator.validate(method_schema, parsed, insert_defaults: true)
31
33
  result[prefix][name] = parsed
32
34
  end
@@ -47,9 +49,10 @@ namespace :slack do
47
49
  end
48
50
  Dir.glob("lib/slack/web/api/patches/#{group}*.patch").sort.each do |patch|
49
51
  puts "- patching #{patch}"
50
- system("git apply #{patch}") || fail('failed to apply patch')
52
+ system("git apply #{patch}") || raise('failed to apply patch')
51
53
  end
52
54
  # command
55
+ raise "Missing group #{group}" unless groups.key?(group)
53
56
  rendered_command = command_template.result(group: groups[group], names: names)
54
57
  File.write "bin/commands/#{snaked_group}.rb", rendered_command
55
58
  end
@@ -19,15 +19,14 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency 'activesupport'
20
20
  s.add_dependency 'faraday', '>= 0.9'
21
21
  s.add_dependency 'faraday_middleware'
22
- s.add_dependency 'json'
23
- s.add_dependency 'websocket-driver'
24
22
  s.add_dependency 'gli'
25
23
  s.add_dependency 'hashie'
24
+ s.add_dependency 'websocket-driver'
26
25
  s.add_development_dependency 'erubis'
27
26
  s.add_development_dependency 'json-schema'
28
27
  s.add_development_dependency 'rake', '~> 10'
29
28
  s.add_development_dependency 'rspec'
29
+ s.add_development_dependency 'rubocop', '0.51.0'
30
30
  s.add_development_dependency 'vcr'
31
31
  s.add_development_dependency 'webmock'
32
- s.add_development_dependency 'rubocop', '0.35.0'
33
32
  end
@@ -1,4 +1,4 @@
1
- # encoding: utf-8
1
+
2
2
  require 'spec_helper'
3
3
 
4
4
  describe Slack::Messages::Formatting do
@@ -235,7 +235,7 @@ RSpec.describe Slack::RealTime::Client do
235
235
  it 'sets default store_class' do
236
236
  expect(client.send(:store_class)).to eq Slack::RealTime::Store
237
237
  end
238
- (Slack::RealTime::Config::ATTRIBUTES - [:logger, :store_class]).each do |key|
238
+ (Slack::RealTime::Config::ATTRIBUTES - %i[logger store_class]).each do |key|
239
239
  it "sets #{key}" do
240
240
  expect(client.send(key)).to eq Slack::RealTime::Config.send(key)
241
241
  end
@@ -304,7 +304,8 @@ RSpec.describe Slack::RealTime::Client do
304
304
  proxy: {
305
305
  origin: 'http://username:password@proxy.example.com',
306
306
  headers: { 'User-Agent' => 'ruby' }
307
- }).and_return(ws)
307
+ }
308
+ ).and_return(ws)
308
309
  client.start!
309
310
  end
310
311
  end
@@ -13,7 +13,7 @@ begin
13
13
  let(:test_socket) do
14
14
  Class.new(described_class) do
15
15
  def read
16
- fail options[:err]
16
+ raise options[:err]
17
17
  end
18
18
  end
19
19
  end