Class Irc::Plugins
In: rbot/plugins.rb
Parent: Object
Class: JoinMessage Class: PartMessage Class: Plugins Class: KickMessage Class: IrcAuth Class: IRCChannel Class: IrcSocket Class: BotConfig Class: Keywords Class: BotRegistryAccessor Class: IrcClient Class: DBHash Class: Language Class: TopicMessage Class: QuitMessage Class: PrivMessage Class: UserMessage Class: NoticeMessage Class: IrcBot Class: BasicUserMessage Class: NickMessage Class: Plugin Class: BotRegistry Class: Keyword Class: DBTree Module: Irc

class to manage multiple plugins and delegate messages to them for handling

bot    cleanup    delegate    help    helptopics    length    new    plugins    privmsg    rescan    save    scan   
Public Class methods
new(bot, dirlist)
bot:associated IrcBot class
dirlist:array of directories to scan (in order) for plugins

create a new plugin handler, scanning for plugins in dirlist


access to associated bot


access to list of plugins

Public Instance methods

load plugins from pre-assigned list of directories


call the save method for each active plugin


call the cleanup method for each active plugin


drop all plugins and rescan plugins on disk calls save and cleanup for each plugin before dropping them


return list of help topics (plugin names)


return help for topic (call associated plugin's help method)

delegate(method, message)

see if each plugin handles method, and if so, call it, passing message as a parameter


see if we have a plugin that wants to handle this message, if so, pass it to the plugin and return true, otherwise false