From c1785306e1dd5b771126aa469594d54c6fdc55e9 Mon Sep 17 00:00:00 2001 From: mame Date: Tue, 23 Sep 2008 00:03:42 +0000 Subject: * lib/pathname.rb (each_filename): return Enumerator if no block given. * test/pathname/test_pathname.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/pathname.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/pathname.rb') diff --git a/lib/pathname.rb b/lib/pathname.rb index 45974545a..1bc0063bb 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -517,6 +517,7 @@ class Pathname # # yields "usr", "bin", and "ruby". # def each_filename # :yield: filename + return to_enum(__method__) unless block_given? prefix, names = split_names(@path) names.each {|filename| yield filename } nil -- cgit