command_mapper.rb

Maps external commands and options to Ruby classes

MIT License

Downloads
103.5K
Stars
54
Committers
1

Bot releases are hidden (Show)

command_mapper.rb - 0.3.2 Latest Release

Published by postmodern 9 months ago

  • Switch to use require_relative to improve load-times.
  • Allow passing sudo specific keyword arguments in
    CommandMapper::Command#sudo_command to CommandMapper::Sudo.run.
  • Allow CommandMapper::Sudo's preserve_env attribute to accept an optional
    value.
command_mapper.rb - 0.3.1

Published by postmodern 9 months ago

  • Use File.exist? in CommandMapper::Types::InputPath#validate for Ruby 3.2.0.
command_mapper.rb - 0.3.0

Published by postmodern 9 months ago

  • Added CommandMapper::Types::Dec.
command_mapper.rb - 0.2.1

Published by postmodern 9 months ago

  • Properly validate in CommandMapper::OptionValue#validate when an option,
    who's value is not required, is given true.
  • Omit nil arguments from CommandMapper::Command#command_argv if the
    argument is not required.
  • Improve validation error message for CommandMapper::Types::Num when
    initialized with a range: value.
  • Improve validation error message for CommandMapper::Types::Map and
    CommandMapper::Types::Enum.
command_mapper.rb -

Published by postmodern 9 months ago

  • Added CommandMapper::Command.spawn and CommandMapper::Command#spawn_command.
  • Added checks to CommandMapper::Command.option, CommandMapper::Command.argument, and
    CommandMapper::Command.subcommand to avoid overwriting an existing option/argument/subcommand
    with the same name.
  • Added the value_in_flag: keyword argument to
    CommandMapper::Command.option which indicates an option's value
    should be appended to the flag (ex: -Fvalue).
  • Added the range: keyword argument to CommandMapper::Types::Num#initialize
    for specifying the acceptable range of numbers.
  • Allow options with equals: true (aka --opt=...) or value_in_flag: true
    (aka -Fvalue) to accept values that start with a - character.
command_mapper.rb - 0.1.2

Published by postmodern 9 months ago

  • Fixed a bug where CommandMapper::Command.command_name was not checking the
    superclass for the command_name, if no command "..." was defined in the subclass.
command_mapper.rb - 0.1.1

Published by postmodern 9 months ago

  • Fixed a bug where CommandMapper::Types::Num, CommandMapper::Types::Hex,
    CommandMapper::Types::Enum, CommandMapper::Types::InputPath,
    CommandMapper::Types::InputFil, and CommandMapper::Types::InputDir were
    not being required by default.
  • Allow CommandMapper::Types::Map to accept values that have already been
    mapped to a String.
command_mapper.rb - 0.1.0

Published by postmodern 9 months ago

  • Initial release:
    • Added CommandMapper::Error.
    • Added CommandMapper::ValidationError.
    • Added CommandMapper::ArgumentRequired.
    • Added CommandMapper::Types::Type.
    • Added CommandMapper::Types::Str.
    • Added CommandMapper::Types::Num.
    • Added CommandMapper::Types::Hex.
    • Added CommandMapper::Types::Map.
    • Added CommandMapper::Types::Enum.
    • Added CommandMapper::Types::InputPath.
    • Added CommandMapper::Types::InputFile.
    • Added CommandMapper::Types::InputDir.
    • Added CommandMapper::Types::List.
    • Added CommandMapper::Types::KeyValue.
    • Added CommandMapper::Types::KeyValueList.
    • Added CommandMapper::Arg.
    • Added CommandMapper::Argument.
    • Added CommandMapper::OptionValue.
    • Added CommandMapper::Option.
    • Added CommandMapper::Command.
    • Added CommandMapper::Sudo.
Package Rankings
Top 8.63% on Rubygems.org
Badges
Extracted from project README
CI Code Climate Gem Version