"Make your software extensible. Extensible software is simple software that doesn’t try to cover all the use cases. Instead, extensions can be added successively as those use cases become more obvious. Note that having extensible protocols is not a good idea."
communitywiki.org/wiki/SimpleS

Follow

I'm wondering how to declare my dependencies for Phoebe, an extensible Gemini wiki. Every extension seems to add more dependencies, but since they're optional extensions, the dependencies they add are also optional. I guess the CPAN way of packaging them all would be as separate modules? Right now the benefit of including them all is that I can run tests for them all. That's nice, for sure.

· · Web · 1 · 1 · 0

@kensanata if they don't force me to install extra dependencies I don't mind lots of relatex modules in the same dist. (See Plack)

@AFresh1 how does that work? Just name these modules as test dependencies? Or try to load them and if they don’t exist, skip the tests, may with some output?

@kensanata depends, but often the additional modules don't require more dependencies, or you can check if they can be loaded and skip tests. I generally find that those additional dependencies are a good indication it should be a separate dist.

@AFresh1 I think you're right: right now there is a directory you can create and any Perl source file you put there is getting loaded on startup. The files come from my repo. That is, if you install Phoebe using CPAN, these files are unpacked and tested, but then they aren’t being installed anywhere. What I need instead might be: there is a module you can install, such as
App::phoebe::gopher. In your config file, you’d write: “use App::phoebe::gopher”. Something like that? 🤔

@kensanata or some way to tell Phoebe to load them for you. Module::Pluggable comes to mind.

metacpan.org/release/Module-Pl

@AFresh1 Interesting, thanks! For now, I'm marking all the plugin tests as author tests, and removing the dependencies again. Not yet a rewrite, but I'll get there eventually.

@kensanata also as an example, Dist::Zilla has two different types of modules it loads based on the config file, Plugins and PluginBundles. The former is in the (ini style) config as `[SomePlugin]` which loads `Dist::Zilla::Plugin::SomePlugin` or `[@SomeBundle]` which loads `Dist::Zilla::PluginBundle::SomeBundle`. I believe you can also specify `[+My::Plugin::In::A::Different::Namespace]` or somesuch.

Sign in to participate in the conversation
Octodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!