# File lib/zip/zipfilesystem.rb, line 463 def foreach(aDirectoryName) unless @file.stat(aDirectoryName).directory? raise Errno::ENOTDIR, aDirectoryName end path = @file.expand_path(aDirectoryName).ensure_end("/") subDirEntriesRegex = Regexp.new("^#{path}([^/]+)$") @mappedZip.each { |fileName| match = subDirEntriesRegex.match(fileName) yield(match[1]) unless match == nil } end