Release History
v0.13.0 / 2022-02-08
Toys-Core 0.13.0 is a major release with significant improvements to the git cache, along with compatibility improvements and bug fixes.
New functionality:
- The
load_git
directive and the underlyingToys::Utils::GitCache
class now support updating from git based on cache age. - The
Toys::Utils::GitCache
class supports copying git content into a provided directory, querying repo information, and deleting cache data. - The
Toys::Utils::GitCache
class makes files read-only, to help prevent clients from interfering with one another. - The
:terminal
mixin and the underlyingToys::Utils::Terminal
class now honor theNO_COLOR
environment variable. - Added
Toys::CLI#load_tool
, which is useful for testing tools.
Fixes and compatibility updates:
- Bundler install/updates are now spawned in subprocesses for compatibility with bundler 2.3. The bundler integration also now requires bundler 2.2 or later.
- The
exec_tool
andexec_proc
methods in the:exec
mixin now log their execution in the same way as other exec functions. - Minor compatibility fixes to provide partial support for TruffleRuby.
Other notes:
- The internal GitCache representation has changed significantly to support additional features and improve robustness and performance. This will force existing caches to update, but should not break existing usage.
v0.12.2 / 2021-08-30
- FIXED: Tool context inspect string is no longer overwhelmingly long
- FIXED: Fixed an exception in GitCache when updating a changed ref
v0.12.1 / 2021-08-17
- FIXED: Fixed a regression in 0.12.0 where bundler could use the wrong Gemfile if you set a custom context directory
v0.12.0 / 2021-08-05
Toys-Core 0.12.0 is a major release with significant new features and bug fixes, and a few breaking interface changes. Additionally, this release now requires Ruby 2.4 or later.
Breaking interface changes:
- The Toys::Tool class has been renamed Toys::ToolDefinition so that the old name can be used for class-based tool definition.
- Tool definition now raises ToolDefinitionError if whitespace, control characters, or certain punctuation are used in a tool name.
- Toys::Loader#add_path no longer supports multiple paths. Use add_path_set instead.
- The "name" argument was renamed to "source_name" in Toys::Loader#add_block and Toys::CLI#add_config_block
New functionality:
- The DSL now supports a class-based tool definition syntax (in addition to the existing block-based syntax). Some users may prefer this new class-based style as more Ruby-like.
- You can now load tools from a remote git repository using the load_git directive.
- Whitespace is now automatically considered a name delimiter when defining tools.
- There is now an extensible settings mechanism to activate less-common tool behavior. Currently there is one setting, which causes subtools to inherit their parent's methods by default.
- The load directive can load into a new tool.
- Added a new utility class and mixin that provides XDG Base Directory information.
- Added a new utility class and mixin that provides cached access to remote git repos.
- The help text generator now supports splitting the subtool list by source.
- Loader and CLI methods that add tool configs now uniformly provide optional source_name and context_directory arguments.
- Toys::SourceInfo now supports getting the root ancestor and priority of a source.
- Toys::ToolDefinition now has a direct accessor for the source root. This is always set for a tool, even if it isn't marked as finished.
Fixes:
- Fixed some bundler integration issues that occurred when the bundle is being installed in a separate path such as a vendor directory.
- Toys::ContextualError now includes the full backtrace of the cause.
- Cleaned up some unused memory objects during tool loading and lookup.
v0.11.5 / 2021-03-28
- BREAKING CHANGE: The exit_on_nonzero_status option to exec now exits on signals and failures to spawn, in addition to error codes.
- ADDED: Support retries in the bundler integration.
- FIXED: Fix a bundler 2.2 integration issue that fails install in certain cases when an update is needed.
v0.11.4 / 2020-10-11
- FIXED: Doesn't modify bundler lockfiles when adding Toys to a bundle
v0.11.3 / 2020-09-13
- FIXED: The Exec library recognizes the argv0 option, and logs it appropriately
v0.11.2 / 2020-09-06
- FIXED: Fix a JRuby-specific race condition when capturing exec streams
v0.11.1 / 2020-08-24
- DOCS: Minor documentation tweaks.
v0.11.0 / 2020-08-21
- ADDED: The load path can be truncated using the
truncate_load_path!
directive. - IMPROVED: Generated help for delegates now includes the information for the target tool, plus subtools of the delegate.
- IMPROVED: The
:bundler
mixin searches forgems.rb
and.gems.rb
in addition toGemfile
. - IMPROVED: The
:budnler
mixin can load a specific Gemfile path. - FIXED: The loader can now find data and lib directories at the root level of a Toys directory.
- FIXED: Exec::Result correctly reports processes that terminated due to signals.
- FIXED: Fixed a rare Exec capture failure that resulted from a race condition when closing streams.
v0.10.5 / 2020-07-18
- IMPROVED: The bundler mixin silences bundler output during bundle setup.
- IMPROVED: The bundler mixin allows toys and toys-core to be in the Gemfile. It checks their version requirements against the running Toys version, and either adds the corret version to the bundle or raises IncompatibleToysError.
- IMPROVED: The bundler mixin automatically updates the bundle if install fails (typically because a transitive dependency has been explicitly updated.)
- FIXED: Some cases of transitive dependency handling by the bundler mixin.
- FIXED: Fixed a crash when computing suggestions, when running with a bundle on Ruby 2.6 or earlier.
v0.10.4 / 2020-07-11
- IMPROVED: Bundler integration can now handle Toys itself being in the bundle, as long as the version requirements cover the running Toys version.
- IMPROVED: Passing
static: true
to the:bundler
mixin installs the bundle at definition rather than execution time.
v0.10.3 / 2020-07-04
- FIXED: The
exec_separate_tool
method in the:exec
mixin no longer throws ENOEXEC on Windows.
v0.10.2 / 2020-07-03
- FIXED: The load path no longer loses the toys and toys-core directories after a bundle install.
v0.10.1 / 2020-03-07
- FIXED: Setting
:exit_on_nonzero_status
explicitly to false now works as expected.
v0.10.0 / 2020-02-24
Functional changes:
- ADDED:
:bundler
mixin that installs and sets up a bundle for the tool - ADDED:
bundle
method toToys::Utils::Gems
that performs bundler install and setup - ADDED:
subtool_apply
directive which applies a block to all subtools. - ADDED: Add
.lib
directories to the Ruby load path when executing a tool. - ADDED:
toys_version?
andtoys_version!
directives that check against version requirements. - ADDED:
exec_separate_tool
andcapture_separate_tool
methods in the:exec
mixin, to support executing tools in a separate process without forking - IMPROVED:
long_desc
directive can now read the description from a text file. - IMPROVED: The
tool
directive can take delimited strings as tool names. - IMPROVED: Subtool blocks aren't actually executed unless the tool is needed.
- CHANGED: Added
on_missing
andon_conflict
arguments toToys::Utils::Gems
constructor (which also affects the:gems
mixin), and deprecatedsuppress_confirm
anddefault_confirm
.
Internal interface changes:
- ADDED:
Toys::Tool#subtool_middleware_stack
allowing a tool to modify the middleware stack for its subtools. - ADDED: The
Toys::Middleware::Stack
class represents a stack of middleware specs, and distinguishes the default set from those added afterward. - ADDED:
Toys.executable_path
attribute allowing an executable to provide the executable for running tools separately. - ADDED:
Toys::CLI
now has alogger_factory
property, to generate separate loggers per tool execution. - ADDED:
Toys::CLI
andToys::Loader
now let you set:lib_dir_name
. - IMPROVED: Toys-core no longer has a general dependency on rubygems. (Parts that do depend on rubygems, such as the
:gems
mixin, do an explicitrequire "rubygems"
.) This makes it possible to write an executable withruby --disable=gems
which improves startup time. - IMPROVED: Middleware objects no longer have to respond to all middleware methods. If a method is not implemented, it is simply considered a nop.
- IMPROVED:
Toys::Utils::Terminal
is now thread-safe. - CHANGED:
Toys::Utils::Terminal#styled
is no longer mutable. - CHANGED:
Toys::Tool#middleware_stack
renamed toToys::Tool#built_middleware
to clarify that it is an array of middleware objects rather than specs. - CHANGED:
Toys::CLI.default_logger
removed and replaced withToys::CLI.default_logger_factory
. In general, global loggers for CLI are now discouraged because they are not thread-safe. - CHANGED:
Toys::Loader
uses an internal monitor rather than includingMonitorMixin
.
v0.9.4 / 2020-01-26
- FIXED: Crash in the loader when a non-ruby file appears in a toys directory
v0.9.3 / 2020-01-05
- FIXED:
delegate_to
directive could crash if an overriding tool has already been defined. - FIXED: A Ruby 2.7 warning when reporting a Toys file syntax error.
v0.9.2 / 2020-01-03
- IMPROVED: Mixins can now take real keyword arguments, and will pass them on properly to
on_initialize
andon_include
blocks. - CHANGED:
Toys::Utils::Exec
and the:exec
mixin methods now take real keyword arguments rather than anopts
hash. This means you should use keywords (or the double-splat operator) to avoid a deprecation warning on Ruby 2.7. - IMPROVED:
Toys::CLI#clone
can be passed keyword arguments to modify the configuration. - IMPROVED:
Toys::Loader
is now thread-safe. This means it is now possible for a singleToys::CLI
to run multiple tools in different threads. - IMPROVED: There is now a class for middleware specs, making possible a nicer syntax for building a middleware stack.
v0.9.1 / 2019-12-22
- IMPROVED:
delegate_to
andalias_tool
can take symbols as well as strings.
v0.9.0 / 2019-12-02
Functional changes:
- ADDED: The
delegate_to
directive causes the tool to delegate execution to another tool. This means it takes the same arguments and has the same execution behavior. - ADDED: The
delegate_to
argument to thetool
directive causes the tool to delegate to another tool. (Note: thealias_tool
directive is now just shorthand for creating a tool with a delegate, and as such is mildly deprecated.) - ADDED: The
current_tool
function can be called from the DSL to get the currentToys::Tool
object. - ADDED: The
:e
option is now an alias for:exit_on_nonzero_status
. - IMPROVED:
alias_tool
is now just shorthand for delegating. This means, aliases can now point to namespaces and will resolve subtools of their targets, and they now support tab completion and online help. - IMPROVED: This release of Toys is now compatible with Ruby 2.7.0-preview3. It fixes some Ruby 2.7 specific bugs, and sanitizes keyword argument usage to eliminate Ruby 2.7 warnings.
- IMPROVED: JRuby is now supported for most operations. However, JRuby is generally not recommended because of JVM boot latency, lack of Kernel#fork support, and other issues.
- FIXED: The
tool
directive no longer crashes if no block is provided.
Internal interface changes:
- REMOVED: The
Toys::Alias
class has been removed, along with relevant functionality inToys::Loader
includingToys::Loader#make_alias
. Use tool delegation instead. - CHANGED: Positional arguments to middleware specs must now be wrapped in an array.
- CHANGED: The
Toys::ArgParser
constructor takes adefault_data
argument instead ofverbosity
. - CHANGED: Version constant is now
Toys::Core::VERSION
. - CHNAGED: The
flag
argument toToys::Flag::DefaultCompletion#initialize
is now a required keyword argument. - ADDED:
Toys::Tool#delegate_to
causes the tool to delegate to another tool. - ADDED: The
Toys::Context::Key::DELEGATED_FROM
key provides the delegating context, if any.
v0.8.1 / 2019-11-19
- FIXED: Listing subtools would crash if a broken alias was present.
- DOCUMENTATION: Switched from redcarpet to kramdown, and tried to make some structural fixes.
v0.8.0 / 2019-06-20
This is a major update with significant new features and a bunch of fixes. It also includes a significant amount of internal reorganization and cleanup, some of which resulted in backward incompatible changes. Basic use should not be affected. All signifiant features planned for beta are now implemented.
Major changes and features:
- CHANGED: Relicensed under the MIT License.
- CHANGED: Requires Ruby 2.3 or later.
- ADDED: Tab completion for bash. Added APIs and DSL constructs for tools to customize completions.
- ADDED: The usage error screen displays suggestions when an argument is misspelled. (Requires Ruby 2.4 or later.)
- ADDED: Tools can provide an interrupt handler and a custom usage error handler. Added appropriate APIs and DSL methods.
- ADDED: Tools can enforce that flags must be given before positional args, and can control whether partial flags are accepted.
Other notable changes:
- ADDED: Flag handlers can accept the symbolic names
:set
and:push
for common cases. - ADDED: Function and range based acceptors.
- ADDED: The
acceptor
directive takes an optionaltype_desc
argument. - ADDED: The
accept
directives under flag and positional arg blocks in the DSL can now take blocks andtype_desc
values. - ADDED: Context keys
UNMATCHED_ARGS
,UNMATCHED_POSITIONAL
, andUNMATCHED_FLAGS
that provide arguments that were not handled during arg parsing. - ADDED: The Exec util and mixin support specifying a callback for process results.
- ADDED: The Exec util and mixin provide a way to identify processes by name.
- CHANGED: Implemented custom argument parsing and custom implementations of the standard OptionParser acceptors, rather than relying on OptionParser itself. For the most part, OptionParser behavior is preserved, except in cases where there is clearly a bug.
- CHANGED: Flags create a short form flag by default if the name has one character.
- CHANGED: Flags with explicit value-less syntax are no longer given a value if they specify a default or an acceptor.
- CHANGED: Renamed the
TOOL_DEFINITION
context key toTOOL
, and removed thetool_definition
convenience method. - CHANGED: Removed the
BINARY_NAME
andLOADER
context keys, and removed the corresponding convenience methods. Get these values from the CLI if needed. - CHANGED: Renamed the
USAGE_ERROR
context key toUSAGE_ERRORS
, and the corresponding convenience method tousage_errors
. The value is now a (possibly empty) array ofToys::ArgParser::UsageError
objects rather than a string that isn't machine-parseable. - CHANGED: The help middleware no longer defines remaining_args on the root tool.
- CHANGED: Renamed
to_expand
toon_expand
in template definitions. - CHANGED: Renamed
to_initialize
toon_initialize
, andto_include
toon_include
in mixin definitions. - CHANGED: The CLI options
preload_directory_name
anddata_directory_name
renamed topreload_dir_name
anddata_dir_name
. - CHANGED: Default descriptions for flag groups is now handled by the
set_default_descriptions
middleware rather than hard-coded in FlagGroup. - CHANGED: Exec reports failure to start processes in the result object rather than, e.g. raising ENOENT.
- IMPROVED: Default error handler no longer displays a stack trace if a tool is interrupted.
- IMPROVED: Error messages for flag groups are more complete.
- IMPROVED: All context data, including well-known data, is available to be modified by flags and args.
- FIXED: Flags with optional values are properly set to
true
(rather than left atnil
) if no value is provided. - FIXED: Acceptors no longer raise errors when run on missing optional values.
- FIXED: When reporting errors in toys files, the line number was off by 2.
- FIXED: The
--usage
help flag now honors--all
and--no-recursive
. - FIXED: The terminal now handles nil streams, as advertised.
Changes to internal interfaces:
- General changes:
- CHANGED: Renamed
Toys::Tool
toToys::Context
, and theKeys
submodule toKey
. - CHANGED: Moved the
ModuleLookup
andWrappableString
out of theUtils
module to be located directly underToys
. Other modules remain underUtils
. The remaining files under "toys/utils" must now be required explicitly. This directory is now specifically for modules that are not part of the "core" interface. - CHANGED: All the classes under
Toys::Definition
are now located directly underToys
. For example,Toys::Definition::Tool
is nowToys::Tool
. - CHANGED: Generally removed the term "definition" from interfaces. For example, an accessor method called
tool_definition
is now just calledtool
. - CHANGED: Renamed
Toys::DSL::Arg
toToys::DSL::PositionalArg
- CHANGED: Removed
Toys::Runner
and folded its functionality intoToys::CLI
. - CHANGED: The fallback execution feature of the show_help middleware is implemented by catching an exception afterward rather than detecting non-runnable up front. This lets us remove the second copy of show_help from the middleware stack.
- ADDED: Functionality dependent on Ruby version is kept in
Toys::Compat
.
- CHANGED: Renamed
- Changes related to the tool classes:
- CHANGED: Moved
Toys::Definition::Tool
toToys::Tool
. - CHANGED: Removed the term "definition" from accessors. Specifically
flag_definitions
renamed toflags
,required_arg_definitions
renamed torequired_args
,optional_arg_definitions
renamed tooptional_args
,remaining_args_definition
renamed toremaining_arg
, andarg_definitions
renamed topositional_args
. - CHANGED: Renamed
Tool#runnable=
toTool#run_handler=
. - CHANGED:
Tool#add_acceptor
takes the name as a separate argument, for consistency withadd_mixin
andadd_template
. - CHANGED: Removed
Tool#custom_acceptors
method. - CHANGED: Removed
Tool#resolve_acceptor
and replaced withlookup_acceptor
which only looks up names. - CHANGED: Renamed
Tool#resolve_mixin
tolookup_mixin
andTool#resolve_template
tolookup_template
. - ADDED: Added
resolve_flag
method to look up flags by syntax. - ADDED: Accessor for interrupt handler.
- ADDED:
enforce_flags_before_args
setting andflags_before_args_enforced?
query. - ADDED: Completion accessor, and options to the various flag and positional arg methods to set their completion strategies.
- ADDED: Added
Tool::DefaultCompletion
class. - IMPROVED:
add_mixin
,add_template
, andadd_acceptor
support all the specs understood by their create methods.
- CHANGED: Moved
- Changes related to the flag classes:
- CHANGED: Moved
Toys::Definition::Flag
toToys::Flag
- CHANGED:
FlagSyntax
is nowFlag::Syntax
. - CHANGED:
Flag::Syntax#flag_style
now has values:short
and:long
instead of"-"
and"--"
. - CHANGED:
Flag#single_flag_syntax
renamed toFlag#short_flag_syntax
, andFlag#double_flag_syntax
renamed toFlag#long_flag_syntax
. - CHANGED: Renamed
Flag#accept
toFlag#acceptor
which now always returns an acceptor object (even for well-known acceptors such asInteger
). - CHANGED: Removed
Flag#optparser_info
and replaced withFlag#canonical_syntax_strings
. - ADDED:
Flag#create
class method providing a sane construction interface. - ADDED:
Flag#resolve
method to look up flag syntax. - ADDED:
Flag#completion
field. - ADDED: Added
Flag::Resolution
andFlag::DefaultCompletion
classes.
- CHANGED: Moved
- Changes related to the positional arg classes:
- CHANGED: Moved
Toys::Definition::Arg
toToys::PositionalArg
. - CHANGED: Renamed
Arg#accept
toPositionalArg#acceptor
which now always returns an acceptor object (even for well-known acceptors such asInteger
). - ADDED:
PositionalArg#create
class method providing a sane construction interface. - ADDED:
PositionalArg#completion
field
- CHANGED: Moved
- Changes related to the flag group classes:
- CHANGED: Moved
Toys::Definition::FlagGroup
toToys::FlagGroup
- CHANGED: The base class is now
FlagGroup::Base
instead ofFlagGroup
itself. - ADDED:
FlagGroup#create
class method providing a sane construction interface.
- CHANGED: Moved
- Changes related to acceptors:
- CHANGED: Moved
Toys::Definition::Acceptor
toToys::Acceptor
- CHANGED: The base ciass is now
Acceptor::Base
instead ofAcceptor
itself. - CHANGED: Subclasses are now submodules under
Acceptor
. For example, movedToys::Definition::PatternAcceptor
toToys::Acceptor::Pattern
. - CHANGED: Replaced
name
field with separatetype_desc
andwell_known_spec
fields. - CHANGED: The base class no longer takes a conversion proc. It is always a no-op.
Acceptor::Pattern
, however, does take a converter so it can continue to handle custom OptionParser acceptors. - ADDED: Acceptors may define
suggestions
which returns results from did-you-mean. - ADDED: Simple acceptor (
Acceptor::Simple
) which uses a single function to validate and convert input. - ADDED: Range acceptor (
Acceptor::Range
) which validates against a range. - ADDED: Class methods
Acceptor.create
andAcceptor.lookup_well_known
.
- CHANGED: Moved
v0.7.0 / 2019-01-23
- ADDED: Flag groups, which enforce policies around which flags are required.
- CHANGED: Flags within a group are sorted in help screens.
- CHANGED: Canonical flag within a flag definition is now the first rather than the last.
v0.6.1 / 2019-01-07
- FIXED: The presence of aliases caused subtool listing to crash.
v0.6.0 / 2018-10-22
- CHANGED: Replaced Toys::Definition::DataFinder with Toys::Definition::SourceInfo.
- CHANGED: Removed Toys::Definition#find_data. Use Toys::Definition#source_info and call find_data.
- ADDED: Context directory is kept in SourceInfo and available in the DSL and the tool runtime.
- IMPROVED: Optionally omit hidden subtools (i.e. names beginning with underscore) from subtool lists.
- IMPROVED: Optionally omit non-runnable namespaces from recursive subtool lists.
v0.5.0 / 2018-10-07
- FIXED: Template instantiation was failing if the hosting tool was priority-masked.
- ADDED: Several additional characters can optionally be used as tool path delimiters.
- ADDED: Support for preloaded files and directories
- ADDED: Support for data directories
- ADDED: Ability to display just the list of subtools of a tool
- IMPROVED: The tool directive can now take an array as the tool name.
- IMPROVED: The tool directive can now take an
if_defined
argument.
v0.4.5 / 2018-08-05
- CHANGED: Dropped preload file feature
v0.4.4 / 2018-07-21
- FIXED: Utils::Exec wasn't closing streams after copying.
- IMPROVED: Utils::Exec::Controller can capture or redirect the remainder of a controlled stream.
- ADDED: Terminal#ask
v0.4.3 / 2018-07-13
- IMPROVED: Utils::Exec methods can now spawn subprocesses in the background
- IMPROVED: Utils::Exec capture methods can now yield a controller
v0.4.2 / 2018-07-08
- FIXED: Raise an error rather than cause unexpected behavior if a mixin is included twice.
- IMPROVED: The
include?
method extended to support mixin names in a tool dsl.
v0.4.1 / 2018-07-03
- FIXED: Terminal#confirm uppercased "N" for the wrong default.
v0.4.0 / 2018-07-03
Now declaring this alpha quality. Backward-incompatible changes are still possible from this point, but I'll try to avoid them.
- CHANGED: Utils::Terminal#confirm default is now unset by default
- CHANGED: Moved gem install/activation methods into a mixin
- IMPROVED: Toys::Utils::Gems can suppress the confirmation prompt
- IMPROVED: Magic comments are now honored in toys files.
- IMPROVED: Utils::Gems installation is now much faster.
- FIXED: Utils::Gems didn't reset the specifications on Ruby 2.3.
v0.3.11 / 2018-07-02
- CHANGED: Require Ruby 2.3 or later
- CHANGED: Renamed "set" directive to "static" to reduce confusion with Tool#set.
- ADDED: Convenience methods for getting option values
v0.3.10 / 2018-06-30
- CHANGED: Dropped Tool#option. Use Tool#get instead.
- CHANGED: "run" directive renamed to "to_run"
- CHANGED: Highline mixin now uses Highline 2.0
- CHANGED: Middleware-added keys no longer show up in the options hash
- ADDED: Mixins can provide initializers
- ADDED: Loader can load an inline block
v0.3.9.1 / 2018-06-24
- FIXED: Built-in flags were interfering with disable_argument_parsing
v0.3.9 / 2018-06-24
- CHANGED: Cli#add_search_path_hierarchy changed the behavior of the base/terminate param
- CHANGED: Removed alias_as directive since it's incompatible with selective loading.
- ADDED: Ability to define named templates in Toys files
- ADDED: Ability to disable argument parsing
- ADDED: Exec#exec_proc and Exec#exec_tool that supports all the stream redirects
- IMPROVED: Acceptors can be looked up recursively in the same way as mixins and templates
v0.3.8 / 2018-06-10
- CHANGED: Renamed helpers to mixins.
- CHANGED: ModuleLookup is now a customizable class and can have multiple sources.
- CHANGED: Moved the existing templates to the toys gem since they are rake replacements.
- CHANGED: Renamed :in_from, :out_to, and :err_to exec options to :in, :out, :err
- ADDED: CLI can now customize the standard mixins, templates, and middleware.
- IMPROVED: Exec raises an error if passed an unknown option.
- IMPROVED: Exec now accepts nearly all the same stream specifications as Process#spawn.
v0.3.7.1 / 2018-05-30
- No changes.
v0.3.7 / 2018-05-30
- CHANGED: Execution runs in the same scope as the DSL, which lets us use normal methods instead of helper-blocks.
- CHANGED: Renamed "script" to "run", and allow setting of runnable by defining a "run" method
- CHANGED: Set up a constant scope for each config file, to make constant lookup make sense.
- CHANGED: Removed run_toys and dropped EXIT_ON_NONZERO_STATUS key in favor of using cli directly.
- CHANGED: Renamed definition_path to source_path
- CHANGED: LineOutput util changed to a simple Terminal util, and folded spinner into it.
- CHANGED: Removed spinner helper and added terminal helper.
- CHANGED: Organized DSL and definition classes
- ADDED: Helper modules scoped to the tool hierarchy
- ADDED: Utility that installs and activates third-party gems.
v0.3.6 / 2018-05-21
- CHANGED: Renamed show_version middleware to show_root_version.
- CHANGED: Reworked set_default_descriptions interface for more flexibility.
- CHANGED: Renamed Utils::Exec#config_defaults to configure_defaults to match the helper.
- CHANGED: Removed Context#new_cli and exposed Context#cli instead.
- CHANGED: Renamed CLI#empty_clone to CLI#child.
- IMPROVED: show_help middleware lets you control display of the source path section.
- IMPROVED: Optional parameters are now supported for flags.
- IMPROVED: Support custom acceptors.
- IMPROVED: Highline helper automatically sets use_color based on the type of stdout.
v0.3.5 / 2018-05-15
- CHANGED: Exec logic now lives in a utils class.
- CHANGED: Moved flag and arg blocks from Tool into the DSL.
- CHANGED: Renamed
execute do
toscript do
, and Tool#executor to Tool#script. - IMPROVED: Help display can use
less
if available.
v0.3.4 / 2018-05-14
- CHANGED: Renamed switch to flag
- CHANGED: Renamed Utils::Usage to Utils::HelpText
- CHANGED: Renamed show_usage middleware to show_help and default everything false.
- CHANGED: Renamed docs: parameter again, to desc: and long_desc: to match tool desc.
- CHANGED: Middleware config method takes a loader as the second arg
- CHANGED: desc is now a single string rather than an array.
- CHANGED: Removed Loader#execute, and returned remaining args from Loader#lookup.
- CHANGED: Wrapped most errors with Toys::ContextualError
- CHANGED: accept: parameter now controls whether a switch takes a value by default
- CHANGED: Explicit and implicit show-help now handled by separate middleware instances
- CHANGED: All description strings are now wrappable
- IMPROVED: gem_build template can suppress interactive confirmation.
- IMPROVED: Logger colors the header when possible.
- IMPROVED: HelpText class can now generate nicer help pages
- IMPROVED: Style support for spinner helper
- IMPROVED: Set default descriptions for flags and args
- ADDED: CLI now takes an error handler to report most errors.
- ADDED: Alias DSL methods
required
,optional
, andremaining
. - FIXED: Finish definitions for subtools since the desc may depend on it
v0.3.3 / 2018-05-09
- CHANGED: Renamed file_utils helper to fileutils.
- CHANGED: Renamed
doc:
parameter todocs:
. - CHANGED: SwitchDefinition has separate fields for acceptor and docs.
- CHANGED: Description and long description are now arrays of strings.
- FIXED: Documentation strings that begin with "--" no longer cause problems.
- ADDED: Highline helper
- ADDED: Spinner helper
- ADDED: WrappableString for descriptions and docs
- IMPROVED: Usage can now customize the left column width and indent
- IMPROVED: Newlines in documentation are properly indented
v0.3.2 / 2018-05-07
- CHANGED: Split core engine out into "toys-core" from the "toys" gem.
- CHANGED: Renamed path types to "search" and "config" paths, and restricted the former to the CLI.
- CHANGED: Removed aliasing from the Tool interface and reimplemented in the Loader.
- CHANGED: Default descriptions are now set via a middleware rather than in the Tool.
- CHANGED: Renamed most of the middleware classes.
- CHANGED: Combined usage-displaying middleware.
- CHANGED: Standard paths logic moved from CLI to StandardCLI.
- ADDED: Middleware that responds to the "--version" switch.
- ADDED: Context#new_cli that lets you run sub-instances of toys.
- IMPROVED: Middleware can now be referenced by class and constructed implicitly.
- IMPROVED: Usage error handler can now have its exit code configured.
- IMPROVED: Help and verbosity middlewares can have their switches configured.
- IMPROVED: Help middleware can search for keywords in subcommands.
- IMPROVED: Help middleware displays the config path in verbose mode.
- IMPROVED: Context::EXIT_ON_NONZERO_STATUS controls Context#run behavior.
- DOCS: Expanded middleware documentation
- INTERNAL: Removed Context::Base and just used CLI as base context