8000 When globbing in ZipFSDir, take CWD into account. · rubyzip/rubyzip@aa6284d · GitHub
[go: up one dir, main page]

Skip to content

Commit aa6284d

Browse files
committed
When globbing in ZipFSDir, take CWD into account.
1 parent 1673da7 commit aa6284d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/zip/filesystem.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ def get_output_stream(fileName, permissionInt = nil, &aProc)
573573
@zipFile.get_output_stream(expand_to_entry(fileName), permissionInt, &aProc)
574574
end
575575

576-
def glob(*args, &block)
577-
@zipFile.glob(*args, &block)
576+
def glob(pattern, *flags, &block)
577+
@zipFile.glob(expand_to_entry(pattern), *flags, &block)
578578
end
579579

580580
def read(fileName)

test/filesystem/directory_test.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ def test_glob
109109
zf.dir.glob('globTest/foo/**/*.txt') do |f|
110110
assert_equal globbed_files[0], f.name
111111
end
112+
113+
zf.dir.chdir('globTest/foo')
114+
zf.dir.glob('**/*.txt') do |f|
115+
assert_equal globbed_files[0], f.name
116+
end
112117
end
113118
end
114119

0 commit comments

Comments
 (0)
0