From 9e2fc969e2086acbf6ad6866e66f6debb9870c2a Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Jul 2013 01:46:40 +0000 Subject: 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 --- tool/probes_to_wiki.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tool/probes_to_wiki.rb') 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 -- cgit v1.2.1