Comments (4)
but I send 2 argument and ex: (key, value, ex:)
from mock_redis.
It looks like this is due to the Ruby 3 separation of positional and keyword arguments.
mock_redis
defines a set
method with keyword arguments here:
mock_redis/lib/mock_redis/string_methods.rb
Line 215 in 8b01807
However, redis-store
itself consistently never uses keyword arguments in its definition of set
. Instead, it generally defines set
as:
def set(key, value, options = nil)
Because of this, Ruby 3 ends up interpreting redis-store
's call into mock_redis
as sending 3 arguments here:
super(key, value, options)
@sds It looks like #196 introduced keyword arguments to mock_redis
. It looks like that change may need to be backed out in some way in order for mock_redis
to support Ruby 3.
from mock_redis.
Given Ruby 2.7 reached EOL in March 2023, I'm very supportive of a PR that removes support for Ruby 2.x, fixing this in the process.
from mock_redis.
@sds Hmm... looking into this further, it's only with the inclusion of the redis-store
gem where this is an issue, because the redis
gem itself does use keyword arguments for set
:
def set(key, value, ex: nil, px: nil, exat: nil, pxat: nil, nx: nil, xx: nil, keepttl: nil, get: nil)
For this reason, I'm now thinking that the fix should actually be in redis-store
instead.
from mock_redis.
Related Issues (20)
- Not mention XADD was supported for this gem, right? HOT 2
- Add :get keyword to #set method. HOT 1
- Moneta 1.5 support HOT 1
- Unknown keywords: :path, ... after updating to redis-rb 4.7.0
- Release new version HOT 2
- Use MockRedis with Redis::Connection.drivers HOT 3
- deprecation warning
- Incompatible with the new 'redis-client' gem HOT 8
- Add #sadd? to match redis-rb v4.8.0 HOT 1
- Add additional arg to lpop to allow popping multiple records
- TypeError when using `eval()` HOT 1
- Add support for zadd ch, gt, lt options
- Unable to execute `#call` with redis command in `pipelined` HOT 1
- Add :exat and :pxat keywords to #set method HOT 1
- From redis-rb 5.0.0, `sadd` and `srem` always return integers HOT 2
- Add support for `EXPIRE` command options HOT 1
- ArgumentError: wrong number of arguments (given 3, expected 2) When used in conjunction with redis-store HOT 5
- Support for `redis-client` HOT 1
- zrange doesn't support BYSCORE
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock_redis.