[前][次][番号順一覧][スレッド一覧]

ruby-changes:29860

From: nobu <ko1@a...>
Date: Thu, 11 Jul 2013 10:46:51 +0900 (JST)
Subject: [ruby-changes:29860] nobu:r41912 (trunk): probes_to_wiki.rb: fix comment and reduce unnecessary array

nobu	2013-07-11 10:46:40 +0900 (Thu, 11 Jul 2013)

  New Revision: 41912

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=41912

  Log:
    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.

  Modified files:
    trunk/ChangeLog
    trunk/tool/probes_to_wiki.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41911)
+++ ChangeLog	(revision 41912)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 11 10:46:38 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* process.c (rb_daemon): daemon(3) is implemented with fork(2).
Index: tool/probes_to_wiki.rb
===================================================================
--- tool/probes_to_wiki.rb	(revision 41911)
+++ tool/probes_to_wiki.rb	(revision 41912)
@@ -1,12 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/tool/probes_to_wiki.rb#L1
 ###
 # 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]