Skip to content

Commit

Permalink
Removed GIFs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Jun 28, 2020
1 parent dffcf86 commit b50f870
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sample_apps/sample_app_activerecord/commands/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sample_apps/sample_app_mongoid/commands/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion sample_apps/sample_app_mongoid/spec/commands/help_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec/ext/activerecord/commands_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/ext/mongoid/commands_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 0 additions & 4 deletions spec/slack-ruby-bot-server/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
subject do
SlackRubyBotServer::Server.new(
team: team,
send_gifs: false,
aliases: %w[foo bar]
)
end
before do
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
Expand Down

0 comments on commit b50f870

Please sign in to comment.