Categories: None [Edit]

baf

https://rubygems.org/gems/baf
== Baf baf helps writing an user acceptance test suite with a dedicated library and cucumber steps. It can run and wait for programs in a modified environment, verify the exit status, the output streams and other side effects. It also supports interactive programs and writing to their standard input. Then, it provides a DSL to write the CLI: require 'baf/cli' module MyProgram class CLI < Baf::CLI def setup flag_version '0.1.2'.freeze option :c, :config, 'config', 'specify config file' do |path| @config_path = path end end def run usage! unless arguments.any? puts 'arguments: %s' % arguments puts 'config: %s' % @config_path if @config_path end end end MyProgram::CLI.run ARGV Which behaves this way: % ./my_program Usage: my_program [options] options: -c, --config config specify config file -h, --help print this message -V, --version print version zsh: exit 64 ./my_program % ./my_program --wrong-arg Usage: my_program [options] options: -c, --config config specify config file -h, --help print this message -V, --version print version zsh: exit 64 ./my_program --wrong-arg % ./my_program foo arguments ["foo"] % ./my_program -c some_file foo arguments ["foo"] config path some_file

Total

Ranking: 25,349 of 186,954
Downloads: 54,514

Daily

Ranking: 28,148 of 186,947
Downloads: 11

Depended by

RankDownloadsName
13,438155,976producer-core
28,97244,947uh-wm
81,87010,712mmve

Depends on

RankDownloadsName
101,139,617,007rake
27914,083,740rspec
48791,420,047cucumber

Owners

#GravatarHandle
1icontjouan