Sha256: 4dd5094b530ee3219349bc3e60f1eaae01273fc17901acd24fa5eee1243dc47e
Contents?: true
Size: 689 Bytes
Versions: 26
Compression:
Stored size: 689 Bytes
Contents
module SOPT def self.setup(str) parts = str.split(/\n\n+/) summary = parts.shift unless parts.first =~ /^\s*\$-/ synopsys = parts.shift if parts.first =~ /^\s*\$/ description = [] while parts.first and parts.first !~ /^\s*-/ description << parts.shift end description = description * "\n\n" options = parts.collect{|part| part.split("\n").select{|l| l=~ /^\s*-/ } }.flatten.compact * "\n" synopsys.sub!(/^\$\s+/,'') if synopsys SOPT.summary = summary.strip if summary SOPT.synopsys = synopsys.strip if synopsys SOPT.description = description.strip if description SOPT.parse options if options SOPT.consume end end
Version data entries
26 entries across 26 versions & 2 rubygems