class Zip::FileSystem::ZipFsDir
def foreach(directory_name)
def foreach(directory_name) unless @file.stat(directory_name).directory? raise Errno::ENOTDIR, directory_name end path = @file.expand_path(directory_name) path << '/' unless path.end_with?('/') path = Regexp.escape(path) subdir_entry_regex = Regexp.new("^#{path}([^/]+)$") @mapped_zip.each do |filename| match = subdir_entry_regex.match(filename) yield(match[1]) unless match.nil? end end