diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-22 02:35:37 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-22 02:35:37 +0000 |
| commit | c36a200a5da0562dff9f194268f9f784ea708ab2 (patch) | |
| tree | 4d0e5a1762123420b8dfa1ac31cd2a660e827765 | |
| parent | 5871cfa0566d14cc88f249d202d12096863bed3d (diff) | |
| download | ruby-c36a200a5da0562dff9f194268f9f784ea708ab2.tar.gz ruby-c36a200a5da0562dff9f194268f9f784ea708ab2.tar.xz ruby-c36a200a5da0562dff9f194268f9f784ea708ab2.zip | |
* 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")
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20907 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 9 | ||||
| -rwxr-xr-x | lib/rake.rb | 4 |
2 files changed, 11 insertions, 2 deletions
@@ -51,6 +51,15 @@ Sat Dec 20 18:28:26 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> * win32/win32.c (has_redirection): supports environment variables references. +Sat Dec 20 15:34:36 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * 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@yugui.jp> * lib/irb/locale.rb (IRB::Locale#initialize) diff --git a/lib/rake.rb b/lib/rake.rb index 480068be7..63412b153 100755 --- a/lib/rake.rb +++ b/lib/rake.rb @@ -1477,9 +1477,9 @@ module Rake # 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 |
