redis-prescription 2.3.0 → 2.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fd1b8f036fcc8230f39b8df81688c9026fd2e65d3e5a825d6d1233a9ba7b9093
4
- data.tar.gz: f60221b43f1ddbaa96d57212f8a1e849a94daa9c4d018c90aee7e68d6b9c7df4
3
+ metadata.gz: 102d72bbeaeed7fb1280168260f9f0f93db29aa4629975fef16738cb34d6a412
4
+ data.tar.gz: 8012996f4f92d95d082df58df434844a31e8423d066e71b57adcad6b23917aa3
5
5
  SHA512:
6
- metadata.gz: 11d25b6dc569ed64cab7d439b7688102549a20e714c8a6ff2abfe7a2ccdb91a0fce7097089fd08c196b36b53ca7bcaae149edb0fb3272ec210f95efbcc5134e8
7
- data.tar.gz: 386d2fbc0b0104e183c3c58ca871dd0120efe313ea7ece14904137c67139d97d82accc8b8537a0a9887e875596b2b08ec128ce52b73aca534387f873e73e4db9
6
+ metadata.gz: 6387dd02ae632d8eb0f7e0dbbf2c769bb0349b390c869f0b0f94bfc35123a825bdb0eb529ec06913ac57d23c8fac0513f993aa01db988dab4b3aea5e97f23e5c
7
+ data.tar.gz: cabe06b0ec13367f176ea56071547e9881e5fa764398953417e5e4da9e705109d7136d176e3b964a92530cef1d9c7ca2e75334603b3a45c461fc31c6dc3b7e2a
data/README.adoc CHANGED
@@ -41,6 +41,7 @@ This library aims to support and is tested against:
41
41
  ** MRI 3.1.x
42
42
  ** MRI 3.2.x
43
43
  * https://redis.io[Redis Server]
44
+ ** 6.0.x
44
45
  ** 6.2.x
45
46
  ** 7.0.x
46
47
  * https://github.com/redis/redis-rb[redis-rb]
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../redis_prescription"
4
+
5
+ class Redis
6
+ # @deprecated Use ::RedisPrescription
7
+ class Prescription < RedisPrescription
8
+ class << self
9
+ # Controls if deprecation warnings should be silenced or not.
10
+ # Defaults to `false`.
11
+ #
12
+ # @return [Boolean]
13
+ attr_accessor :silence_deprecation_warning
14
+ end
15
+
16
+ self.silence_deprecation_warning = false
17
+
18
+ def initialize(*)
19
+ super
20
+
21
+ return if self.class.silence_deprecation_warning
22
+
23
+ warn "#{self.class} usage was deprecated, please use RedisPrescription instead"
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "redis_prescription"
4
+ require_relative "redis/prescription"
@@ -14,10 +14,6 @@ class RedisPrescription
14
14
  @redis = redis
15
15
  end
16
16
 
17
- def adapter_name
18
- "redis"
19
- end
20
-
21
17
  def eval(script, keys, argv)
22
18
  @redis.eval(script, keys, argv)
23
19
  rescue ::Redis::CommandError => e
@@ -29,11 +25,6 @@ class RedisPrescription
29
25
  rescue ::Redis::CommandError => e
30
26
  raise CommandError, e.message
31
27
  end
32
-
33
- def purge!
34
- @redis.script("flush")
35
- @redis.flushdb
36
- end
37
28
  end
38
29
  end
39
30
  end
@@ -17,10 +17,6 @@ class RedisPrescription
17
17
  @redis = redis
18
18
  end
19
19
 
20
- def adapter_name
21
- "redis-client"
22
- end
23
-
24
20
  def eval(script, keys, argv)
25
21
  @redis.call("EVAL", script, keys.size, *keys, *argv)
26
22
  rescue ::RedisClient::CommandError => e
@@ -32,11 +28,6 @@ class RedisPrescription
32
28
  rescue ::RedisClient::CommandError => e
33
29
  raise CommandError, e.message
34
30
  end
35
-
36
- def purge!
37
- @redis.call("SCRIPT", "FLUSH")
38
- @redis.call("FLUSHDB")
39
- end
40
31
  end
41
32
  end
42
33
  end
@@ -14,10 +14,6 @@ class RedisPrescription
14
14
  @redis = redis
15
15
  end
16
16
 
17
- def adapter_name
18
- "redis-namespace"
19
- end
20
-
21
17
  def eval(script, keys, argv)
22
18
  @redis.eval(script, keys, argv)
23
19
  rescue ::Redis::CommandError => e
@@ -29,11 +25,6 @@ class RedisPrescription
29
25
  rescue ::Redis::CommandError => e
30
26
  raise CommandError, e.message
31
27
  end
32
-
33
- def purge!
34
- @redis.redis.script("flush")
35
- @redis.redis.flushdb
36
- end
37
28
  end
38
29
  end
39
30
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  class RedisPrescription
4
4
  # Gem version.
5
- VERSION = "2.3.0"
5
+ VERSION = "2.5.0"
6
6
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "digest/sha1"
4
+
3
5
  require_relative "./redis_prescription/adapters"
4
6
  require_relative "./redis_prescription/errors"
5
7
  require_relative "./redis_prescription/version"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-prescription
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Zapparov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-07 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Preloads (and reloads when needed, e.g. when scripts were flushed away)
@@ -22,6 +22,7 @@ files:
22
22
  - LICENSE.txt
23
23
  - README.adoc
24
24
  - lib/redis-prescription.rb
25
+ - lib/redis/prescription.rb
25
26
  - lib/redis_prescription.rb
26
27
  - lib/redis_prescription/adapters.rb
27
28
  - lib/redis_prescription/adapters/redis.rb
@@ -36,7 +37,7 @@ metadata:
36
37
  homepage_uri: https://gitlab.com/ixti/redis-prescription
37
38
  source_code_uri: https://gitlab.com/ixti/redis-prescription
38
39
  bug_tracker_uri: https://gitlab.com/ixti/redis-prescription/issues
39
- changelog_uri: https://gitlab.com/ixti/redis-prescription/blob/v2.3.0/CHANGES.md
40
+ changelog_uri: https://gitlab.com/ixti/redis-prescription/blob/v2.5.0/CHANGES.md
40
41
  rubygems_mfa_required: 'true'
41
42
  post_install_message:
42
43
  rdoc_options: []