- more docgen

This commit is contained in:
Jordan Sissel 2011-04-07 00:06:58 -07:00
parent 01d1d594c1
commit 06a353fc87
2 changed files with 2 additions and 31 deletions

View file

@ -1,5 +1,7 @@
require "rubygems"
$: << File.join(File.dirname(__FILE__), "..", "lib")
class LogStashConfigDocGenerator
COMMENT_RE = /^ *#(.*)/

View file

@ -1,31 +0,0 @@
class LogStashConfigDocGenerator
COMMENT_RE = /^ *#(.*)/
RULES = {
COMMENT_RE => lambda { |m| add_comment(m[1]) },
/^ *config .*/ => lambda { |m| add_config(m[0]) },
}
def parse(string)
buffer = ""
string.split("\n").each do |line|
if line =~ COMMENT_RE
# nothing
else
# Join extended lines
if line =~ /(, *$)|(\\$)/
buffer += line.gsub(/\\$/, "")
next
end
end
p line
end
end
end
if __FILE__ == $0
gen = LogStashConfigDocGenerator.new
gen.parse(File.new(ARGV[0]).read)
end