redis 5.0.3 → 5.0.4

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: cba7e365db1b9e04cf596a09210949a7ad7be48df25863d28654690e0f9c9ded
4
- data.tar.gz: c846522122894b000cbae0fedbee70bd1b27880baa8138e6aea73f6a06820146
3
+ metadata.gz: f65967c3d313cca4af20076de88097790ae39dd7935cd9ef25f6ce4d6200c0a5
4
+ data.tar.gz: f744db40e4de3794921aedd4d792eb7f275c24e4bd88e8954ce4b3b56a1b2d64
5
5
  SHA512:
6
- metadata.gz: d7e818dba56ff62bb7b95c221acffd9637be088b0da1b76870cfc6c7b8980e3da32636a1e99ff4debcc85aaf8c8d70d105301beae4fb0ee0255bef502b72caf0
7
- data.tar.gz: 28956e7dab6c737e923c3d19a03ce41d81b7e7406d04119a3a225748f1150d708d0b0baf231ce08e297626d58c9ab8cc97a5f31be93750a1e0d5362778a085fe
6
+ metadata.gz: 1368bd997873d59bc5910ac1d1431a53ff2fde0179c4398e35c645d3a6b605695294ff959a79940a74d54b2fc3dd1dc75d6e70636d1cf611285c5c215e64aaa5
7
+ data.tar.gz: cb1b07ce5cb323b92ad50846165350ed740729f00df50cdb6a8162e961fbf5c9bda2bf83db2eff0413416e8800c8510698d46b5678f0fe74f45f0935fc1b1fff
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 5.0.4
4
+
5
+ - Cast `ttl` argument to integer in `expire`, `setex` and a few others.
6
+
3
7
  # 5.0.3
4
8
 
5
9
  - Add `OutOfMemoryError` as a subclass of `CommandError`
@@ -39,7 +43,7 @@
39
43
 
40
44
  * Introduce `sadd?` and `srem?` as boolean returning versions of `sadd` and `srem`.
41
45
  * Deprecate `sadd` and `srem` returning a boolean when called with a single argument.
42
- To enable the redis 5.0 behavior you can set `Redis.sadd_returns_boolean = true`.
46
+ To enable the redis 5.0 behavior you can set `Redis.sadd_returns_boolean = false`.
43
47
  * Deprecate passing `timeout` as a positional argument in blocking commands (`brpop`, `blop`, etc).
44
48
 
45
49
  # 4.7.1
data/README.md CHANGED
@@ -82,7 +82,7 @@ As such it is heavilly recommended to use the [`connection_pool` gem](https://gi
82
82
  ```ruby
83
83
  module MyApp
84
84
  def self.redis
85
- @redis ||= ConnectionPool.new do
85
+ @redis ||= ConnectionPool::Wrapper.new do
86
86
  Redis.new(url: ENV["REDIS_URL"])
87
87
  end
88
88
  end
@@ -76,7 +76,7 @@ class Redis
76
76
  # - `:lt => true`: Set expiry only when the new expiry is less than current one.
77
77
  # @return [Boolean] whether the timeout was set or not
78
78
  def expire(key, seconds, nx: nil, xx: nil, gt: nil, lt: nil)
79
- args = [:expire, key, seconds]
79
+ args = [:expire, key, Integer(seconds)]
80
80
  args << "NX" if nx
81
81
  args << "XX" if xx
82
82
  args << "GT" if gt
@@ -96,7 +96,7 @@ class Redis
96
96
  # - `:lt => true`: Set expiry only when the new expiry is less than current one.
97
97
  # @return [Boolean] whether the timeout was set or not
98
98
  def expireat(key, unix_time, nx: nil, xx: nil, gt: nil, lt: nil)
99
- args = [:expireat, key, unix_time]
99
+ args = [:expireat, key, Integer(unix_time)]
100
100
  args << "NX" if nx
101
101
  args << "XX" if xx
102
102
  args << "GT" if gt
@@ -132,7 +132,7 @@ class Redis
132
132
  # - `:lt => true`: Set expiry only when the new expiry is less than current one.
133
133
  # @return [Boolean] whether the timeout was set or not
134
134
  def pexpire(key, milliseconds, nx: nil, xx: nil, gt: nil, lt: nil)
135
- args = [:pexpire, key, milliseconds]
135
+ args = [:pexpire, key, Integer(milliseconds)]
136
136
  args << "NX" if nx
137
137
  args << "XX" if xx
138
138
  args << "GT" if gt
@@ -152,7 +152,7 @@ class Redis
152
152
  # - `:lt => true`: Set expiry only when the new expiry is less than current one.
153
153
  # @return [Boolean] whether the timeout was set or not
154
154
  def pexpireat(key, ms_unix_time, nx: nil, xx: nil, gt: nil, lt: nil)
155
- args = [:pexpireat, key, ms_unix_time]
155
+ args = [:pexpireat, key, Integer(ms_unix_time)]
156
156
  args << "NX" if nx
157
157
  args << "XX" if xx
158
158
  args << "GT" if gt
@@ -105,7 +105,7 @@ class Redis
105
105
  # @param [String] value
106
106
  # @return [String] `"OK"`
107
107
  def setex(key, ttl, value)
108
- send_command([:setex, key, ttl, value.to_s])
108
+ send_command([:setex, key, Integer(ttl), value.to_s])
109
109
  end
110
110
 
111
111
  # Set the time to live in milliseconds of a key.
@@ -115,7 +115,7 @@ class Redis
115
115
  # @param [String] value
116
116
  # @return [String] `"OK"`
117
117
  def psetex(key, ttl, value)
118
- send_command([:psetex, key, ttl, value.to_s])
118
+ send_command([:psetex, key, Integer(ttl), value.to_s])
119
119
  end
120
120
 
121
121
  # Set the value of a key, only if the key does not exist.
data/lib/redis/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Redis
4
- VERSION = '5.0.3'
4
+ VERSION = '5.0.4'
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: 5.0.3
4
+ version: 5.0.4
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: 2022-09-06 00:00:00.000000000 Z
19
+ date: 2022-09-09 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: redis-client
@@ -75,9 +75,9 @@ licenses:
75
75
  metadata:
76
76
  bug_tracker_uri: https://github.com/redis/redis-rb/issues
77
77
  changelog_uri: https://github.com/redis/redis-rb/blob/master/CHANGELOG.md
78
- documentation_uri: https://www.rubydoc.info/gems/redis/5.0.3
78
+ documentation_uri: https://www.rubydoc.info/gems/redis/5.0.4
79
79
  homepage_uri: https://github.com/redis/redis-rb
80
- source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.3
80
+ source_code_uri: https://github.com/redis/redis-rb/tree/v5.0.4
81
81
  post_install_message:
82
82
  rdoc_options: []
83
83
  require_paths: