protocol-redis 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7392dc8cc474911de91a9b0479ebad6a1406c940bed6c23fd6b35f7eff90959
4
- data.tar.gz: 8afef4349361c795a119f3560198e71606a2bdda25b6fd9466ab5aef2f52ab8b
3
+ metadata.gz: 6c41c131d63e6ae475e086880ebbaaf833374369a25a4111f19612254323cf64
4
+ data.tar.gz: 953c597e87f269af83413f7d36ea16b5da15dd75f689505bf46a2cf79d31c16e
5
5
  SHA512:
6
- metadata.gz: ac74be71761f3341f3a76f035636b8e4d2693d40206c74c25858ee02f6eba2aad5013f0928cc467c16858c349ff1903074df878b764bdb7244fb75933428a3f5
7
- data.tar.gz: 944106d0ef3be643b6efbaa14ab94eb1c2a4c337b54809127a798496d624c440ffc648de0de9bd550b7a998435486e8de9fb5c32372e6e6e4af6f82bf61a6ac6
6
+ metadata.gz: 83ef8872ca16bdeecb0083804cf31abc4e195b49ad408c6f2e7e93c2a4511afb8ef6e811455dbd3cce55946d83cfc2f00b4e1ac1394e28eb25881ecc8a4f0c44
7
+ data.tar.gz: ef60e6ccefda376a2b0efc91d1940bba209a18d9b9c22e09a36acca9c06666bb695e82535f5a79d5e7e2a9123c04bd10716a42cb302838719850327b723ea05f
checksums.yaml.gz.sig CHANGED
Binary file
@@ -158,8 +158,8 @@ module Protocol
158
158
  # @see https://redis.io/commands/hscan/
159
159
  # @param cursor [Cursor]
160
160
  # @return [Hash]
161
- def hscan(cursor, match: nil, count: nil)
162
- arguments = [cursor]
161
+ def hscan(key, cursor = "0", match: nil, count: nil)
162
+ arguments = [key, cursor]
163
163
 
164
164
  if match
165
165
  arguments.append("MATCH", match)
@@ -171,6 +171,19 @@ module Protocol
171
171
 
172
172
  call("HSCAN", *arguments)
173
173
  end
174
+
175
+ # Iterate over each field and the value of the hash, using HSCAN.
176
+ def hscan_each(key, cursor = "0", match: nil, count: nil, &block)
177
+ return enum_for(:hscan_each, key, cursor, match: match, count: count) unless block_given?
178
+
179
+ while true
180
+ cursor, data = hscan(key, cursor, match: match, count: count)
181
+
182
+ data.each_slice(2, &block)
183
+
184
+ break if cursor == "0"
185
+ end
186
+ end
174
187
  end
175
188
  end
176
189
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module Redis
8
- VERSION = "0.8.0"
8
+ VERSION = "0.8.1"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -45,7 +45,7 @@ cert_chain:
45
45
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
46
46
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
47
47
  -----END CERTIFICATE-----
48
- date: 2023-06-13 00:00:00.000000000 Z
48
+ date: 2024-02-13 00:00:00.000000000 Z
49
49
  dependencies: []
50
50
  description:
51
51
  email:
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.2.33
97
+ rubygems_version: 3.5.3
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: A transport agnostic RESP protocol client/server.
metadata.gz.sig CHANGED
Binary file