From 2ed83d89e5fad7d0bed1003fdc60b538a4187162 Mon Sep 17 00:00:00 2001 From: Tom Gilbert Date: Thu, 9 Feb 2006 20:44:50 +0000 Subject: [PATCH] attempt to resolve #65 --- lib/rbot/plugins.rb | 5 +++++ lib/rbot/registry.rb | 4 ++++ 2 files changed, 9 insertions(+) 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. -- 2.39.2