Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop giphy dependency #89

Merged
merged 4 commits into from
Jul 31, 2016
Merged

Conversation

tmsrjs
Copy link
Contributor

@tmsrjs tmsrjs commented Jul 30, 2016

Although GIFs are a nice feature they're not really necessary for all bots.
This PR drops the dependency on giphy.
If giphy is installed, everything will work as up until now.

@@ -2,5 +2,6 @@ rvm:
- 2.3.0
env:
- CONCURRENCY=celluloid-io
- CONCURRENCY=celluloid-io WITH_GIPHY=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just call it GIPHY to be consistent with CONCURRENCY, nbd though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about that as well, but since CONCURRENCY is a requirement and giphy is optional, I think the WITH_ prefix makes it's purpose a bit more clear.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@dblock
Copy link
Collaborator

dblock commented Jul 30, 2016

I am down with this change, I think it's a good idea.

I'd like it to behave in a more backward compatible fashion. I think saying "include a dependency on giphy and that turns on GIFs" is better than having to tweak environment variables. So keep the environment settings "as is", but just make things work without the dependency as before?

Also please update CHANGELOG and UPGRADING.

Thanks!

@tmsrjs
Copy link
Contributor Author

tmsrjs commented Jul 30, 2016

I'm sorry, I don't think I follow. Do you mean to leave GIFs enabled by default, just don't blow up if giphy isn't installed?
Also, since it's not sensitive data that needs to be passed as an env var (a la Heroku), I'd just drop SLACK_RUBY_BOT_SEND_GIFS in favour of SlackRubyBot::Config.send_gifs, what do you think?
I'll update CHANGELOG and UPGRADING as soon as we get this sorted out

@dblock
Copy link
Collaborator

dblock commented Jul 31, 2016

Yes.

If giphy is installed, everything works as before (aka GIFs are enabled as before, you can turn them off and on via ENV or whatever is already in-place, no or little code should really change here).

If giphy is not installed, GIFs are disabled, environment variables have no effect, ideally settings like send_gifs shouldn't even be available at runtime and raise exceptions.

@@ -2,8 +2,6 @@

RSpec::Matchers.define :respond_with_error do |error, error_message|
match do |actual|
allow(Giphy).to receive(:random)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to break downstream users upgrading the library. I think this needs to be put back and have a if defined?(Giphy) or one of those.

@dblock
Copy link
Collaborator

dblock commented Jul 31, 2016

My only remaining issue is with shared rspec behaviors, sorry I missed this in the first CR. Thanks for hanging on here!

GIF support is enabled by default if Giphy is installed but we don't
want to force it onto users during tests.
@dblock
Copy link
Collaborator

dblock commented Jul 31, 2016

Looks good, merging, thanks!

@dblock dblock merged commit c240cd3 into slack-ruby:master Jul 31, 2016
@tmsrjs tmsrjs deleted the drop_giphy_dependency branch July 31, 2016 21:58
@dblock dblock mentioned this pull request May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants