diff options
author | M. Hecker <apoc@sixserv.org> | 2014-05-03 22:42:07 +0200 |
---|---|---|
committer | M. Hecker <apoc@sixserv.org> | 2014-05-03 22:42:07 +0200 |
commit | 836cf49c210ebfeb443861d26379a81b333c2c78 (patch) | |
tree | 5734c2b9ffe7b0b7a9a7e774186e61c07bf0f3f6 /lib | |
parent | 111c284f29dd728f6535ed05d1f2820fff02b78d (diff) |
[registry] fix subregistry re-use (closes #1)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/registry.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/rbot/registry.rb b/lib/rbot/registry.rb index c4e50faf..5e905ebb 100644 --- a/lib/rbot/registry.rb +++ b/lib/rbot/registry.rb @@ -112,11 +112,12 @@ class Registry @registry = nil @default = nil @recovery = nil + @sub_registries = {} end def sub_registry(prefix) path = File.join(@filename.gsub(/\.[^\/\.]+$/,''), prefix.to_s) - return self.class.new(path) + @sub_registries[path] ||= self.class.new(path) end # creates the registry / subregistry folders |