Currently a pinto command executes what has been defined in its corresponding action class. I would like, instead, for Pinto to be able to work with plugins, so that the purpose of an action would be to load all plugins implementing a corresponding role and execute them in turn.
Pinto::Role::Mirror - role requiring a 'mirror' method
Pinto::Plugin::MyMirror - plugin implementing Pinto::Role::Mirror and providing a custom 'mirror method'
Pinto::Action::Mirror - load all plugins implementing Pinto::Role::Mirror and execute their 'mirror' method.
This is the architectire that Dist::Zilla and Perlanet use.
Most of the current pinto actions would then have corresponding roles, and a plugin will implement one or more of these as necessary. Examples:
Pinto::Role::Mirror - mirror stuff
Pinto::Role::Index - update index after new distributions have been added
Pinto::Role::Clean - a role that allows plugins (e.g. mirroring plugins) to say which files they no longer need
Pinto::Role::Verify - a role that allows plugins to check that whatever files they care about are consistent with the index
Pinto::Role::Initialize - a role that allows plugins to do stuff at repo creation, e.g. to set up pinto.db or other databases
I am willing to work on this feature if you believe it makes sense to implement.
Sounds interesting.. it would likely also help eliminate the duplication between the code that describes the command line syntax for commands, and the moose attributes that contain those configs (drawing again on what Dist::Zilla does here), and the duplication between pinto-admin and pinto-remote.
(PS. I've created the #pinto channel on irc.perl.org... currently it's just me there.. but this could be the start of a new community!)
I've gotten better at using roles, but I still don't see an opportunity to make Pinto totally pluggable like Dist::Zilla. So I'm gonna stick with this architecture for now. But I'm always open to new ideas if you can show me a better way.