Class | Texter |
In: |
src/demos/Texter.rb
|
Parent: | Object |
This programme demonstrates a simple PlugMan application that performs text transformations. It shows both the plugin dependency mechanism as well as the plugin discovery mechanism using extension points.
Usage: ./demos/Texter.rb <option> -p, --plugin-detail # Prints plugin details. -h, --help # This screen! -i, --input # A string to transform using plugins. No options is the same as running with -i 'Hello, World!'
Texter explicitly uses the :main plugin and :main defines an extension point :transform. Any plugins that extend :transform from the :main plugin will be invoked by the :main plugin.
Go ahead, make your own plugin (perhaps a UPCASE, downcase or squeze plugin.)
The :case_swap_reverse plugin is invoked via an extension point but makes use of the plugin dependency mechanism. It knows explicitly about :case_swap and :reverse plugins and calls them explicilty.