Method: Path#each_entry
- Defined in:
- lib/path/dir.rb
#each_entry {|entry| ... } ⇒ Object
Deprecated.
Use #each_child instead. This method is deprecated since it is too low level and likely useless in Ruby. But it is there for the sake of compatibility with Dir.foreach and Pathname#each_entry.
Iterates over the entries (files and subdirectories) in the directory.
Path("/usr/local").each_entry { |entry| p entry } # =>
#<Path .>
#<Path ..>
#<Path lib>
#<Path share>
# ...
44 45 46 |
# File 'lib/path/dir.rb', line 44 def each_entry(&block) Dir.foreach(@path) { |f| yield Path.new(f) } end |