redis-client 0.24.0 → 0.25.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: 7c3cb528ecb15130b80ce97d00a5e0e45c31edfc6147068516e1a52295a94045
4
- data.tar.gz: b4517fbd99d0f3997e510b6d0d56c345c1fceb1ad44fcac59cceb28faf4326b5
3
+ metadata.gz: 6aec9020863506adfc7189ff46791f9e9a656ca9c4efd042d60b6d9d7eecbbc2
4
+ data.tar.gz: 821d677e9cec0280ae9e982b78e7aa3116063f58d08f4f446c56bb8fdfeabcd6
5
5
  SHA512:
6
- metadata.gz: dbc7fcacc084fcd9d765337ad48a2a8ee413eecfec48f1a166fbd58510299cf92b3e058ce08620055deadeca86464c2c25fe6cddcccab532ab3d2cd741f9cef0
7
- data.tar.gz: '09164c4ea9f7021d58df97690f78e7940821a44eb7e12cc4c25324bd17e0e784f447443accedbe2299e6d8c0a0a6f15391491465c4c32baaa56286501b77b693'
6
+ metadata.gz: 39b8dd6d1c19c96f30dbc5f8391105037507704954a273d17ab8e25ace88a77ee3504038a8b595a2845b1657f79cffdd76143b34e3b67e01339654c1310c2b41
7
+ data.tar.gz: 76b6500bf41a318ad3a71088dd3382c16039b2713adced7f511e67c45107e37ef7e1a286b19c10bc18f93292696c1cad8a51b705c930c3bb2d1784b8c67aadfe
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.25.1
4
+
5
+ - Fix Ruby driver TCP keep alive TTL. It was intended to be 120 seconds but was mistakenly set to 15 seconds.
6
+
7
+ # 0.25.0
8
+
9
+ - Fix `hiredis-client` compilation with GCC 15.
10
+ - Fix `hiredis-client` from a work directory with spaces.
11
+ - Add `CommandError#code`.
12
+ - Add `RedisClient::NoScriptError` for `EVALSHA`.
13
+
3
14
  # 0.24.0
4
15
 
5
16
  - Allow `sentinel_password` to be provided as a `Proc`.
@@ -169,7 +169,7 @@ class RedisClient
169
169
  if %i[SOL_TCP SOL_SOCKET TCP_KEEPIDLE TCP_KEEPINTVL TCP_KEEPCNT].all? { |c| Socket.const_defined? c } # Linux
170
170
  def enable_socket_keep_alive(socket)
171
171
  socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true)
172
- socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, KEEP_ALIVE_INTERVAL)
172
+ socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, KEEP_ALIVE_TTL)
173
173
  socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPINTVL, KEEP_ALIVE_INTERVAL)
174
174
  socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPCNT, KEEP_ALIVE_PROBES)
175
175
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.24.0"
4
+ VERSION = "0.25.1"
5
5
  end
data/lib/redis_client.rb CHANGED
@@ -130,8 +130,18 @@ class RedisClient
130
130
  end
131
131
  end
132
132
 
133
+ module HasCode
134
+ attr_reader :code
135
+
136
+ def initialize(message = nil, code = nil)
137
+ super(message)
138
+ @code = code
139
+ end
140
+ end
141
+
133
142
  class CommandError < Error
134
143
  include HasCommand
144
+ include HasCode
135
145
 
136
146
  class << self
137
147
  def parse(error_message)
@@ -144,7 +154,7 @@ class RedisClient
144
154
  end
145
155
  code ||= error_message.split(' ', 2).first
146
156
  klass = ERRORS.fetch(code, self)
147
- klass.new(error_message.strip)
157
+ klass.new(error_message.strip, code.freeze)
148
158
  end
149
159
  end
150
160
  end
@@ -153,12 +163,15 @@ class RedisClient
153
163
  PermissionError = Class.new(CommandError)
154
164
  WrongTypeError = Class.new(CommandError)
155
165
  OutOfMemoryError = Class.new(CommandError)
166
+ NoScriptError = Class.new(CommandError)
156
167
 
157
168
  ReadOnlyError = Class.new(ConnectionError)
158
169
  ReadOnlyError.include(HasCommand)
170
+ ReadOnlyError.include(HasCode)
159
171
 
160
172
  MasterDownError = Class.new(ConnectionError)
161
173
  MasterDownError.include(HasCommand)
174
+ MasterDownError.include(HasCode)
162
175
 
163
176
  CommandError::ERRORS = {
164
177
  "WRONGPASS" => AuthenticationError,
@@ -167,6 +180,7 @@ class RedisClient
167
180
  "MASTERDOWN" => MasterDownError,
168
181
  "WRONGTYPE" => WrongTypeError,
169
182
  "OOM" => OutOfMemoryError,
183
+ "NOSCRIPT" => NoScriptError,
170
184
  }.freeze
171
185
 
172
186
  class << self
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.0
4
+ version: 0.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-05 00:00:00.000000000 Z
10
+ date: 2025-07-15 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: connection_pool