summaryrefslogtreecommitdiff
path: root/tool/probes_to_wiki.rb
blob: 75b263aaaff896c54048698e5066fb294265159f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
###
# Converts the probes.d file to redmine wiki format. Usage:
#
#   ruby probes.d

File.read(ARGV[0]).scan(/\/\*.*?\*\//m).grep(/ruby/).each do |comment|
  comment.gsub!(/^(\/\*|[ ]*)|\*\/$/, '').strip!
  puts
  comment.each_line.each_with_index do |line, i|
    if i == 0
      puts "=== #{line.chomp}"
    else
      puts line.gsub(/`([^`]*)`/, '(({\1}))')
    end
  end
end