From fcbf63e62c627deae76c1b8cb8c0876c536ed811 Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 16 Mar 2020 18:49:26 +0900 Subject: Fresh start --- jni/ruby/tool/probes_to_wiki.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 jni/ruby/tool/probes_to_wiki.rb (limited to 'jni/ruby/tool/probes_to_wiki.rb') 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 -- cgit v1.2.3