1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-07-11 01:46:40 +00:00
parent e2a17dad48
commit 9e2fc969e2
2 changed files with 8 additions and 3 deletions

View file

@ -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).

View file

@ -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