lib/fakefs/pathname.rb
def each_filename # :yield: filename
      return to_enum(__method__) unless block_given?
      _prefix, names = split_names(@path)
      names.each { |filename| yield filename }
      nil
    end
def each_filename # :yield: filename
      return to_enum(__method__) unless block_given?
      _prefix, names = split_names(@path)
      names.each { |filename| yield filename }
      nil
    end
Iterates over each component of the path.

   Pathname.new("/usr/bin/ruby").each_filename { |filename| ... }
     # yields "usr", "bin", and "ruby".