regstry 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/registry/version.rb +1 -1
- data/lib/registry.rb +4 -3
- 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: 1bd6c3f92ed36c1c2cbabbf38e84ba5329235575
|
4
|
+
data.tar.gz: 3daa123bcd92d20483b80170faca117c0d7feaec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed6ddc1b97f1efee615490ea81d1430255312513daab6e4681e5a8d7b77340e57ce3f08166c49c591264f5ff8472273165aa41bef4d677977446ce6a07e7312
|
7
|
+
data.tar.gz: 7e645a0ae97644121c4628353baec5f423609a9ab25131711fec454575e3a241868e8245b986bb004f58c6bd3b0731030addbdb904670403b1fb08ef2e7e0015
|
data/lib/registry/version.rb
CHANGED
data/lib/registry.rb
CHANGED
@@ -62,7 +62,8 @@ module Registry
|
|
62
62
|
base.send(:extend, ClassMethods)
|
63
63
|
base.send(:include, InstanceMethods)
|
64
64
|
|
65
|
-
name = base.name.to_s.split('::').last
|
65
|
+
name = base.name.to_s.split('::').last
|
66
|
+
name = name ? name.downcase.to_sym : :default
|
66
67
|
base.instance_variable_set(:@registry_name, name)
|
67
68
|
|
68
69
|
base.instance_variable_set(:@registries, Registries.new)
|
@@ -78,7 +79,7 @@ module Registry
|
|
78
79
|
end
|
79
80
|
|
80
81
|
def registered?(key)
|
81
|
-
registry.key?(key
|
82
|
+
registry.key?(key && key.to_sym)
|
82
83
|
end
|
83
84
|
|
84
85
|
def lookup(key)
|
@@ -86,7 +87,7 @@ module Registry
|
|
86
87
|
end
|
87
88
|
|
88
89
|
def [](key)
|
89
|
-
registry[key
|
90
|
+
registry[key && key.to_sym] || fail(MSGS[:unknown] % [key, registry.keys.sort])
|
90
91
|
end
|
91
92
|
|
92
93
|
def registry(name = nil)
|