A summary of data about the Ruby ecosystem.

https://github.com/CocoaPods/CLAide

A small command-line interface framework.
https://github.com/CocoaPods/CLAide

Keywords from Contributors

cocoapods dependency-manager mac objective-c deployment ci fastlane screenshots apps activerecord

Last synced: about 13 hours ago
JSON representation

Repository metadata

A small command-line interface framework.

README.md

Hi, I’m Claide, your command-line tool aide.

Build Status
Gem Version

I was born out of a need for a simple option and command parser, while still
providing an API that allows you to quickly create a full featured command-line
interface.

Install

$ [sudo] gem install claide

Usage

For full documentation, on the API of CLAide, visit rubydoc.info.

Argument handling

At its core, a library, such as myself, needs to parse the parameters specified
by the user.

Working with parameters is done through the CLAide::ARGV class. It takes an
array of parameters and parses them as either flags, options, or arguments.

Parameter Description
--milk, --no-milk A boolean ‘flag’, which may be negated.
--sweetener=honey An ‘option’ consists of a key, a ‘=’, and a value.
tea An ‘argument’ is just a value.

Accessing flags, options, and arguments, with the following methods, will also
remove the parameter from the remaining unprocessed parameters.

argv = CLAide::ARGV.new(['tea', '--no-milk', '--sweetener=honey'])
argv.shift_argument      # => 'tea'
argv.shift_argument      # => nil
argv.flag?('milk')       # => false
argv.flag?('milk')       # => nil
argv.option('sweetener') # => 'honey'
argv.option('sweetener') # => nil

In case the requested flag or option is not present, nil is returned. You can
specify a default value to be used as the optional second method parameter:

argv = CLAide::ARGV.new(['tea'])
argv.flag?('milk', true)         # => true
argv.option('sweetener', 'sugar') # => 'sugar'

Unlike flags and options, accessing all of the arguments can be done in either
a preserving or mutating way:

argv = CLAide::ARGV.new(['tea', 'coffee'])
argv.arguments  # => ['tea', 'coffee']
argv.arguments! # => ['tea', 'coffee']
argv.arguments  # => []

Command handling

Commands are actions that a tool can perform. Every command is represented by
its own command class.

Commands may be nested, in which case they inherit from the ‘super command’
class. Some of these nested commands may not actually perform any work
themselves, but are rather used as ‘super commands’ only, in which case they
are ‘abtract commands’.

Running commands is typically done through the CLAide::Command.run(argv)
method, which performs the following three steps:

  1. Parses the given parameters, finds the command class matching the parameters,
    and instantiates it with the remaining parameters. It’s each nested command
    class’ responsibility to remove the parameters it handles from the remaining
    parameters, before calling the super implementation.

  2. Asks the command instance to validate its parameters, but only after
    calling the super implementation. The super implementation will show a
    help banner in case the --help flag is specified, not all parameters were
    removed from the parameter list, or the command is an abstract command.

  3. Calls the run method on the command instance, where it may do its work.

  4. Catches any uncaught exception and shows it to user in a meaningful way.

    • A Help exception triggers a help banner to be shown for the command.
    • A exception that includes the InformativeError module will show only
      the message, unless disabled with the --verbose flag; and in red,
      depending on the color configuration.
    • Any other type of exception will be passed to Command.report_error(error)
      for custom error reporting (such as the one in CocoaPods).

In case you want to call commands from inside other commands, you should use
the CLAide::Command.parse(argv) method to retrieve an instance of the command
and call run on it. Unless you are using user-supplied parameters, there
should not be a need to validate the parameters.

See the example for a illustration of how to define commands.


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: about 20 hours ago

Total Commits: 392
Total Committers: 21
Avg Commits per committer: 18.667
Development Distribution Score (DDS): 0.587

Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0

Name Email Commits
Fabio Pelosin f****n@g****m 162
Eloy Durán e****e@g****m 96
Samuel Giddins s****s@s****e 58
Olivier Halligon o****r@h****t 23
Marius Rackwitz g****t@m****e 12
Dimitris Koutsogiorgas d****o@g****m 7
Danielle Tomlinson d****n@t****o 6
Kyle Fuller i****x@k****k 5
Olle Jonsson o****n@g****m 4
Bas Broek b****s@b****l 2
Clément Beffa s****p@b****g 2
Eric Amorde e****e@g****m 2
Les Hill l****l@g****m 2
Nicolas Leger n****r 2
Orta o****x@g****m 2
dependabot[bot] 4****] 2
Olivier Halligon o****n@n****r 1
David Grandinetti d****i@y****m 1
David Rodríguez d****z@r****t 1
Kerri Miller k****r@k****m 1
bootstraponline c****e@b****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 3 months ago

