diff options
Diffstat (limited to 'jni/ruby/tool/probes_to_wiki.rb')
-rw-r--r-- | jni/ruby/tool/probes_to_wiki.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jni/ruby/tool/probes_to_wiki.rb b/jni/ruby/tool/probes_to_wiki.rb new file mode 100644 index 0000000..ba8204c --- /dev/null +++ b/jni/ruby/tool/probes_to_wiki.rb @@ -0,0 +1,16 @@ +### +# Converts the probes.d file to redmine wiki format. Usage: +# +# ruby tool/probes_to_wiki.rb probes.d + +File.read(ARGV[0]).scan(/\/\*.*?\*\//m).grep(/ruby/) do |comment| + comment.gsub!(/^(\/\*|[ ]*)|\*\/$/, '').strip! + puts + comment.each_line.with_index do |line, i| + if i == 0 + puts "=== #{line.chomp}" + else + puts line.gsub(/`([^`]*)`/, '(({\1}))') + end + end +end |