resque-aliasing 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/resque/plugins/aliasing.rb +10 -7
- data/lib/resque/plugins/aliasing/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: 2614c13425403e730213c99b8d3867cae733177d
|
4
|
+
data.tar.gz: 80f7c8c825d6a15873178a8c08a2c3152a6c5e43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f24127b72b8d1e00169a171f284dd5dc3a6783fa9f92730da140b552be3ecaedac37044a36131b257414f1fa30efe6e24c0bb54261956974927ff421b23a81
|
7
|
+
data.tar.gz: 5b76363689197aeb6b69a0997ed626f06bf8e303f7f1896108fed17bdad5c3445978315d36a69ac25280f217cf9070ce7ecba3e09ad78bab0be5ece75e2abd52
|
@@ -33,17 +33,20 @@ module Resque
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def ensure_const parent, const_name, klass
|
36
|
+
full_const_name = const_name
|
37
|
+
full_const_name = "#{parent.name}::#{full_const_name}" unless parent == Object
|
38
|
+
|
36
39
|
if parent.const_defined? const_name
|
37
40
|
const = parent.const_get const_name
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
41
|
+
if full_const_name == const.name
|
42
|
+
unless const.kind_of? klass
|
43
|
+
raise UnexpectedConstant, "Expected #{full_const_name} to be a #{klass.name}"
|
44
|
+
end
|
45
|
+
return const
|
42
46
|
end
|
43
|
-
const
|
44
|
-
else
|
45
|
-
parent.const_set const_name, klass.new
|
46
47
|
end
|
48
|
+
|
49
|
+
parent.const_set const_name, klass.new
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|