summaryrefslogtreecommitdiff
path: root/tool/probes_to_wiki.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 18:22:52 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-10 18:22:52 +0000
commit4580394abbf78cdb1869100b0df61c7613d8669f (patch)
tree8156a5d0976dd9f3da525fa23680758d331b407b /tool/probes_to_wiki.rb
parentcd224452812ca4523d0f1933f1c0f3cf422426d7 (diff)
* tool/probes_to_wiki.rb: adding a script to convert probes.d to wiki
format for easy wiki updates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/probes_to_wiki.rb')
-rw-r--r--tool/probes_to_wiki.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/probes_to_wiki.rb b/tool/probes_to_wiki.rb
new file mode 100644
index 0000000..75b263a
--- /dev/null
+++ b/tool/probes_to_wiki.rb
@@ -0,0 +1,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