instance method Pathname#each_entry

each_entry {|pathname| ... } -> nil[permalink][rdoc][edit]

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。



require "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>

[SEE_ALSO] Dir.foreach