mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merges r20907 from trunk into ruby_1_9_1.
* 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: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
863882ea3e
commit
b15ca506d2
2 changed files with 11 additions and 2 deletions
|
@ -1,3 +1,12 @@
|
|||
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")
|
||||
|
||||
Mon Dec 22 10:59:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (rb_str_upto): should return enumerator if called
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue