redis_eval 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redis_eval/script.rb +10 -3
- data/lib/redis_eval/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b3cf8d0ed3c0979a7441634ba8aa63765b0335c
|
4
|
+
data.tar.gz: a1f2447221b783edac1dcdfdf1ce1cf953dcb0aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6bf03974f51cbc83cde295233df882baddb2173b847eaed0323ac84445735321e1d4d90f5c3de9b30db9e8d7b963ed98e9423064184be5c735becd7c33753ea9
|
7
|
+
data.tar.gz: 7900bb500c2e03160c7af67de9ff501f2efea1523b7a5d926850ea40b632935c19f5f8cc6f1e0592ff1935415808f51118a58d01dd54629fe78a7e79181e226f
|
data/lib/redis_eval/script.rb
CHANGED
@@ -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:
|
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
|
-
|
21
|
+
redis_without_namespace.script(:load, source)
|
21
22
|
end
|
22
23
|
|
23
24
|
def exist?
|
24
|
-
|
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
|
data/lib/redis_eval/version.rb
CHANGED