doc/plugins.md in power_stencil-0.5.1 vs doc/plugins.md in power_stencil-0.6.0

- old
+ new

@@ -13,10 +13,11 @@ - [Plugin creation](#plugin-creation) - [Adding new subcommands to `PowerStencil`](#adding-new-subcommands-to-powerstencil) - [Providing entity types and templates](#providing-entity-types-and-templates) - [Providing custom build process](#providing-custom-build-process) - [Plugin capabilities and structure](#plugin-capabilities-and-structure) +- [Using plugins available as gems](#using-plugins-available-as-gems) - [Conclusion](#conclusion) <!-- /TOC --> [:back:][Documentation root] @@ -424,15 +425,61 @@ :name: test ``` All of this to demonstrate that a plugin can be almost anything, even something very minimalistic, but nevertheless you should keep on using the `power_stencil plugin --create` command and benefit from the structure it brings, as well as the possibility to become a stand-alone plugin gem... +# Using plugins available as gems +Any plugin you have created using the `power_stencil plugin --create` command is directly eligible to become a gem. + +**If you release a plugin you created within a project as a gem (by doing `bundle exec rake release` from within the plugin directory, like for any standard gem :+1:), you can then re-use your plugin from any other `PowerStencil` project !** + +All you have to do for that is to declare it in the `.ps_project/versioned-config.yaml` config file by adding an array `:project_plugins`: + +```yaml +... +:project_plugins: + - my_awesome_plugin1 + - my_awesome_plugin2 + - my_awesome_plugin3 +... +``` + +Now if you try to run power_stencil you may face an error if the gem is not locally installed: + +``` +▶ power_stencil info +-------------------------------------------------------------------------------- +PROJECT REPORT +-------------------------------------------------------------------------------- + General information: +Program aborted with message: 'Cannot find plugin 'my_awesome_plugin1'. Try 'power_stencil plugin --install''. + Use --debug option for more detail (see --help). + +``` +Here you have the choice to either manually install each of your plugins manually by using the regular gem program: + + $ gem install my_awesome_plugin1 my_awesome_plugin2 my_awesome_plugin3 + +But `PowerStencil` provides a convenient command to install/update your plugins: + +``` +$ power_stencil plugin --install +Fetching: my_awesome_plugin1-0.1.0.gem (100%) +Fetching: my_awesome_plugin2-0.1.1.gem (100%) +Fetching: my_awesome_plugin3-1.2.3.gem (100%) +Installed plugin 'my_awesome_plugin1' (version: 0.1.0) +Installed plugin 'my_awesome_plugin2' (version: 0.1.1) +Installed plugin 'my_awesome_plugin3' (version: 1.2.3) +``` + +**:star2: ::+1: You can now verify using `power_stencil info` or `power_stencil plugin --list`, that the plugins have been installed and that any feature they provide is now available to your project.** + # Conclusion The documentation for plugins is not fully complete, so you are encouraged to read the code. Some official plugins are under development, and the documentation will be improved along their development... -**:warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen. This will be the case once `PowerStencil` turns 1.0.0.** Yet now _local_ plugins are almost in their final stage. Gem plugins will soon be released and then `PowerStencil` will turn 1.0.0. +**:warning: As opposed to the rest of `PowerStencil`, the functionnality is nevertheless not completely frozen. This will be the case once `PowerStencil` turns 1.0.0.** but plugins are close to their final release, and anything above version 0.6 is already really usable. [:back:][Documentation root] <!-- End of Document --> \ No newline at end of file