puma icon indicating copy to clipboard operation
puma copied to clipboard

Allow to customise plugin's path and name

Open Aerdayne opened this issue 1 year ago • 1 comments

Description

This PR augments the Puma plugin API in order to offer more flexibility to developers of 3rd-party plugins.

It allows to optionally specify a custom override for the plugin's name and the path where its definition is located, instead of having to conform to the expected directory structure and naming.

This is useful when a 3rd-party gem provides a plugin, but for whatever reason does not want to conform to the expected path structure and file naming rules.

I haven't found any tests for the existing surrounding code, otherwise I would have adjusted the specs - let me know if I missed them.

I also understand that this might be too niche of a use-case to warrant a change in the API, so I'm totally fine with this being closed.

Your checklist for this pull request

  • [x] I have reviewed the guidelines for contributing to this repository.
  • [ ] I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • [x] My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • [ ] If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • [ ] If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • [x] I have updated the documentation accordingly.
  • [ ] All new and existing tests passed, including Rubocop.

Aerdayne avatar Jul 04 '24 13:07 Aerdayne

I haven't found any tests for the existing surrounding code, otherwise I would have adjusted the specs - let me know if I missed them.

If that is the case (I also haven't looked), it would be great to add some.

I also understand that this might be too niche of a use-case to warrant a change in the API, so I'm totally fine with this being closed.

Looks like the change to the API is backwards compatible, is that correct?

Seeing the example in the updated docs,

# In Puma configuration file
plugin "custom_plugin", "<gem_root>/lib/integrations/puma/plugin"

I fail to see why anyone would want to do it like this... isn't it pretty complex to have users supply a path from inside a gem? What is the actual benefit of this?

dentarg avatar Jul 14 '24 16:07 dentarg

Closing this as I don't have the time to see this through and my originally described use-case is no longer relevant.

Aerdayne avatar Jun 14 '25 17:06 Aerdayne