Total issues: 45
Total pull requests: 53
Average time to close issues: 4 months
Average time to close pull requests: 2 months
Total issue authors: 16
Total pull request authors: 22
Average comments per issue: 5.18
Average comments per pull request: 3.42
Merged pull request: 36
Bot issues: 0
Bot pull requests: 5

Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/CocoaPods/CLAide

Top Issue Authors

  • fabiopelosin (18)
  • segiddins (4)
  • jcampbell05 (3)
  • alloy (3)
  • AliSoftware (3)
  • bootstraponline (2)
  • mrackwitz (2)
  • kylef (2)
  • keith (1)
  • orta (1)
  • luqyluqe (1)
  • longv2go (1)
  • mikehardy (1)
  • LONGDDSF (1)
  • Kasotot12 (1)

Top Pull Request Authors

  • segiddins (16)
  • fabiopelosin (6)
  • dependabot[bot] (5)
  • dnkoutso (3)
  • leshill (2)
  • bootstraponline (2)
  • maclover7 (2)
  • olleolleolle (2)
  • GO-Institute (2)
  • endocrimes (2)
  • amorde (1)
  • neonichu (1)
  • deivid-rodriguez (1)
  • orta (1)
  • KrauseFx (1)

Top Issue Labels

  • t1:enhancement (15)
  • d1:easy (13)
  • s1:awaiting input (7)
  • s2:confirmed (6)
  • t3:discussion (6)
  • d2:moderate (4)
  • s4:awaiting validation (3)
  • s3:detailed (2)
  • t2:defect (1)

Top Pull Request Labels

  • dependencies (5)
  • t1:enhancement (1)
  • s4:awaiting validation (1)
  • d2:moderate (1)

Package metadata

gem.coop: claide

A small command-line interface framework.

  • Homepage: https://github.com/CocoaPods/CLAide
  • Documentation: http://www.rubydoc.info/gems/claide/
  • Licenses: MIT
  • Latest release: 1.1.0 (published almost 4 years ago)
  • Last Synced: 2026-01-06T06:16:33.636Z (1 day ago)
  • Versions: 25
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 217,135,801 Total
  • Docker Downloads: 478,139,799
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.082%
    • Downloads: 0.114%
    • Docker downloads count: 0.215%
  • Maintainers (9)
rubygems.org: claide

A small command-line interface framework.

  • Homepage: https://github.com/CocoaPods/CLAide
  • Documentation: http://www.rubydoc.info/gems/claide/
  • Licenses: MIT
  • Latest release: 1.1.0 (published almost 4 years ago)
  • Last Synced: 2026-01-05T08:25:35.788Z (2 days ago)
  • Versions: 25
  • Dependent Packages: 85
  • Dependent Repositories: 38,676
  • Downloads: 217,013,812 Total
  • Docker Downloads: 478,139,799
  • Rankings:
    • Downloads: 0.122%
    • Dependent repos count: 0.167%
    • Docker downloads count: 0.309%
    • Dependent packages count: 0.367%
    • Average: 1.599%
    • Stargazers count: 4.061%
    • Forks count: 4.566%
  • Maintainers (9)

Dependencies

Gemfile rubygems
  • bacon >= 0 development
  • colored >= 0 development
  • json < 3 development
  • kicker >= 0 development
  • mocha-on-bacon >= 0 development
  • parallel <= 1.19.2 development
  • prettybacon >= 0 development
  • rubocop <= 0.81.0 development
  • rubocop-performance <= 1.5.2 development
  • simplecov >= 0 development
  • rake >= 0
Gemfile.lock rubygems
  • ast 2.4.2
  • bacon 1.2.0
  • claide 1.1.0
  • colored 1.2
  • docile 1.1.5
  • ffi 1.14.2
  • jaro_winkler 1.5.4
  • json 2.5.1
  • kicker 3.0.0
  • listen 1.3.1
  • metaclass 0.0.4
  • mocha 1.1.0
  • mocha-on-bacon 0.2.2
  • multi_json 1.10.1
  • notify 0.5.2
  • parallel 1.19.2
  • parser 3.1.0.0
  • prettybacon 0.0.2
  • rainbow 3.0.0
  • rake 10.3.2
  • rb-fsevent 0.9.4
  • rb-inotify 0.9.5
  • rb-kqueue 0.2.3
  • rexml 3.2.5
  • rubocop 0.81.0
  • rubocop-performance 1.5.2
  • ruby-progressbar 1.11.0
  • simplecov 0.9.1
  • simplecov-html 0.8.0
  • unicode-display_width 1.8.0

Score: 29.380633449638772