mock_redis 0.47.0 → 0.48.1

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: 5bbc0edb10b18ba89981fe78e35e169dbbdc4af0886e01f07e0947f8eb7eff45
4
- data.tar.gz: 88d094d92b9c55ebc677dca8c2a6561805b79dbf11d97b2992a9c1312cccc1b1
3
+ metadata.gz: 9b443f014758e0bcf36ab97b1b52c8835e445b6d08c3934f00171a9d0c2ab8b8
4
+ data.tar.gz: 401f2c621a340ae75c59409943718a6fdcfbb76c816d38651f93d9548e086d71
5
5
  SHA512:
6
- metadata.gz: c805d6ad39374b422b8f0fd571ceae353e91531089c1844459dd046bbaa97b1cc8d80a6dec386f3c5f93382c39081084c799f1ad286d37e5a1d0e1c0a3f55279
7
- data.tar.gz: cfc5b689845fccd69eb744a1bc8296530ce46c3686cf15cca272bf12bad8520f12739289cc4b21e99f11762127fb74a72eda54ca19ed7e27afe90fe4d26545db
6
+ metadata.gz: 52ea483bccaab28544bfa90773463085afea971730b8ccb715127cb1815d6de4e007f6d4fac9b055aa2e659720a24618e392a96992875cc77d36d151e9389c32
7
+ data.tar.gz: 141763ba4434ed736d5f28f50e9ec5b012d040fdf0aaa00c8a11a736165a02db7912624841fb319109bec1465aaeb05a49b48adb6c74b08dbfb1976d715bb031
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # MockRedis Changelog
2
2
 
3
+ ### 0.48.1
4
+
5
+ * Fix load issue with `redis-client` gem
6
+
7
+ ### 0.48.0
8
+
9
+ * Add support for `lmpop` on Redis 7+
10
+
3
11
  ### 0.47.0
4
12
 
5
13
  * Add support for `redis-rb` gem versions 5.x
@@ -1,3 +1,4 @@
1
+ require 'redis-client'
1
2
  require 'mock_redis/error'
2
3
 
3
4
  class MockRedis
@@ -90,6 +90,32 @@ class MockRedis
90
90
  with_list_at(key, &:length)
91
91
  end
92
92
 
93
+ def lmpop(*keys, **options)
94
+ keys.each do |key|
95
+ assert_listy(key)
96
+ end
97
+
98
+ modifier = options.is_a?(Hash) && options[:modifier]&.to_s&.downcase || 'left'
99
+ count = (options.is_a?(Hash) && options[:count]) || 1
100
+
101
+ unless %w[left right].include?(modifier)
102
+ raise Redis::CommandError, 'ERR syntax error'
103
+ end
104
+
105
+ keys.each do |key|
106
+ record_count = llen(key)
107
+ next if record_count.zero?
108
+
109
+ values = [count, record_count].min.times.map do
110
+ modifier == 'left' ? with_list_at(key, &:shift) : with_list_at(key, &:pop)
111
+ end
112
+
113
+ return [key, values]
114
+ end
115
+
116
+ nil
117
+ end
118
+
93
119
  def lmove(source, destination, wherefrom, whereto)
94
120
  assert_listy(source)
95
121
  assert_listy(destination)
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Defines the gem version.
4
4
  class MockRedis
5
- VERSION = '0.47.0'
5
+ VERSION = '0.48.1'
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.47.0
4
+ version: 0.48.1
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-11-27 00:00:00.000000000 Z
12
+ date: 2024-12-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -125,11 +125,11 @@ licenses:
125
125
  - MIT
126
126
  metadata:
127
127
  bug_tracker_uri: https://github.com/sds/mock_redis/issues
128
- changelog_uri: https://github.com/sds/mock_redis/blob/v0.47.0/CHANGELOG.md
129
- documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.47.0
128
+ changelog_uri: https://github.com/sds/mock_redis/blob/v0.48.1/CHANGELOG.md
129
+ documentation_uri: https://www.rubydoc.info/gems/mock_redis/0.48.1
130
130
  homepage_uri: https://github.com/sds/mock_redis
131
- source_code_uri: https://github.com/sds/mock_redis/tree/v0.47.0
132
- post_install_message:
131
+ source_code_uri: https://github.com/sds/mock_redis/tree/v0.48.1
132
+ post_install_message:
133
133
  rdoc_options: []
134
134
  require_paths:
135
135
  - lib
@@ -144,8 +144,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  requirements: []
147
- rubygems_version: 3.5.9
148
- signing_key:
147
+ rubygems_version: 3.0.3.1
148
+ signing_key:
149
149
  specification_version: 4
150
150
  summary: Redis mock that just lives in memory; useful for testing.
151
151
  test_files: []