Skip to content

Commit

Permalink
Merge pull request #104 from WaKeMaTTa/patch-1
Browse files Browse the repository at this point in the history
Use `Zip::File#glob` to match any `document.xml`
  • Loading branch information
satoryu authored May 5, 2021
2 parents c65ef03 + 940dd93 commit ff957f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/docx/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ def initialize(path_or_io, options = {})
@zip = Zip::File.open_buffer(path_or_io)
end

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

@document_xml = document.get_input_stream.read
Expand Down

0 comments on commit ff957f0

Please sign in to comment.