redis-cluster-client 0.3.11 → 0.3.12

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: 7eb062a2819ec74aebd03e23d7fd55281b8bf600bb5dd9bbcfb4cb36086070ef
4
- data.tar.gz: 0bb82a71679f66948d09f07a8e5ccb6b31138e9c1fe7f9d6ab7d10abf35cf473
3
+ metadata.gz: '0890e2d621a219037cad3f57ff1f3ea459f274ae1027247360a644743b323e0c'
4
+ data.tar.gz: 7225a3ba1fa71776c81deda0ff34aa4fc46eb0146aa63da8b9c3b5d9503a807f
5
5
  SHA512:
6
- metadata.gz: 87727a31dfd4278a353902f31b9bda5f99fe9e0651491f8b2af5bcab16bae819087adff8a8e7ecfdaf81bcd1f99b95e002d66bb4cc44ab690326bcca6c10dd4c
7
- data.tar.gz: d4850893095a151cfe5f47a66642fcc311cd58e3466f46f5d8a1ce1e73374ac3f7faaf6b0bcb6ea1f3b18762c3198fad57af33614514280bcac85bfab2af8b08
6
+ metadata.gz: 78d7cb40b48dae677dea264d7408546673414f927edd236ae5d091ba09fabc306465ffb3b2c77c39c475886d1e547f7f630ee112f193fceb4d39df4a6b94c75f
7
+ data.tar.gz: 8990869249f008c27c7a795c6d73cd6b7d942eecce4ba0d9dd1d85b4b9ba65048f367b155be24cc8d8c90c4095fe67c1aa5133120504a433cd43f2b715802384
@@ -8,6 +8,8 @@ class RedisClient
8
8
  class Cluster
9
9
  class Command
10
10
  EMPTY_STRING = ''
11
+ LEFT_BRACKET = '{'
12
+ RIGHT_BRACKET = '}'
11
13
 
12
14
  Detail = Struct.new(
13
15
  'RedisCommand',
@@ -104,10 +106,11 @@ class RedisClient
104
106
  # @see https://redis.io/topics/cluster-spec#keys-hash-tags Keys hash tags
105
107
  def extract_hash_tag(key)
106
108
  key = key.to_s
107
- s = key.index('{')
108
- e = key.index('}', s.to_i + 1)
109
+ s = key.index(LEFT_BRACKET)
110
+ return EMPTY_STRING if s.nil?
109
111
 
110
- return EMPTY_STRING if s.nil? || e.nil?
112
+ e = key.index(RIGHT_BRACKET, s + 1)
113
+ return EMPTY_STRING if e.nil?
111
114
 
112
115
  key[s + 1..e - 1]
113
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-cluster-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-27 00:00:00.000000000 Z
11
+ date: 2022-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis-client
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.3.15
72
+ rubygems_version: 3.3.22
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A Redis cluster client for Ruby