我应该使用哪些Ruby库来构建基于控制台的应用程序?

5

我想使用Ruby构建一个基于控制台的应用程序,我快速搜索并发现下面所有这些库。请有经验的人建议我应该使用哪一个。谢谢。

  • OptionParser (http://ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html)
  • Thor (https://github.com/wycats/thor)
  • Rubikon (http://koraktor.de/rubikon/)
  • Trollop (http://trollop.rubyforge.org/)
  • Clamp (https://github.com/mdub/clamp)
  • Choice (http://choice.rubyforge.org/)
  • Methadone (https://github.com/davetron5000/methadone)
  • GLI (https://github.com/davetron5000/gli)
  • Commander (http://rdoc.info/github/visionmedia/commander/master/frames)
  • Main (https://github.com/ahoward/main)
  • CLAP (https://github.com/soveran/clap)
  • Optiflag (http://optiflag.rubyforge.org/)
  • Hirb (http://tagaholic.me/hirb/)
  • Boson (http://tagaholic.me/2009/10/14/boson-command-your-ruby-universe.html)

3
您能描述一下您的应用程序所需的具体功能吗?每个库都有其适用的场景。例如,如果您想要接受许多不同的命令行参数和选项,则OptionParser非常适合此类情况。如果您需要快速着色输出或使用默认选项进行简单输入,则highline是一个很好的库。如果您不知道应用程序将要做什么,那么现在决定实现还为时过早。 - Ben Taitelbaum
2
甲基多巴胺或托尔是迄今为止最酷的名字。由于您不想分享应用程序需要做什么,除了推荐一个酷名字外,没有人能做太多事情。 - Marc Talbot
Configliere(https://github.com/infochimps-platform/configliere)可以从多个来源管理设置:静态常量、简单的配置文件、环境变量、命令行选项和纯Ruby代码。 - zhon
1个回答

2

1
这是 CLI 选项解析器列表的直接链接:https://www.ruby-toolbox.com/categories/CLI_Option_Parsers - Kirk

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接