aboutsummaryrefslogtreecommitdiffstats
path: root/tool/probes_to_wiki.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-11 01:46:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-11 01:46:40 +0000
commit9e2fc969e2086acbf6ad6866e66f6debb9870c2a (patch)
tree01f1a424083e2e23315be89ec714fdc9151dc694 /tool/probes_to_wiki.rb
parente2a17dad48d286ecd04f7b9da59fd85f31011a44 (diff)
downloadruby-9e2fc969e2086acbf6ad6866e66f6debb9870c2a.tar.gz
probes_to_wiki.rb: fix comment and reduce unnecessary array
* tool/probes_to_wiki.rb: fix usage comment. use Enumerable#grep which yields each elements to reduce unnecessary array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/probes_to_wiki.rb')
-rw-r--r--tool/probes_to_wiki.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/tool/probes_to_wiki.rb b/tool/probes_to_wiki.rb
index 75b263aaaf..ba8204c188 100644
--- a/tool/probes_to_wiki.rb
+++ b/tool/probes_to_wiki.rb
@@ -1,12 +1,12 @@
###
# Converts the probes.d file to redmine wiki format. Usage:
#
-# ruby probes.d
+# ruby tool/probes_to_wiki.rb probes.d
-File.read(ARGV[0]).scan(/\/\*.*?\*\//m).grep(/ruby/).each do |comment|
+File.read(ARGV[0]).scan(/\/\*.*?\*\//m).grep(/ruby/) do |comment|
comment.gsub!(/^(\/\*|[ ]*)|\*\/$/, '').strip!
puts
- comment.each_line.each_with_index do |line, i|
+ comment.each_line.with_index do |line, i|
if i == 0
puts "=== #{line.chomp}"
else