From 836cf49c210ebfeb443861d26379a81b333c2c78 Mon Sep 17 00:00:00 2001 From: "M. Hecker" Date: Sat, 3 May 2014 22:42:07 +0200 Subject: [PATCH] [registry] fix subregistry re-use (closes #1) --- lib/rbot/registry.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.39.2