mock_redis 0.50.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/mock_redis/database.rb +11 -1
- data/lib/mock_redis/hash_methods.rb +1 -1
- data/lib/mock_redis/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e933ae58d27e242f827d68d17dc8361327ce7c662cba7973ca4a44c4c9265a7
|
4
|
+
data.tar.gz: f9bd080555a7c7f3aaec09d5e55327281b3a2860d5045d4e172812def4ea8c82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c09ef4f19dce4b289f5a205a1d34c284d0c78b98969cfeb8aa04eb76d5a10cf41e5d88f8bb2d85332a5d37d66d09c6262bc19f179ffce2e0e754113c8bfdaa71
|
7
|
+
data.tar.gz: a8e824ef5dbf40a9406404eb5c8b5e2bd3cde46c0be994f36724be3beac97bb1f2d4168d557ede3c15f3085e8a03f155d4a88f48b83720b28c1779b8ebd5a0a0
|
data/CHANGELOG.md
CHANGED
data/lib/mock_redis/database.rb
CHANGED
@@ -51,7 +51,12 @@ class MockRedis
|
|
51
51
|
def call(*command, &_block)
|
52
52
|
# allow for single array argument or multiple arguments
|
53
53
|
command = command[0] if command.length == 1
|
54
|
-
|
54
|
+
|
55
|
+
if command[0].downcase.to_s.include?('expire')
|
56
|
+
send_expires(command)
|
57
|
+
else
|
58
|
+
public_send(command[0].downcase, *command[1..])
|
59
|
+
end
|
55
60
|
end
|
56
61
|
|
57
62
|
def auth(_)
|
@@ -351,6 +356,11 @@ class MockRedis
|
|
351
356
|
!!Float(str) rescue false
|
352
357
|
end
|
353
358
|
|
359
|
+
def send_expires(command)
|
360
|
+
command, key, ttl, option = *command
|
361
|
+
public_send(command, key, ttl, option.downcase.to_sym => option)
|
362
|
+
end
|
363
|
+
|
354
364
|
def should_update_expiration?(expiry, new_expiry, nx:, xx:, lt:, gt:) # rubocop:disable Metrics/ParameterLists
|
355
365
|
return false if nx && expiry || xx && !expiry
|
356
366
|
return false if lt && expiry && new_expiry > expiry
|
data/lib/mock_redis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.52.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
- Samuel Merritt
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -124,10 +124,10 @@ licenses:
|
|
124
124
|
- MIT
|
125
125
|
metadata:
|
126
126
|
bug_tracker_uri: https://github.com/sds/mock_redis/issues
|
127
|
-
changelog_uri: https://github.com/sds/mock_redis/blob/v0.
|
128
|
-
documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.
|
127
|
+
changelog_uri: https://github.com/sds/mock_redis/blob/v0.52.0/CHANGELOG.md
|
128
|
+
documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.52.0
|
129
129
|
homepage_uri: https://github.com/sds/mock_redis
|
130
|
-
source_code_uri: https://github.com/sds/mock_redis/tree/v0.
|
130
|
+
source_code_uri: https://github.com/sds/mock_redis/tree/v0.52.0
|
131
131
|
rdoc_options: []
|
132
132
|
require_paths:
|
133
133
|
- lib
|