Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow rails pattern for optional dependency gems #97

Open
cjcolvar opened this issue Apr 1, 2022 · 1 comment
Open

Follow rails pattern for optional dependency gems #97

cjcolvar opened this issue Apr 1, 2022 · 1 comment

Comments

@cjcolvar
Copy link
Member

cjcolvar commented Apr 1, 2022

See discussion on #94

Try doing something more like rails / valkyrie to load gems for adapters and warn users when they aren't installed and attempting to use them.
https://github.com/samvera/valkyrie/blob/1ad73aed5b41aa1957912f198015629e05a2a2b1/lib/valkyrie/persistence/fedora.rb#L3-L9

@jrochkind
Copy link
Contributor

Oh I see you already have a ticket on this!

For a concrete example of how it ends up working now, see documentation in #101

There are other possible alternatives:

  • We could just list all these dependencies as actual dependencies? But I imagine the reason not to include them in the formal dependencies is to not force every app using active_encode to install them, even if they'll never use the one adapter that needs them.

  • We could put each adapter (at least if it needs additional dependencies) in it's own gem, say active_encode-mediaconvert. But I suspect the added maintenance burden of multiple gems that all need to work with each other as they each progress -- is more than we can handle right now.

So something like the Rails/valkyrie approach is probably the least bad low hanging fruit improvement.

I think it is preferable to expand on what valkyrie does, and formally specify the version specification (1.x, 2.x etc) of the "optional dependency" that is required. I think Rails does do that, although its' error message has in the past confusingly not told you what version it needed! I wrote more about this here: https://bibwild.wordpress.com/2015/09/09/optional-gem-dependencies/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants