diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/plugins.rb | 5 | ||||
-rw-r--r-- | lib/rbot/registry.rb | 4 |
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. |