Actions
Bug #2037
closed[PATCH] Alias Dir#path to Dir#to_path
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-09-03 trunk 24741) [i686-linu
Backport:
Description
=begin
The Dir class does not have a #to_path method. This means that although it calls #to_path on arguments it expects to be directories, its instances cannot be used as such arguments. The File class has #to_path as an alias for #path.
The attached trivial patch simply adds an alias for Dir#path named Dir#to_path.
Before:
Dir.entries(Dir.new('/tmp')).size
TypeError: can't convert Dir into String
from (irb):2:inopen' from (irb):2:in
entries'
from (irb):2
from /usr/local/bin/irb:12:in `'
After:
Dir.entries(Dir.new('/tmp')).size
=> 245
=end
Files
Updated by matz (Yukihiro Matsumoto) over 14 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r24744.
=end
Actions
Like0
Like0