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

ruby-changes:25520

From: knu <ko1@a...>
Date: Fri, 9 Nov 2012 15:28:08 +0900 (JST)
Subject: [ruby-changes:25520] knu:r37577 (trunk): Add back my original example of Shellwords#shellescape.

knu	2012-11-09 15:28:00 +0900 (Fri, 09 Nov 2012)

  New Revision: 37577

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

  Log:
    Add back my original example of Shellwords#shellescape.
    
    * lib/shellwords.rb (Shellwords#shellescape): Add back my original
      real world example with some enhancement.

  Modified files:
    trunk/ChangeLog
    trunk/lib/shellwords.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37576)
+++ ChangeLog	(revision 37577)
@@ -1,6 +1,9 @@
-Fri Nov  9 15:13:16 2012  Akinori MUSHA  <knu@i...>
+Fri Nov  9 15:25:42 2012  Akinori MUSHA  <knu@i...>
 
-	* lib/shellwords.rb (Shellwords#shellescape): Undo part of the
+	* lib/shellwords.rb (Shellwords#shellescape): Add back my original
+	  real world example with some enhancement.
+
+	* lib/shellwords.rb (Shellwords#shelljoin): Undo part of the
 	  previous rdoc change.  This new example using a string-only
 	  array was not in line with the description.
 
Index: lib/shellwords.rb
===================================================================
--- lib/shellwords.rb	(revision 37576)
+++ lib/shellwords.rb	(revision 37577)
@@ -105,6 +105,15 @@
   #   argv = "It's better to give than to receive".shellescape
   #   argv #=> "It\\'s\\ better\\ to\\ give\\ than\\ to\\ receive"
   #
+  #   # Search files in lib for method definitions
+  #   pattern = "^[ \t]*def "
+  #   open("| grep -Ern #{pattern.shellescape} lib") { |grep|
+  #     grep.each_line { |line|
+  #       file, lineno, matched_line = line.split(':', 3)
+  #       # ...
+  #     }
+  #   }
+  #
   # It is the caller's responsibility to encode the string in the right
   # encoding for the shell environment where this string is used.
   #

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

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