Skip to content

Commit ff957f0

Browse files
authored
Merge pull request #104 from WaKeMaTTa/patch-1
Use `Zip::File#glob` to match any `document.xml`
2 parents c65ef03 + 940dd93 commit ff957f0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/docx/document.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ def initialize(path_or_io, options = {})
3030
@zip = Zip::File.open_buffer(path_or_io)
3131
end
3232

33-
document = @zip.find_entry('word/document.xml')
34-
document ||= @zip.find_entry('word/document2.xml')
33+
document = @zip.glob('word/document*.xml').first
3534
raise Errno::ENOENT if document.nil?
3635

3736
@document_xml = document.get_input_stream.read

0 commit comments

Comments
 (0)