mock_redis 0.37.0 → 0.38.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: 1d7bda05082845039ee8e7aa688238c8006fb6754b5198e325e92723f4ec63bd
4
- data.tar.gz: 430cd98257705509362934dc755f9e88820ebb1e7d39dee2a056ffd28c120d4d
3
+ metadata.gz: a52765650d476204f43e76ce502749a8c8efb65869930fe3096d69d1fe0ce40d
4
+ data.tar.gz: ff2348f833c9c973da379adb3d0abd51b1d67676234c6e3d4649a2130e055fa0
5
5
  SHA512:
6
- metadata.gz: cff49225d6412aababaaad3cca42394764168862cc1c6d2b434fb83b5889582f0a74698b696e244036b695b318da0ea444cda16abe6e1ca73bfe9e2e3ab05ed9
7
- data.tar.gz: 32cbd749e2180f56c1e779aedc726114c2aa242fe6d87e95a75f98d85b51814befea89c27f6cf6d7a1d306cb526236b9bf186b0aa1c541c4621969103c485691
6
+ metadata.gz: fd4da99b15267d322b320cfbd3533bacd24e8c4af28c4681e4ff9bedf18cbae9e9338f598904219bd743b44143e820415243e36f0a6da2ee5922926e5f5979fb
7
+ data.tar.gz: b33e8c8fb1943e88f3b8a7850268ae3627af27122a75cabfd1f76c5fd820118b7af8f840ae83a2830f9661750c76778fc2407accabb8d8c17c40d702c4f3321c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.38.0
4
+
5
+ * Fix detection of stream key types
6
+ * Add support for `EXAT` AND `PXAT` arguments to `SET` command
7
+
3
8
  ### 0.37.0
4
9
 
5
10
  * Require Ruby 2.7 or newer, since Ruby 2.6 and older are EOL
@@ -267,6 +267,8 @@ class MockRedis
267
267
  'set'
268
268
  elsif zsety?(key)
269
269
  'zset'
270
+ elsif streamy?(key)
271
+ 'stream'
270
272
  else
271
273
  raise ArgumentError, "Not sure how #{data[key].inspect} got in here"
272
274
  end
@@ -210,9 +210,10 @@ class MockRedis
210
210
  msetnx(*hash.to_a.flatten)
211
211
  end
212
212
 
213
- # Parameer list required to ensure the ArgumentError is returned correctly
213
+ # Parameter list required to ensure the ArgumentError is returned correctly
214
214
  # rubocop:disable Metrics/ParameterLists
215
- def set(key, value, ex: nil, px: nil, nx: nil, xx: nil, keepttl: nil, get: nil)
215
+ def set(key, value, ex: nil, px: nil, exat: nil, pxat: nil, nx: nil, xx: nil, keepttl: nil,
216
+ get: nil)
216
217
  key = key.to_s
217
218
  retval = self.get(key) if get
218
219
 
@@ -248,6 +249,20 @@ class MockRedis
248
249
  pexpire(key, px)
249
250
  end
250
251
 
252
+ if exat
253
+ if exat == 0
254
+ raise Redis::CommandError, 'ERR invalid expire time in set'
255
+ end
256
+ expireat(key, exat)
257
+ end
258
+
259
+ if pxat
260
+ if pxat == 0
261
+ raise Redis::CommandError, 'ERR invalid expire time in set'
262
+ end
263
+ pexpireat(key, pxat)
264
+ end
265
+
251
266
  if get
252
267
  retval
253
268
  else
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  class MockRedis
5
- VERSION = '0.37.0'
5
+ VERSION = '0.38.0'
6
6
  end
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.37.0
4
+ version: 0.38.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: 2023-08-08 00:00:00.000000000 Z
12
+ date: 2023-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -123,11 +123,11 @@ licenses:
123
123
  - MIT
124
124
  metadata:
125
125
  bug_tracker_uri: https://github.com/sds/mock_redis/issues
126
- changelog_uri: https://github.com/sds/mock_redis/blob/v0.37.0/CHANGELOG.md
127
- documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.37.0
126
+ changelog_uri: https://github.com/sds/mock_redis/blob/v0.38.0/CHANGELOG.md
127
+ documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.38.0
128
128
  homepage_uri: https://github.com/sds/mock_redis
129
- source_code_uri: https://github.com/sds/mock_redis/tree/v0.37.0
130
- post_install_message:
129
+ source_code_uri: https://github.com/sds/mock_redis/tree/v0.38.0
130
+ post_install_message:
131
131
  rdoc_options: []
132
132
  require_paths:
133
133
  - lib
@@ -142,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubygems_version: 3.0.3.1
146
- signing_key:
145
+ rubygems_version: 3.1.6
146
+ signing_key:
147
147
  specification_version: 4
148
148
  summary: Redis mock that just lives in memory; useful for testing.
149
149
  test_files: []