toys 0.15.0
v0.15.0 / 2023-10-12
Toys 0.15.0 is a major release that adds arbitrary signal handling, cleans up some warts around entrypoint and method definition, and fixes a few long-standing issues.
Breaking changes:
- If a missing delegate or a delegation loop is detected, ToolDefinitionError is raised instead of RuntimeError.
- Passing a block to the to_run directive no longer defines the "run" method, but simply uses the block as the run entrypoint.
- The default algorithm for determining whether flags and arguments add methods now allows overriding of methods of Toys::Context and any other included modules, but prevents collisions with private methods defined in the tool. (It continues to prevent overriding of public methods of Object and BasicObject.)
New functionality:
- New DSL directive on_signal lets tools provide signal handlers.
- You can pass a symbol to the to_run directive to set the entrypoint to a method other than "run".
- Flags and arguments can be configured explicitly to add methods or not add methods, overriding the default behavior.
- The minitest template has a configuration argument that defines MT_COMPAT.
Fixes and documentation:
- The Bundler integration prevents Bundler from attempting to self-update to the version specified in a lockfile (which would often cause problems when Bundler is called from Toys).
- Tools generated by the minitest and rspec standard templates can now interact properly with stdin (e.g. so you can invoke pry temporarily from a test.)
- Some cleanup of varioius mixins to prevent issues if their methods ever get overridden.
- Various improvements and clarifications in the reference documentation and user guide.