redis 4.1.4 → 4.4.0

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.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Redis
3
4
  class Pipeline
4
5
  attr_accessor :db
@@ -61,7 +62,7 @@ class Redis
61
62
  @futures.map(&:timeout)
62
63
  end
63
64
 
64
- def with_reconnect(val=true)
65
+ def with_reconnect(val = true)
65
66
  @with_reconnect = false unless val
66
67
  yield
67
68
  end
@@ -93,7 +94,8 @@ class Redis
93
94
 
94
95
  if exec.size < futures.size
95
96
  # Some command wasn't recognized by Redis.
96
- raise replies.detect { |r| r.is_a?(CommandError) }
97
+ command_error = replies.detect { |r| r.is_a?(CommandError) }
98
+ raise command_error
97
99
  end
98
100
 
99
101
  super(exec) do |reply|
@@ -145,11 +147,7 @@ class Redis
145
147
  message << " - You probably meant to call .value == or .value !="
146
148
  message << " (#{::Kernel.caller(1, 1).first})\n"
147
149
 
148
- if defined?(::Warning)
149
- ::Warning.warn(message)
150
- else
151
- $stderr.puts(message)
152
- end
150
+ ::Kernel.warn(message)
153
151
 
154
152
  super
155
153
  end
@@ -168,7 +166,7 @@ class Redis
168
166
  end
169
167
 
170
168
  def value
171
- ::Kernel.raise(@object) if @object.kind_of?(::RuntimeError)
169
+ ::Kernel.raise(@object) if @object.is_a?(::RuntimeError)
172
170
  @object
173
171
  end
174
172
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Redis
3
4
  class SubscribedClient
4
5
  def initialize(client)
@@ -33,24 +34,21 @@ class Redis
33
34
  call([:punsubscribe, *channels])
34
35
  end
35
36
 
36
- protected
37
+ protected
37
38
 
38
39
  def subscription(start, stop, channels, block, timeout = 0)
39
40
  sub = Subscription.new(&block)
40
41
 
41
42
  unsubscribed = false
42
43
 
43
- begin
44
- @client.call_loop([start, *channels], timeout) do |line|
45
- type, *rest = line
46
- sub.callbacks[type].call(*rest)
47
- unsubscribed = type == stop && rest.last == 0
48
- break if unsubscribed
49
- end
50
- ensure
51
- # No need to unsubscribe here. The real client closes the connection
52
- # whenever an exception is raised (see #ensure_connected).
44
+ @client.call_loop([start, *channels], timeout) do |line|
45
+ type, *rest = line
46
+ sub.callbacks[type].call(*rest)
47
+ unsubscribed = type == stop && rest.last == 0
48
+ break if unsubscribed
53
49
  end
50
+ # No need to unsubscribe here. The real client closes the connection
51
+ # whenever an exception is raised (see #ensure_connected).
54
52
  end
55
53
  end
56
54
 
@@ -59,7 +57,7 @@ class Redis
59
57
 
60
58
  def initialize
61
59
  @callbacks = Hash.new do |hash, key|
62
- hash[key] = lambda { |*_| }
60
+ hash[key] = ->(*_) {}
63
61
  end
64
62
 
65
63
  yield(self)
data/lib/redis/version.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  class Redis
3
- VERSION = '4.1.4'
4
+ VERSION = '4.4.0'
4
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.1.4
4
+ version: 4.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ezra Zygmuntowicz
@@ -13,13 +13,13 @@ authors:
13
13
  - Michel Martens
14
14
  - Damian Janowski
15
15
  - Pieter Noordhuis
16
- autorequire:
16
+ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
- date: 2020-05-01 00:00:00.000000000 Z
19
+ date: 2021-07-28 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: mocha
22
+ name: em-synchrony
23
23
  requirement: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
@@ -47,7 +47,7 @@ dependencies:
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  - !ruby/object:Gem::Dependency
50
- name: em-synchrony
50
+ name: mocha
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ">="
@@ -99,8 +99,13 @@ files:
99
99
  homepage: https://github.com/redis/redis-rb
100
100
  licenses:
101
101
  - MIT
102
- metadata: {}
103
- post_install_message:
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.4.0
106
+ homepage_uri: https://github.com/redis/redis-rb
107
+ source_code_uri: https://github.com/redis/redis-rb/tree/v4.4.0
108
+ post_install_message:
104
109
  rdoc_options: []
105
110
  require_paths:
106
111
  - lib
@@ -115,8 +120,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
120
  - !ruby/object:Gem::Version
116
121
  version: '0'
117
122
  requirements: []
118
- rubygems_version: 3.0.4
119
- signing_key:
123
+ rubygems_version: 3.1.2
124
+ signing_key:
120
125
  specification_version: 4
121
126
  summary: A Ruby client library for Redis
122
127
  test_files: []