Module: Uniword::Plugin

Defined in:
lib/uniword/plugin.rb,
lib/uniword/plugin/loader.rb,
lib/uniword/plugin/registry.rb,
lib/uniword/plugin/validator.rb,
lib/uniword/plugin/cli_command.rb,
lib/uniword/plugin/transformer.rb

Overview

Plugin system: extend uniword without forking.

Three extension surfaces, each with a base class:

  • Plugin::Validator — register custom validation rules
  • Plugin::Transformer — mutate documents at defined pipeline stages (load, pre-save, post-reconcile)
  • Plugin::CliCommand — register new Thor subcommands

Discovery: Plugin::Loader.load_all walks installed gems via Gem.find_files("uniword/plugin/*.rb") and loads each.

Configuration: Uniword.configuration.plugins = [:my_plugin] (default :all).

Defined Under Namespace

Classes: CliCommand, Loader, Registry, Transformer, Validator