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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d173abb7a6c08e1feb87c9fd5ba33a2a0d907c6d045f6959d55f3234e56ceeb
4
- data.tar.gz: 7463d58522a3db5262eeea4b95834d82ede95cf102d2375e051cf4ada1b235c3
3
+ metadata.gz: 416a2f007042c19453c13361aa4440a507e47fb32c28adc68e7c574c6651f5b4
4
+ data.tar.gz: 1a845f2af649d64f8b274962c9d5d10e6eb5d046474b6e44288676432fe8a98b
5
5
  SHA512:
6
- metadata.gz: 0b34ab14e41e1bd63a99319f3ee5e1e7ea0c1e89581e525dfd82b77968a834525807b025f02d8ff5df4e7a994f19cc7ee4098103c70abd78ab6c22ec435a055c
7
- data.tar.gz: 84da776467bebb7fd59333084787e484203e55b81be5031c78b44741f2b79342cc1f6f48c1f9663b15f360a3af590783ee2f403da07a3e04486e35ba70e49e01
6
+ metadata.gz: 3766992242ae284ca474bc8564c6760de88e635a8c3bc3c80da08062d698cc891bf00455b5d98768709ecc766f8ad305fe03cc5806f03fda3ebb93049e0a1cce
7
+ data.tar.gz: f440c984ec58ff091a6a696952239cb04cf145752b485543e5da7215a327b40be4391b3fe6ca67753f84ec43913b9d90ec0b6f812e1696890a7c17cbf3aa3630
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 4.3.1
4
+
5
+ * Fix password authentication against redis server 5 and older.
6
+
3
7
  # 4.3.0
4
8
 
5
9
  * Add the TYPE argument to scan and scan_each. See #985.
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 element in a list.
1175
+ # Remove and get the first elements in a list.
1176
1176
  #
1177
1177
  # @param [String] key
1178
- # @return [String]
1179
- def lpop(key)
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
- client.call([:lpop, key])
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 element in a list.
1188
+ # Remove and get the last elements in a list.
1186
1189
  #
1187
1190
  # @param [String] key
1188
- # @return [String]
1189
- def rpop(key)
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
- client.call([:rpop, key])
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
- call [:auth, username, password].compact if username || password
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)
@@ -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 element in a list.
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 element in a list.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Redis
4
- VERSION = '4.3.0'
4
+ VERSION = '4.3.1'
5
5
  end
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.0
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.0
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.0
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: