X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=lib%2Frbot%2Fplugins.rb;h=9589b202d46487fe811749a2a3d2a876dcf5e903;hb=f287bf1e73829434d92b46c333c3185373198518;hp=8621fe45341456e485894a4768c8d8c298ae8257;hpb=b6db18c5467c1a161e3fcc39d82ad1b38e213c87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 8621fe45..9589b202 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -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. @@ -582,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_ # @@ -653,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 @@ -1001,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