diff options
| author | ytjmt <[email protected]> | 2022-04-07 23:20:05 +0900 |
|---|---|---|
| committer | ytjmt <[email protected]> | 2022-04-07 23:20:05 +0900 |
| commit | b6617ef71ef9980951f7eb30955ac73b7231e3a5 (patch) | |
| tree | 1fa205edb4b3c30ec9fd56e5b4badc3773021a75 /lib/axlsx/package.rb | |
| parent | 09c8f3fdd5d62918d59951697107b3b58ad24fb2 (diff) | |
| download | caxlsx-b6617ef71ef9980951f7eb30955ac73b7231e3a5.tar.gz caxlsx-b6617ef71ef9980951f7eb30955ac73b7231e3a5.zip | |
Sort archive entries for correct MIME detection with file command
Diffstat (limited to 'lib/axlsx/package.rb')
| -rw-r--r-- | lib/axlsx/package.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index 1b30c815..2faec2e3 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -206,12 +206,10 @@ module Axlsx # @private def parts parts = [ - {:entry => RELS_PN, :doc => relationships, :schema => RELS_XSD}, {:entry => "xl/#{STYLES_PN}", :doc => workbook.styles, :schema => SML_XSD}, {:entry => CORE_PN, :doc => @core, :schema => CORE_XSD}, {:entry => APP_PN, :doc => @app, :schema => APP_XSD}, {:entry => WORKBOOK_RELS_PN, :doc => workbook.relationships, :schema => RELS_XSD}, - {:entry => CONTENT_TYPES_PN, :doc => content_types, :schema => CONTENT_TYPES_XSD}, {:entry => WORKBOOK_PN, :doc => workbook, :schema => SML_XSD} ] @@ -256,7 +254,11 @@ module Axlsx end # Sort parts for correct MIME detection - parts.sort_by { |part| part[:entry] } + [ + {:entry => CONTENT_TYPES_PN, :doc => content_types, :schema => CONTENT_TYPES_XSD}, + {:entry => RELS_PN, :doc => relationships, :schema => RELS_XSD}, + *(parts.sort_by { |part| part[:entry] }.reverse) + ] end # Performs xsd validation for a signle document |
