diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/find.rb | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Jun 11 03:40:37 2008 Akinori MUSHA <[email protected]> + + * lib/find.rb (Find#find): Return an enumerator if no block is + given. + Wed Jun 11 01:28:12 2008 Koichi Sasada <[email protected]> * include/ruby/intern.h, proc.c: revert rb_proc_call() and diff --git a/lib/find.rb b/lib/find.rb index 06ac9e2c0c..79ff7c1378 100644 --- a/lib/find.rb +++ b/lib/find.rb @@ -33,6 +33,8 @@ module Find # See the +Find+ module documentation for an example. # def find(*paths) # :yield: path + block_given? or return enum_for(__method__, *paths) + paths.collect!{|d| raise Errno::ENOENT unless File.exist?(d); d.dup} while file = paths.shift catch(:prune) do |