cinchrb / cinch

The IRC Bot Building Framework
http://www.rubydoc.info/gems/cinch
MIT License
1k stars 180 forks source link

plugin autoloader #133

Closed wyattisimo closed 11 years ago

dominikh commented 11 years ago

Sorry, but this has no place in Cinch. One of the ideas of Cinch is that it doesn't force a directory structure or config file format on you. Not to mention that your layout doesn't match the standard way most people do layout their plugins. It also introduces its own config system even though there already is a way to set and access plugin configuration in Cinch.

wyattisimo commented 11 years ago

I was not aware of an existing way to set and access plugin config--what is it? And how do most people lay out their plugins?

This plugin autoloader already allows the caller to specify the directory where the plugins are located. It would be fairly easy to add a way to let the caller also specify the structure within that directory if the user has a special way to lay out his/her plugins.

dominikh commented 11 years ago

c.plugins.options[PluginClass][:some_option] = "some value" and config[:some_option] in a specific plugin to access it.

The canonical way to lay out plugins can be seen in https://github.com/cinchrb/cinch-identify for example.

Don't get me wrong, I appreciate your effort, but "automatic loading of plugins" is not something that should be in the core of Cinch. Several people have written plugin management code (me including) or entire bot management (Cinchize, for example), and that's great. But that's also the idea: That people write their own solutions based on Cinch, not integrated with Cinch.

wyattisimo commented 11 years ago

cool. Thanks for the explanation.