mock_redis 0.49.0 → 0.51.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6fef8f0d7eddda743cb337e4f52543ee2ea8c5eb94ece6b882835061a2fb946
4
- data.tar.gz: bd415f8d7e7362ba93a519388424e30d89d051419f492c82f0de9ceb02401f4b
3
+ metadata.gz: 4f278d6ac15f13918a500dcac29da0b08ffe9ea98a1de2ffbd85b1f15458288c
4
+ data.tar.gz: d7de319b624279223b559191e3074f302dd3e0756361c3b8518bf54a48c65459
5
5
  SHA512:
6
- metadata.gz: 30eb06426f7e609fe78e10809c0492b771e1ec608d29fb6a5a488fb01dfbccb9efc48071b016cfa695f9dfa8ba9577d8c9fe6a189ed8be5cddb6ac9f62972c8a
7
- data.tar.gz: 981a665dbb3e15c84e5800071d838ca53e1e2425e16d9182745c67130883f7b29f4c4f8b2bfb1ac0a496a1f334c6e0f47604e26106589a15b89d50b88cc1a350
6
+ metadata.gz: 751aadfbe494b01f02366846da113c70b88f7b50183eb7720be068b8d3e4216405d611c1cc4c7e601a0d7ccded20c5e53b610d81b3c83057c7edc3f310682f43
7
+ data.tar.gz: df3486c232915f484be3d8b5979d7f2a128698d7f3f3069d0121ebd1108b07ef77e305b2945d2cf21fdef9fabc9a8b690d83a116c7009ec6662e92ed1c7991bd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.51.0
4
+
5
+ * Improve performance of `hmget` when fetching many fields
6
+
7
+ ### 0.50.0
8
+
9
+ * Allow `#call` to accept array or multiple arguments
10
+
3
11
  ### 0.49.0
4
12
 
5
13
  * Move `redis` from development dependency to runtime dependency
@@ -48,7 +48,9 @@ class MockRedis
48
48
  # FIXME: Current implementation of `call` does not work propetly with kwarg-options.
49
49
  # i.e. `call("EXPIRE", "foo", 40, "NX")` (which redis-rb will simply transmit to redis-server)
50
50
  # will be passed to `#expire` without keywords transformation.
51
- def call(command, &_block)
51
+ def call(*command, &_block)
52
+ # allow for single array argument or multiple arguments
53
+ command = command[0] if command.length == 1
52
54
  public_send(command[0].downcase, *command[1..])
53
55
  end
54
56
 
@@ -93,7 +93,7 @@ class MockRedis
93
93
 
94
94
  assert_type(key, *fields)
95
95
  assert_has_args(fields, 'hmget')
96
- fields.map { |f| hget(key, f) }
96
+ with_hash_at(key) { |h| h.values_at(*fields.map(&:to_s)) }
97
97
  end
98
98
 
99
99
  def mapped_hmget(key, *fields)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  class MockRedis
5
- VERSION = '0.49.0'
5
+ VERSION = '0.51.0'
6
6
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mock_redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.51.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane da Silva
8
8
  - Samuel Merritt
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-12-04 00:00:00.000000000 Z
11
+ date: 2025-07-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: redis
@@ -125,11 +124,10 @@ licenses:
125
124
  - MIT
126
125
  metadata:
127
126
  bug_tracker_uri: https://github.com/sds/mock_redis/issues
128
- changelog_uri: https://github.com/sds/mock_redis/blob/v0.49.0/CHANGELOG.md
129
- documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.49.0
127
+ changelog_uri: https://github.com/sds/mock_redis/blob/v0.51.0/CHANGELOG.md
128
+ documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.51.0
130
129
  homepage_uri: https://github.com/sds/mock_redis
131
- source_code_uri: https://github.com/sds/mock_redis/tree/v0.49.0
132
- post_install_message:
130
+ source_code_uri: https://github.com/sds/mock_redis/tree/v0.51.0
133
131
  rdoc_options: []
134
132
  require_paths:
135
133
  - lib
@@ -144,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
142
  - !ruby/object:Gem::Version
145
143
  version: '0'
146
144
  requirements: []
147
- rubygems_version: 3.0.3.1
148
- signing_key:
145
+ rubygems_version: 3.6.2
149
146
  specification_version: 4
150
147
  summary: Redis mock that just lives in memory; useful for testing.
151
148
  test_files: []