redis 4.3.0 → 4.3.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 +4 -0
- data/lib/redis.rb +14 -8
- data/lib/redis/client.rb +11 -1
- data/lib/redis/distributed.rb +6 -6
- data/lib/redis/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 416a2f007042c19453c13361aa4440a507e47fb32c28adc68e7c574c6651f5b4
|
4
|
+
data.tar.gz: 1a845f2af649d64f8b274962c9d5d10e6eb5d046474b6e44288676432fe8a98b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3766992242ae284ca474bc8564c6760de88e635a8c3bc3c80da08062d698cc891bf00455b5d98768709ecc766f8ad305fe03cc5806f03fda3ebb93049e0a1cce
|
7
|
+
data.tar.gz: f440c984ec58ff091a6a696952239cb04cf145752b485543e5da7215a327b40be4391b3fe6ca67753f84ec43913b9d90ec0b6f812e1696890a7c17cbf3aa3630
|
data/CHANGELOG.md
CHANGED
data/lib/redis.rb
CHANGED
@@ -1172,23 +1172,29 @@ class Redis
|
|
1172
1172
|
end
|
1173
1173
|
end
|
1174
1174
|
|
1175
|
-
# Remove and get the first
|
1175
|
+
# Remove and get the first elements in a list.
|
1176
1176
|
#
|
1177
1177
|
# @param [String] key
|
1178
|
-
# @
|
1179
|
-
|
1178
|
+
# @param [Integer] count number of elements to remove
|
1179
|
+
# @return [String, Array<String>] the values of the first elements
|
1180
|
+
def lpop(key, count = nil)
|
1180
1181
|
synchronize do |client|
|
1181
|
-
|
1182
|
+
command = [:lpop, key]
|
1183
|
+
command << count if count
|
1184
|
+
client.call(command)
|
1182
1185
|
end
|
1183
1186
|
end
|
1184
1187
|
|
1185
|
-
# Remove and get the last
|
1188
|
+
# Remove and get the last elements in a list.
|
1186
1189
|
#
|
1187
1190
|
# @param [String] key
|
1188
|
-
# @
|
1189
|
-
|
1191
|
+
# @param [Integer] count number of elements to remove
|
1192
|
+
# @return [String, Array<String>] the values of the last elements
|
1193
|
+
def rpop(key, count = nil)
|
1190
1194
|
synchronize do |client|
|
1191
|
-
|
1195
|
+
command = [:rpop, key]
|
1196
|
+
command << count if count
|
1197
|
+
client.call(command)
|
1192
1198
|
end
|
1193
1199
|
end
|
1194
1200
|
|
data/lib/redis/client.rb
CHANGED
@@ -115,7 +115,17 @@ class Redis
|
|
115
115
|
# Don't try to reconnect when the connection is fresh
|
116
116
|
with_reconnect(false) do
|
117
117
|
establish_connection
|
118
|
-
|
118
|
+
if password
|
119
|
+
if username
|
120
|
+
begin
|
121
|
+
call [:auth, username, password]
|
122
|
+
rescue CommandError # Likely on Redis < 6
|
123
|
+
call [:auth, password]
|
124
|
+
end
|
125
|
+
else
|
126
|
+
call [:auth, password]
|
127
|
+
end
|
128
|
+
end
|
119
129
|
call [:select, db] if db != 0
|
120
130
|
call [:client, :setname, @options[:id]] if @options[:id]
|
121
131
|
@connector.check(self)
|
data/lib/redis/distributed.rb
CHANGED
@@ -413,14 +413,14 @@ class Redis
|
|
413
413
|
node_for(key).rpushx(key, value)
|
414
414
|
end
|
415
415
|
|
416
|
-
# Remove and get the first
|
417
|
-
def lpop(key)
|
418
|
-
node_for(key).lpop(key)
|
416
|
+
# Remove and get the first elements in a list.
|
417
|
+
def lpop(key, count = nil)
|
418
|
+
node_for(key).lpop(key, count)
|
419
419
|
end
|
420
420
|
|
421
|
-
# Remove and get the last
|
422
|
-
def rpop(key)
|
423
|
-
node_for(key).rpop(key)
|
421
|
+
# Remove and get the last elements in a list.
|
422
|
+
def rpop(key, count = nil)
|
423
|
+
node_for(key).rpop(key, count)
|
424
424
|
end
|
425
425
|
|
426
426
|
# Remove the last element in a list, append it to another list and return
|
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.3.
|
4
|
+
version: 4.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ezra Zygmuntowicz
|
@@ -102,9 +102,9 @@ licenses:
|
|
102
102
|
metadata:
|
103
103
|
bug_tracker_uri: https://github.com/redis/redis-rb/issues
|
104
104
|
changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
|
105
|
-
documentation_uri: https://www.rubydoc.info/gems/redis/4.3.
|
105
|
+
documentation_uri: https://www.rubydoc.info/gems/redis/4.3.1
|
106
106
|
homepage_uri: https://github.com/redis/redis-rb
|
107
|
-
source_code_uri: https://github.com/redis/redis-rb/tree/v4.3.
|
107
|
+
source_code_uri: https://github.com/redis/redis-rb/tree/v4.3.1
|
108
108
|
post_install_message:
|
109
109
|
rdoc_options: []
|
110
110
|
require_paths:
|