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

ruby-changes:9369

From: matz <ko1@a...>
Date: Mon, 22 Dec 2008 11:35:52 +0900 (JST)
Subject: [ruby-changes:9369] Ruby:r20907 (trunk): * lib/rake.rb (Rake::FileList#egrep): change open mode to "rb",

matz	2008-12-22 11:35:37 +0900 (Mon, 22 Dec 2008)

  New Revision: 20907

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

  Log:
    * lib/rake.rb (Rake::FileList#egrep): change open mode to "rb",
      i.e. default to binary.    [ruby-dev:37385]
    * lib/rake.rb (Rake::FileList#egrep): allow specifying reading
      encoding, e.g. FileList['*.rb'].egrep(/require/, encoding:
      "ascii-8bit")

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 20906)
+++ ChangeLog	(revision 20907)
@@ -51,6 +51,15 @@
 	* win32/win32.c (has_redirection): supports environment variables
 	  references.
 
+Sat Dec 20 15:34:36 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* lib/rake.rb (Rake::FileList#egrep): change open mode to "rb",
+	  i.e. default to binary.    [ruby-dev:37385]
+
+	* lib/rake.rb (Rake::FileList#egrep): allow specifying reading
+	  encoding, e.g. FileList['*.rb'].egrep(/require/, encoding:
+	  "ascii-8bit")
+
 Sat Dec 20 10:59:16 2008  Yuki Sonoda (Yugui)  <yugui@y...>
 
 	* lib/irb/locale.rb (IRB::Locale#initialize)
Index: lib/rake.rb
===================================================================
--- lib/rake.rb	(revision 20906)
+++ lib/rake.rb	(revision 20907)
@@ -1477,9 +1477,9 @@
     # name, line number, and the matching line of text.  If no block is given,
     # a standard emac style file:linenumber:line message will be printed to
     # standard out.
-    def egrep(pattern)
+    def egrep(pattern, *opt)
       each do |fn|
-        open(fn) do |inf|
+        open(fn, "rb", *opt) do |inf|
           count = 0
           inf.each do |line|
             count += 1

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

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