mock_redis 0.44.0 → 0.46.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/README.md +6 -7
- data/lib/mock_redis/hash_methods.rb +1 -0
- data/lib/mock_redis/list_methods.rb +7 -2
- data/lib/mock_redis/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ced935cd314aee4b33828b9e04c890b4bf4cf36b6e09b93cf6b3b3a3a0bd619a
|
4
|
+
data.tar.gz: def8f4648486a13f063a906df2fade9e33f703e9e5c019516f227049217c64b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c73c851717ac57510e528adad4f5a6f4277abef68338d49be40871bc366937270f90d977c777e18eb0b2d0d0b1e787f3a8e3cd59a51886a57c045f655211cebe
|
7
|
+
data.tar.gz: b47fbb5cffd0d47270915cb786ac50fa30dd00fc1b064d82b1e3d754ad746b2da2a1cbdbc53e5210cd098174b7e1bac2ecbc880ee32576fe24eeea4b7e0376ed
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,16 @@
|
|
1
1
|
# MockRedis Changelog
|
2
2
|
|
3
|
+
### 0.46.0
|
4
|
+
|
5
|
+
* Fix `hset` for array of key-value pairs
|
6
|
+
|
7
|
+
### 0.45.0
|
8
|
+
|
9
|
+
* Add support for `count` argument of `rpop`
|
10
|
+
|
3
11
|
### 0.44.0
|
4
12
|
|
5
|
-
* Add
|
13
|
+
* Add support for `memory usage` command
|
6
14
|
|
7
15
|
### 0.43.0
|
8
16
|
|
data/README.md
CHANGED
@@ -27,13 +27,12 @@ call the same methods on it as you can call on a real `Redis` object.
|
|
27
27
|
|
28
28
|
For example:
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
30
|
+
```ruby
|
31
|
+
require 'mock_redis'
|
32
|
+
mr = MockRedis.new
|
33
|
+
mr.set('some key', 'some value') # => "OK"
|
34
|
+
mr.get('some key') # => "some value"
|
35
|
+
```
|
37
36
|
## Supported Features
|
38
37
|
|
39
38
|
mock_redis supports most of the methods that redis-rb does. Examples
|
@@ -186,8 +186,13 @@ class MockRedis
|
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
|
-
def rpop(key)
|
190
|
-
with_list_at(key) { |list| list&.pop }
|
189
|
+
def rpop(key, count = nil)
|
190
|
+
return with_list_at(key) { |list| list&.pop } if count.nil?
|
191
|
+
|
192
|
+
record_count = llen(key)
|
193
|
+
return nil if record_count.zero?
|
194
|
+
|
195
|
+
[record_count, count].min.times.map { with_list_at(key, &:pop) }
|
191
196
|
end
|
192
197
|
|
193
198
|
def rpoplpush(source, destination)
|
data/lib/mock_redis/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mock_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.46.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
- Samuel Merritt
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -124,11 +124,11 @@ 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.46.0/CHANGELOG.md
|
128
|
+
documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.46.0
|
129
129
|
homepage_uri: https://github.com/sds/mock_redis
|
130
|
-
source_code_uri: https://github.com/sds/mock_redis/tree/v0.
|
131
|
-
post_install_message:
|
130
|
+
source_code_uri: https://github.com/sds/mock_redis/tree/v0.46.0
|
131
|
+
post_install_message:
|
132
132
|
rdoc_options: []
|
133
133
|
require_paths:
|
134
134
|
- lib
|
@@ -143,8 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.
|
147
|
-
signing_key:
|
146
|
+
rubygems_version: 3.5.9
|
147
|
+
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Redis mock that just lives in memory; useful for testing.
|
150
150
|
test_files: []
|