Standard Plugin Information File

Added by Muntek Singh over 7 years ago

I was just discussing this with thegcat and meineerde in IRC and thought I'd shift the discussion here. The relevant bits:

Khalsa: meineerde / thegcat did I ever discuss with you that I wanted some sort of file within each plugin that contains standard information about the plugin?

thegcat: Khalsa: like what, author, description, link, email address... like in init.rb? ;-)

meineerde: thegcat: Khalsa is right, it should be seperate. That way, you could gather the info without having to instantiate the plugin.

meineerde: Khalsa: All the meta data currenty defined in the register proc could also be in a plugin.rb with a structure with minimal external dependencies.

thegcat: meineerde: make it a yml, done

thegcat: you could even retain the current stuff as compatibilty, load your yaml in init and dump my_great_plugin_description_yaml[:author] into the right places

Basically I want a standard file packaged within each plugin that contains a set of data in a useful parse able format. Data such as Author, Description, Link, Compatibility information, etc.

Thoughts?

Replies (4)

RE: Standard Plugin Information File - Added by Felix Schäfer over 7 years ago

Fine by me, and it definitely makes it easier for external consumers (*cough* plugin site *cough*) to gather information about the plugin.

RE: Standard Plugin Information File - Added by Mischa The Evil over 7 years ago

Felix Schäfer wrote:

Fine by me, and it definitely makes it easier for external consumers (*cough* plugin site *cough*) to gather information about the plugin.

I indeed see a huge advantage of such a solution for the (or a) plugin site (or directory)!!
While I was "prototyping" the initial version of the current Plugin List I've already tried to set some form of standard for it which I've documented at ExtensionListInfo.

This issue also relates to the possible solutions Eric proposed earlier (don't remember where precisely) for a plugin directory like the one of Radiant CMS (http://ext.radiantcms.org).

Just my two cents... ;)

RE: Standard Plugin Information File - Added by Eric Davis over 7 years ago

What information would it need that isn't in the plugin register block already? The problem with a information file is that it would put information in two separate places that would need to be maintained (init.rb and info.yml). What about:

  • Parsing the metadata directly from init.rb. The register block is pretty simple and it wouldn't be difficult to extend/parse.
  • Requiring plugins to have a gemspec and using Rubygems itself it read that data. It would also make distribution easy.

P.S. I seem to remember Rails plugins having something like this a long time ago. about.yml or something.

Eric Davis

RE: Standard Plugin Information File - Added by Felix Schäfer over 7 years ago

Eric Davis wrote:

What information would it need that isn't in the plugin register block already?

None.

The problem with a information file is that it would put information in two separate places that would need to be maintained (init.rb and info.yml).

No, the idea is to get all that out of init.rb into info.yml (or whatever) and to load that info from info.yml in init.rb.

What about:

  • Parsing the metadata directly from init.rb. The register block is pretty simple and it wouldn't be difficult to extend/parse.

1 extra parser, and Muntek/khalsa seemed to have issues with reading that block at all.

  • Requiring plugins to have a gemspec and using Rubygems itself it read that data. It would also make distribution easy.

Don't know rubygems enough to comment on that one.

(1-4/4)