protocol-redis 0.11.0 → 0.13.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: b39632c3f7210dd4eea7d4b561a74c94442434a3e9ae9220d44303ea51aba2af
4
- data.tar.gz: 6a930186fd89b24a6469a79025de532bd638a8e942228dffe25c4a4752561731
3
+ metadata.gz: 7ab24c3be78570c64568f0edbad8fd32ff280497aaa55dbd4c42e1fa4982d5be
4
+ data.tar.gz: 7616933dde922356fe3876eb842faeee6d771a78c868b1ae2b5b4b63fd223d35
5
5
  SHA512:
6
- metadata.gz: cdeeba41310895026b7e5f7c0f79c382ab91d63a4a27a3e3131adb593f71b2bf780a4974b6b08a9c7fa163f1223acadece21a8d08bc652d45962269226958c94
7
- data.tar.gz: 53859905dfad6b1b1e4944aff3357c13ec1fdcd0e1635962ce5d83811d7c625b08efa5da46c5eef76c22f0cf66cf5ac477a01796fff47499b6849a1fb3118fe2
6
+ metadata.gz: bd118bb6882be321a74a24f6e320b0fa01aaa38946d90552cc3058c38c9b02d3bf393fc6d6f3577f38c7f4e69b598b7769e3de3220a48aca62abc272ea93677c
7
+ data.tar.gz: 7a0225e6dcee718263a8730fd8db3f08ac6f05ee93be724928f6abf86ff820859da2dfcc699fb6d89611713ff262917ae608ab49a4df68bbace8a4fe95402f74
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
3
6
  module Protocol
4
7
  module Redis
5
8
  module Cluster
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
3
6
  module Protocol
4
7
  module Redis
5
8
  module Cluster
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2023, by Samuel Williams.
4
+ # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
3
6
  module Protocol
4
7
  module Redis
5
8
  module Cluster
@@ -1,5 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Released under the MIT License.
4
+ # Copyright, 2025, by Samuel Williams.
5
+
3
6
  module Protocol
4
7
  module Redis
5
8
  module Cluster
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "error"
7
7
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2023, by Nick Burwell.
5
- # Copyright, 2024, by Samuel Williams.
5
+ # Copyright, 2024-2025, by Samuel Williams.
6
6
 
7
7
  module Protocol
8
8
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2021, by Troex Nevelin.
6
6
 
7
7
  require "date"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2023, by Troex Nevelin.
6
6
  # Copyright, 2023, by Nick Burwell.
7
7
 
@@ -150,9 +150,11 @@ module Protocol
150
150
  # Get all the fields and values in a hash. O(N) where N is the size of the hash.
151
151
  # See <https://redis.io/commands/hgetall> for more details.
152
152
  # @parameter key [Key]
153
- # @returns [Hash]
153
+ # @returns [Hash | Nil]
154
154
  def hgetall(key)
155
- call("HGETALL", key).each_slice(2).to_h
155
+ if pairs = call("HGETALL", key)
156
+ pairs.each_slice(2).to_h
157
+ end
156
158
  end
157
159
 
158
160
  # Iterates fields of Hash types and their associated values. O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2020, by Salim Semaoune.
6
6
 
7
7
  module Protocol
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -15,6 +15,14 @@ module Protocol
15
15
  def publish(channel, message)
16
16
  call("PUBLISH", channel, message)
17
17
  end
18
+
19
+ # Post a message to a shard channel.
20
+ # See <https://redis.io/commands/spublish> for more details.
21
+ # @parameter channel [String]
22
+ # @parameter message [String]
23
+ def spublish(channel, message)
24
+ call("SPUBLISH", channel, message)
25
+ end
18
26
  end
19
27
  end
20
28
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
  # Copyright, 2023, by Nick Burwell.
6
6
 
7
7
  module Protocol
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2020, by David Ortiz.
6
6
 
7
7
  module Protocol
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2020, by Dimitry Chopey.
5
- # Copyright, 2020-2023, by Samuel Williams.
5
+ # Copyright, 2020-2025, by Samuel Williams.
6
6
 
7
7
  module Protocol
8
8
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2020-2023, by Samuel Williams.
4
+ # Copyright, 2020-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2020, by Dimitry Chopey.
6
6
  # Copyright, 2021, by Daniel Evans.
7
7
  # Copyright, 2023, by Nick Burwell.
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module Redis
8
- VERSION = "0.11.0"
8
+ VERSION = "0.13.0"
9
9
  end
10
10
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2023, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  require_relative "redis/version"
7
7
  require_relative "redis/connection"
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2024, by Samuel Williams.
3
+ Copyright, 2019-2025, by Samuel Williams.
4
4
  Copyright, 2020, by Olle Jonsson.
5
5
  Copyright, 2020, by Salim Semaoune.
6
6
  Copyright, 2020, by Dimitry Chopey.
data/readme.md CHANGED
@@ -14,6 +14,14 @@ Please see the [project documentation](https://socketry.github.io/protocol-redis
14
14
 
15
15
  Please see the [project releases](https://socketry.github.io/protocol-redis/releases/index) for all releases.
16
16
 
17
+ ### v0.13.0
18
+
19
+ - Handle `nil` return value in `hgetall` method.
20
+
21
+ ### v0.12.0
22
+
23
+ - Introduce `Pubsub#spublish` method for shard channels.
24
+
17
25
  ### v0.11.0
18
26
 
19
27
  - Introduce cluster methods, including `Strings`, `Streams`, `Scripting` and `Pubsub`.
@@ -53,20 +61,6 @@ Please see the [project releases](https://socketry.github.io/protocol-redis/rele
53
61
 
54
62
  - Add relevant pubsub method group.
55
63
 
56
- ### v0.5.1
57
-
58
- - Add tests for info command, streams, and string methods.
59
- - Use correct CRLF constant in server methods.
60
- - Modernize gem configuration.
61
-
62
- ### v0.5.0
63
-
64
- - Add incomplete implementations of scripting, sets and streams.
65
- - Merge existing sorted set implementations.
66
- - Add `zrangebyscore` method.
67
- - Improve argument management.
68
- - Modernize testing infrastructure.
69
-
70
64
  ## Contributing
71
65
 
72
66
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Releases
2
2
 
3
+ ## v0.13.0
4
+
5
+ - Handle `nil` return value in `hgetall` method.
6
+
7
+ ## v0.12.0
8
+
9
+ - Introduce `Pubsub#spublish` method for shard channels.
10
+
3
11
  ## v0.11.0
4
12
 
5
13
  - Introduce cluster methods, including `Strings`, `Streams`, `Scripting` and `Pubsub`.
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.11.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file