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

Require redis-client to ensure that constant is available #319

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

hieuk09
Copy link
Contributor

@hieuk09 hieuk09 commented Dec 2, 2024

Fix #318

@sds sds added the bug label Dec 2, 2024
@sds sds merged commit 7a6447c into sds:main Dec 2, 2024
11 checks passed
@sds
Copy link
Owner

sds commented Dec 2, 2024

Thank you

@bquorning
Copy link

Perhaps redis-client should be added as a dependency in gemspec?

@hieuk09
Copy link
Contributor Author

hieuk09 commented Dec 4, 2024

Hmm, right, I think there should be. I was under assumption that redis 5 is the dependencies but now I realize that it is the development dependencies only.

@sds Should we add redis 5 as the dependencies of the gem?

@bquorning
Copy link

Ah, it turns out I was still using v4.8.1 of the redis gem which does not yet have a dependency on redis-client. The real problem may be that mock_redis lists 'redis', '~> 5' as a development dependency, and not as a runtime dependency:

s.add_development_dependency 'redis', '~> 5'

@hieuk09 hieuk09 changed the title Require redid-client to ensure that constant is available Require redis-client to ensure that constant is available Dec 4, 2024
@hieuk09 hieuk09 deleted the bug/fix-missing-require branch December 4, 2024 13:20
@sds
Copy link
Owner

sds commented Dec 4, 2024

Can you clarify why this should be a runtime dependency when MockRedis is intended to be used for testing (i.e. development) only? Which use cases are people using it for where MockRedis is used in a production context?

@bquorning
Copy link

bquorning commented Dec 4, 2024

Development dependencies are the libraries you need while developing this gem. Runtime dependencies are the libraries I need while using this gem.

It doesn't really matter if I use your gem in a test or production capacity.

… that's how I understand it at least.

@sds
Copy link
Owner

sds commented Dec 4, 2024

Makes sense since by adding MockRedis as a development dependency all of its runtime dependencies also become development dependencies.

Addressed in 0.49.0. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NameError occurs during require unless redis-client is required first
3 participants