summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTom Gilbert <tom@linuxbrit.co.uk>2006-02-09 20:44:50 +0000
committerTom Gilbert <tom@linuxbrit.co.uk>2006-02-09 20:44:50 +0000
commit2ed83d89e5fad7d0bed1003fdc60b538a4187162 (patch)
tree2db511bd954951318ae60306cab4a98718331ae2 /lib
parent590379e94b8e4a17414cf6ed6895c35d3123cc2e (diff)
attempt to resolve #65
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/plugins.rb5
-rw-r--r--lib/rbot/registry.rb4
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb
index f45e44f4..54b814e0 100644
--- a/lib/rbot/plugins.rb
+++ b/lib/rbot/plugins.rb
@@ -99,6 +99,10 @@ module Plugins
@registry = BotRegistryAccessor.new(@bot, self.class.to_s.gsub(/^.*::/, ""))
end
+ def flush_registry
+ @registry.flush
+ end
+
def map(*args)
@handler.map(*args)
# register this map
@@ -212,6 +216,7 @@ module Plugins
# call the save method for each active plugin
def save
+ delegate 'flush_registry'
delegate 'save'
end
diff --git a/lib/rbot/registry.rb b/lib/rbot/registry.rb
index 6afc7622..6388c91d 100644
--- a/lib/rbot/registry.rb
+++ b/lib/rbot/registry.rb
@@ -118,6 +118,10 @@ module Irc
# debug "initializing registry accessor with name #{@name}"
end
+ def flush
+ @registry.flush
+ end
+
# convert value to string form for storing in the registry
# defaults to Marshal.dump(val) but you can override this in your module's
# registry object to use any method you like.