Skip to content

Corrupted output file on v 0.10 #168

@glampr

Description

@glampr

Describe the bug

The saved file is corrupted on the latest version (0.10) but works on (0.9).
Suspecting the change of the RubyZip 2.3 -> RubyZip 3.0 dependency but did not investigate further.

To Reproduce

Open a valid word docx document and immediately save it. Try to open the file with TextEdit on Mac.

example

# Open /path/to/your/docx/file.docx with TextEdit on MacOS, to make sure the file is valid.

require 'docx'

doc = Docx::Document.new('/path/to/your/docx/file.docx')
doc.save 

# Then try to open /path/to/your/docx/file.docx with TextEdit on MacOS.

Sample docx file

Even a blank new document will do.

blank.docx

Expected behavior

After saving the new file should open with TextEdit as before.

Environment

  • Ruby version: 3.4.2
  • docx gem version: regression from 0.9.0 (works) -> 0.10.0 (does not work)
  • OS: MacOS Tahoe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions