2016-07-13 9 views
0

버전 1.2.0을 사용하여 ZipFsDir 개체에서 glob을 호출하려고하면 이상한 결과가 나타납니다. 레일 콘솔에서 :rubyzip Zip :: FileSystem :: ZipFsDir glob 메서드가 손상 되었습니까?

> require 'zip/filesystem' 
=> true 
> file = '/home/me/test.zip' 
=> "/home/me/test.zip" 
> zf = Zip::File.open file 
=> #<Zip::File:0x0000000880e0c8... 
> d = zf.dir 
=> #<Zip::FileSystem::ZipFsDir:0x0000000880e028 
> d.class 
=> Zip::FileSystem::ZipFsDir 
> d.glob("*.shp") 
NoMethodError: undefined method `glob' for #<Zip::FileSystem::ZipFileNameMapper:0x0000000880e078> 

Zip::FileSystem::ZipFileNameMapper에 대해 정의 된 메서드가보고되지 않는 이유는 무엇입니까? 나는 ZipFsDir 개체에서 그것을 호출했다. 문서에서는 globZipFsDir instance method으로 명확하게 표시합니다.

답변

1

ZipFileNameMapperin it's source처럼 실제로 glob 메서드를 구현하지 않습니다.

이 성명에 따르면

ZipFsFile 및 ZipFsDir에서 우편 번호 :: 파일에 대한 모든 액세스가 ZipFileNameMapper 통과

ZipFileNameMapper은 그래서이 보이는하지 않습니다 glob를 구현해야합니다 가능한 버그.