diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | tool/probes_to_wiki.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Thu Jul 11 10:46:38 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * tool/probes_to_wiki.rb: fix usage comment. use Enumerable#grep + which yields each elements to reduce unnecessary array. + Thu Jul 11 10:09:18 2013 NARUSE, Yui <naruse@ruby-lang.org> * process.c (rb_daemon): daemon(3) is implemented with fork(2). 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 |