Module: TapOut
- Defined in:
- lib/tapout.rb,
lib/tapout/version.rb,
lib/tapout/tapy_parser.rb,
lib/tapout/tap_legacy_parser.rb,
lib/tapout/reporters/abstract.rb,
lib/tapout/tap_legacy_adapter.rb,
lib/tapout/reporters/breakdown.rb,
lib/tapout/reporters/progressbar.rb
Defined Under Namespace
Modules: Reporters Classes: Curmudgeon, TAPLegacyAdapter, TAPLegacyParser, TAPYParser
Constant Summary collapse
- PARSERS =
%w{breakdown dotprogress progressbar tap verbose}
- VERSION =
"1.0.0"
- TAP_Y_VERSION =
"1"
Class Method Summary collapse
Class Method Details
.cli(*argv) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/tapout.rb', line 12 def self.cli(*argv) = {} type = :modern parser = OptionParser.new do |opt| opt. = "tapout [options] [format]" opt.separator("\nOPTIONS:") #opt.on('--format', '-f FORMAT', 'Report format') do |fmt| # options[:format] = fmt #end #opt.on('-t', '--tap', 'Consume legacy TAP input') do |fmt| # type = :legacy #end opt.on('--no-color', 'Supress ANSI color codes') do # TODO end opt.on('--debug', 'Run with $DEBUG flag on') do |fmt| $DEBUG = true end opt.separator("\nFORMATS:\n " + PARSERS.join("\n ")) end parser.parse!(argv) [:format] = argv.first # TODO: would be nice if it could automatically determine which #c = $stdin.getc # $stdin.pos = 0 #type = :legacy if c =~ /\d/ #type = :modern if c == '-' stdin = Curmudgeon.new($stdin) case stdin.line1 when /^\d/ type = :legacy when /^\-/ type = :modern else raise "Not a recognized TAP stream!" end case type when :legacy stream_parser = TAPLegacyParser.new() stream_parser.consume(stdin) else stream_parser = TAPYParser.new() stream_parser.consume(stdin) end end |