Sha256: 560328a40d9db551b2c1396fd4f0db99f49e5f6a3b474a190e110fad06d03031
Contents?: true
Size: 755 Bytes
Versions: 45
Compression:
Stored size: 755 Bytes
Contents
#!/usr/bin/env ruby args=ARGV args=["-h"] if args.empty? input,mode,master=false,:process,true require 'optparse' $VERBOSE = nil OptionParser.new do |opts| opts.banner = "Usage: dyn-scan [options]" opts.on( '-p', '--pretty', 'pretty method' ) do mode=:pretty end opts.on( '-i', '--input', 'input line' ) do input=true end opts.on( '-x', '--extract', 'extract method' ) do mode=:extract end end.parse!(args) require 'dyndoc/base/scanner' scan=Dyndoc::DevTagScanner.new(:dtag) b=(input ? args[0] : File.read(args[0]) ) b="{#document][#main]"+b+"[#}" if master scan.tokenize(b) case mode when :extract p scan.extract when :pretty scan.pretty_print(scan.parse_text(scan.extract)) when :process p scan.process(b) end
Version data entries
45 entries across 45 versions & 1 rubygems