From b50f870f30150127acc0b974cc2e868967576e3e Mon Sep 17 00:00:00 2001 From: dblock Date: Sun, 28 Jun 2020 09:06:17 -0400 Subject: [PATCH] Removed GIFs. --- CHANGELOG.md | 1 + Gemfile | 2 ++ .../ext/activerecord/slack-ruby-bot/commands/base.rb | 2 +- .../ext/mongoid/slack-ruby-bot/commands/base.rb | 4 ++-- sample_apps/sample_app_activerecord/commands/help.rb | 2 +- .../sample_app_activerecord/spec/commands/help_spec.rb | 2 +- sample_apps/sample_app_mongoid/commands/help.rb | 2 +- sample_apps/sample_app_mongoid/spec/commands/help_spec.rb | 2 +- spec/ext/activerecord/commands_spec.rb | 2 +- spec/ext/mongoid/commands_spec.rb | 4 ++-- spec/slack-ruby-bot-server/server_spec.rb | 4 ---- 11 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e37be7..f0ffa3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ #### 0.12.2 (Next) +* [#120](https://github.com/slack-ruby/slack-ruby-bot-server/pull/120): Removed GIFs - [@dblock](https://github.com/dblock). * Your contribution here. #### 0.12.1 (2020/5/16) diff --git a/Gemfile b/Gemfile index 575a4be..38fdc98 100644 --- a/Gemfile +++ b/Gemfile @@ -40,3 +40,5 @@ end group :test do gem 'slack-ruby-danger', '~> 0.1.0', require: false end + +gem 'slack-ruby-bot', github: 'slack-ruby/slack-ruby-bot' diff --git a/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb b/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb index 3519cec..b205259 100644 --- a/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb +++ b/lib/slack-ruby-bot-server/ext/activerecord/slack-ruby-bot/commands/base.rb @@ -9,7 +9,7 @@ def invoke(client, data) rescue StandardError => e logger.info "#{name.demodulize.upcase}: #{client.owner}, #{e.class}: #{e}" logger.debug e.backtrace.join("\n") - client.say(channel: data.channel, text: e.message, gif: 'error') + client.say(channel: data.channel, text: e.message) true end end diff --git a/lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb b/lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb index 593d32f..7a8bc10 100644 --- a/lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb +++ b/lib/slack-ruby-bot-server/ext/mongoid/slack-ruby-bot/commands/base.rb @@ -8,12 +8,12 @@ def invoke(client, data) _invoke client, data rescue Mongoid::Errors::Validations => e logger.info "#{name.demodulize.upcase}: #{client.owner}, error - #{e.document.class}, #{e.document.errors.to_hash}" - client.say(channel: data.channel, text: e.document.errors.first[1], gif: 'error') + client.say(channel: data.channel, text: e.document.errors.first[1]) true rescue StandardError => e logger.info "#{name.demodulize.upcase}: #{client.owner}, #{e.class}: #{e}" logger.debug e.backtrace.join("\n") - client.say(channel: data.channel, text: e.message, gif: 'error') + client.say(channel: data.channel, text: e.message) true end end diff --git a/sample_apps/sample_app_activerecord/commands/help.rb b/sample_apps/sample_app_activerecord/commands/help.rb index 97d4aa8..e584b66 100644 --- a/sample_apps/sample_app_activerecord/commands/help.rb +++ b/sample_apps/sample_app_activerecord/commands/help.rb @@ -13,7 +13,7 @@ class Help < SlackRubyBot::Commands::Base EOS def self.call(client, data, _match) client.say(channel: data.channel, text: [HELP, SlackRubyBotServer::INFO].join("\n")) - client.say(channel: data.channel, gif: 'help') + client.say(channel: data.channel) logger.info "HELP: #{client.owner}, user=#{data.user}" end end diff --git a/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb b/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb index a8d8914..ba759d7 100644 --- a/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb +++ b/sample_apps/sample_app_activerecord/spec/commands/help_spec.rb @@ -8,7 +8,7 @@ let(:message_hook) { SlackRubyBot::Hooks::Message.new } it 'default' do expect(client).to receive(:say).with(channel: 'channel', text: [Help::HELP, SlackRubyBotServer::INFO].join("\n")) - expect(client).to receive(:say).with(channel: 'channel', gif: 'help') + expect(client).to receive(:say).with(channel: 'channel') message_hook.call(client, Hashie::Mash.new(channel: 'channel', text: "#{SlackRubyBot.config.user} help")) end end diff --git a/sample_apps/sample_app_mongoid/commands/help.rb b/sample_apps/sample_app_mongoid/commands/help.rb index 97d4aa8..e584b66 100644 --- a/sample_apps/sample_app_mongoid/commands/help.rb +++ b/sample_apps/sample_app_mongoid/commands/help.rb @@ -13,7 +13,7 @@ class Help < SlackRubyBot::Commands::Base EOS def self.call(client, data, _match) client.say(channel: data.channel, text: [HELP, SlackRubyBotServer::INFO].join("\n")) - client.say(channel: data.channel, gif: 'help') + client.say(channel: data.channel) logger.info "HELP: #{client.owner}, user=#{data.user}" end end diff --git a/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb b/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb index a8d8914..ba759d7 100644 --- a/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb +++ b/sample_apps/sample_app_mongoid/spec/commands/help_spec.rb @@ -8,7 +8,7 @@ let(:message_hook) { SlackRubyBot::Hooks::Message.new } it 'default' do expect(client).to receive(:say).with(channel: 'channel', text: [Help::HELP, SlackRubyBotServer::INFO].join("\n")) - expect(client).to receive(:say).with(channel: 'channel', gif: 'help') + expect(client).to receive(:say).with(channel: 'channel') message_hook.call(client, Hashie::Mash.new(channel: 'channel', text: "#{SlackRubyBot.config.user} help")) end end diff --git a/spec/ext/activerecord/commands_spec.rb b/spec/ext/activerecord/commands_spec.rb index 57ce501..b220f28 100644 --- a/spec/ext/activerecord/commands_spec.rb +++ b/spec/ext/activerecord/commands_spec.rb @@ -11,7 +11,7 @@ end it 'responds to channel with exception message' do - expect(client).to receive(:say).with(channel: 'channel', text: 'mock error', gif: 'error') + expect(client).to receive(:say).with(channel: 'channel', text: 'mock error') message_hook.call(client, Hashie::Mash.new(text: 'raising exception', channel: 'channel', user: 'user')) end end diff --git a/spec/ext/mongoid/commands_spec.rb b/spec/ext/mongoid/commands_spec.rb index d01b4d4..21671d1 100644 --- a/spec/ext/mongoid/commands_spec.rb +++ b/spec/ext/mongoid/commands_spec.rb @@ -11,7 +11,7 @@ end it 'responds to channel with exception message' do - expect(client).to receive(:say).with(channel: 'channel', text: 'mock error', gif: 'error') + expect(client).to receive(:say).with(channel: 'channel', text: 'mock error') message_hook.call(client, Hashie::Mash.new(text: 'raising exception', channel: 'channel', user: 'user')) end end @@ -28,7 +28,7 @@ class MockDocument end it 'responds to channel with exception message' do - expect(client).to receive(:say).with(channel: 'channel', text: "undefined method `mock_id' for #{mock_document.inspect}", gif: 'error') + expect(client).to receive(:say).with(channel: 'channel', text: "undefined method `mock_id' for #{mock_document.inspect}") message_hook.call(client, Hashie::Mash.new(text: 'raising exception', channel: 'channel', user: 'user')) end end diff --git a/spec/slack-ruby-bot-server/server_spec.rb b/spec/slack-ruby-bot-server/server_spec.rb index b5518ab..cbe07cb 100644 --- a/spec/slack-ruby-bot-server/server_spec.rb +++ b/spec/slack-ruby-bot-server/server_spec.rb @@ -7,7 +7,6 @@ subject do SlackRubyBotServer::Server.new( team: team, - send_gifs: false, aliases: %w[foo bar] ) end @@ -15,9 +14,6 @@ allow(subject).to receive(:sleep) allow(logger).to receive(:error) end - it 'sets GIFs' do - expect(subject.send(:client).send_gifs?).to be false - end it 'sets token' do expect(subject.send(:client).token).to eq 'token' end