redis 4.2.0 → 4.2.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 +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/redis.rb +26 -6
- data/lib/redis/version.rb +1 -1
- metadata +8 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e49d4c950b40f5d702b9b49bfc16b6af12dba334f5866dfd44f1ff69af55ecc
|
4
|
+
data.tar.gz: bf025908a9697cb0308aa3cbce20ecd292a5d9d801c53ad89f739ca5e5beb74f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b27b0178a9120d2843017f5b153dfd48f668ad6b56058bc1058cc318034f1715491cbc9557d71459588b4d3c17970f2572efffd1e79523069ebc4bc208b1c193
|
7
|
+
data.tar.gz: e6ec5a2f2d49bebdef37531d0292f1076bde4ec81adc190eae122d972bb8b9d46354c78c1fc2d1340d392d5805b42a63409bf6fe4cd020c1176a31ed249bc450
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 4.2.1
|
4
|
+
|
5
|
+
* Fix `exists?` returning an actual boolean when called with multiple keys. See #918.
|
6
|
+
* Setting `Redis.exists_returns_integer = false` disables warning message about new behaviour. See #920.
|
7
|
+
|
3
8
|
# 4.2.0
|
4
9
|
|
5
10
|
* Convert commands to accept keyword arguments rather than option hashes. This both help catching typos, and reduce needless allocations.
|
data/lib/redis.rb
CHANGED
@@ -5,7 +5,20 @@ require_relative "redis/errors"
|
|
5
5
|
|
6
6
|
class Redis
|
7
7
|
class << self
|
8
|
-
|
8
|
+
attr_reader :exists_returns_integer
|
9
|
+
|
10
|
+
def exists_returns_integer=(value)
|
11
|
+
unless value
|
12
|
+
message = "`Redis#exists(key)` will return an Integer by default in redis-rb 4.3. The option to explicitly " \
|
13
|
+
"disable this behaviour via `Redis.exists_returns_integer` will be removed in 5.0. You should use " \
|
14
|
+
"`exists?` instead."
|
15
|
+
|
16
|
+
::Kernel.warn(message)
|
17
|
+
end
|
18
|
+
|
19
|
+
@exists_returns_integer = value
|
20
|
+
end
|
21
|
+
|
9
22
|
attr_writer :current
|
10
23
|
end
|
11
24
|
|
@@ -561,11 +574,16 @@ class Redis
|
|
561
574
|
# @return [Integer]
|
562
575
|
def exists(*keys)
|
563
576
|
if !Redis.exists_returns_integer && keys.size == 1
|
564
|
-
|
565
|
-
"
|
566
|
-
|
577
|
+
if Redis.exists_returns_integer.nil?
|
578
|
+
message = "`Redis#exists(key)` will return an Integer in redis-rb 4.3. `exists?` returns a boolean, you " \
|
579
|
+
"should use it instead. To opt-in to the new behavior now you can set Redis.exists_returns_integer = " \
|
580
|
+
"true. To disable this message and keep the current (boolean) behaviour of 'exists' you can set " \
|
581
|
+
"`Redis.exists_returns_integer = false`, but this option will be removed in 5.0. " \
|
582
|
+
"(#{::Kernel.caller(1, 1).first})\n"
|
583
|
+
|
584
|
+
::Kernel.warn(message)
|
585
|
+
end
|
567
586
|
|
568
|
-
::Kernel.warn(message)
|
569
587
|
exists?(*keys)
|
570
588
|
else
|
571
589
|
_exists(*keys)
|
@@ -584,7 +602,9 @@ class Redis
|
|
584
602
|
# @return [Boolean]
|
585
603
|
def exists?(*keys)
|
586
604
|
synchronize do |client|
|
587
|
-
client.call([:exists, *keys]
|
605
|
+
client.call([:exists, *keys]) do |value|
|
606
|
+
value > 0
|
607
|
+
end
|
588
608
|
end
|
589
609
|
end
|
590
610
|
|
data/lib/redis/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -16,7 +16,7 @@ authors:
|
|
16
16
|
autorequire:
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
|
-
date: 2020-06-
|
19
|
+
date: 2020-06-11 00:00:00.000000000 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: em-synchrony
|
@@ -99,7 +99,12 @@ files:
|
|
99
99
|
homepage: https://github.com/redis/redis-rb
|
100
100
|
licenses:
|
101
101
|
- MIT
|
102
|
-
metadata:
|
102
|
+
metadata:
|
103
|
+
bug_tracker_uri: https://github.com/redis/redis-rb/issues
|
104
|
+
changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
|
105
|
+
documentation_uri: https://www.rubydoc.info/gems/redis/4.2.1
|
106
|
+
homepage_uri: https://github.com/redis/redis-rb
|
107
|
+
source_code_uri: https://github.com/redis/redis-rb/tree/v4.2.1
|
103
108
|
post_install_message:
|
104
109
|
rdoc_options: []
|
105
110
|
require_paths:
|