If a plugin begins with double colons, as above, it is automatically prefixed with App::Adenosine::Plugin and then instantiated with no arguments (->new). For plugins that can take options you may also pass objects. So for example the following is also valid:

An "autouse" version of adenosine which uses all the plugins in a certain part of the filesystem is planned.

CREATING PLUGINS

Adenosine has two types of plugins. The plugin system will grow as users find more things that need extending, so as with much of OSS, this is a scratch-the-itch situation. If you have a use case for a new plugin hook let me know and I'll set it up.

Plugins are just objects that the Adenosine object has. There are a number of interface style roles that the plugin consumes to signal that the plugin uses a certain hook. Note that plugins can consume multiple roles to use more than one hook. The next sections document the roles and their respective hooks.

App::Adenosine::Role::FiltersStdErr

Only a filter_stderr method needs to be implemented. It takes a string (stderr output from curl) and should return a string. An existing example of a plugin that consumes this role is App::Adenosine::Plugin::Rainbow.

App::Adenosine::Role::WrapsCurlCommand

Only a wrap method needs to be implemented. It takes a coderef and should return a coderef. The returned coderef should pass the args it gets to the coderef the method got and return out values returned by the coderef. To be more clear, this is the pattern: