redis_eval 0.2.0 → 0.2.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
  SHA1:
3
- metadata.gz: 815d43d7a444de7a9d1e8f180a1f3e5f205aabdd
4
- data.tar.gz: c2f597cdc40b93ee8505ac42a0bbba91d01d497c
3
+ metadata.gz: 8b3cf8d0ed3c0979a7441634ba8aa63765b0335c
4
+ data.tar.gz: a1f2447221b783edac1dcdfdf1ce1cf953dcb0aa
5
5
  SHA512:
6
- metadata.gz: bad362bcf223b7600ca11ea3717836e9f8f09aa88f5223a90a550908e7ec1462cf9fb86426ad72d1e2fe4a986d17f3a8bb0d2369b78f9b5af8c055f6233163f2
7
- data.tar.gz: 25d4a20564c83090e9fef0b0e9147c963dd7e275be3849f3e788839f077b4a2e8d50467210efbcdd9f7afa85d00fa648d7330f89152c84738840a075bdb00bf7
6
+ metadata.gz: 6bf03974f51cbc83cde295233df882baddb2173b847eaed0323ac84445735321e1d4d90f5c3de9b30db9e8d7b963ed98e9423064184be5c735becd7c33753ea9
7
+ data.tar.gz: 7900bb500c2e03160c7af67de9ff501f2efea1523b7a5d926850ea40b632935c19f5f8cc6f1e0592ff1935415808f51118a58d01dd54629fe78a7e79181e226f
@@ -4,8 +4,9 @@ module RedisEval
4
4
  attr_reader :source, :sha
5
5
 
6
6
  def self.build_from_parent(src, parent, with_load: true)
7
- script = new(src, with_load: with_load)
7
+ script = new(src, with_load: false)
8
8
  script.parent = parent
9
+ script.load if with_load
9
10
  script
10
11
  end
11
12
 
@@ -17,11 +18,11 @@ module RedisEval
17
18
  end
18
19
 
19
20
  def load
20
- redis.script(:load, source)
21
+ redis_without_namespace.script(:load, source)
21
22
  end
22
23
 
23
24
  def exist?
24
- redis.script(:exists, sha)
25
+ redis_without_namespace.script(:exists, sha)
25
26
  end
26
27
 
27
28
  def execute(keys = [], argv = [])
@@ -42,5 +43,11 @@ module RedisEval
42
43
  def redis=(conn)
43
44
  @redis = conn
44
45
  end
46
+
47
+ private
48
+
49
+ def redis_without_namespace
50
+ defined?(Redis::Namespace) && redis.is_a?(Redis::Namespace) ? redis.redis : redis
51
+ end
45
52
  end
46
53
  end
@@ -1,3 +1,3 @@
1
1
  module RedisEval
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_eval
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2bskn