]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/plugins.rb
message: add #thanks method, similar to okay
[user/henk/code/ruby/rbot.git] / lib / rbot / plugins.rb
index 0e7e9d6f4a4163465aa6a2df810b913554d2198d..9589b202d46487fe811749a2a3d2a876dcf5e903 100644 (file)
@@ -215,6 +215,7 @@ module Plugins
       @registry.flush
     end
 
+
     # Method called to cleanup before the plugin is unloaded. If you overload
     # this method to handle additional cleanup tasks, remember to call super()
     # so that the default cleanup actions are taken care of as well.
@@ -410,6 +411,9 @@ module Plugins
     attr_reader :botmodules
     attr_reader :maps
 
+    attr_reader :core_module_dirs
+    attr_reader :plugin_dirs
+
     # This is the list of patterns commonly delegated to plugins.
     # A fast delegation lookup is enabled for them.
     DEFAULT_DELEGATE_PATTERNS = %r{^(?:
@@ -579,6 +583,10 @@ module Plugins
       ([str, err.inspect] + err.backtrace).join("\n")
     end
 
+    def get_plugin(name)
+      plugins.find { |plugin| plugin.name == name }
+    end
+
     # This method is the one that actually loads a module from the
     # file _fname_
     #
@@ -650,7 +658,6 @@ module Plugins
         return newerr
       end
     end
-    private :load_botmodule_file
 
     # add one or more directories to the list of directories to
     # load core modules from
@@ -998,7 +1005,7 @@ module Plugins
       sort_modules unless @sorted_modules
 
       opts = {}
-      opts.merge(args.pop) if args.last.class == Hash
+      opts.merge!(args.pop) if args.last.class == Hash
 
       m = args.first
       if BasicUserMessage === m