summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/package.rb
diff options
context:
space:
mode:
authorChi-Fung Fan <[email protected]>2017-05-05 17:59:19 +0800
committerChi-Fung Fan <[email protected]>2017-05-05 17:59:19 +0800
commitcdb719673351e10a3ce13b2a5deb151822593c27 (patch)
tree15a334837dfa4b592d835ef765ed039bd7dd1183 /lib/axlsx/package.rb
parentc8ac844572b25fda358cc01d2104720c4c42f450 (diff)
downloadcaxlsx-cdb719673351e10a3ce13b2a5deb151822593c27.tar.gz
caxlsx-cdb719673351e10a3ce13b2a5deb151822593c27.zip
Sort archive entries for correct MIME detection
Diffstat (limited to 'lib/axlsx/package.rb')
-rw-r--r--lib/axlsx/package.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index 8a4f29dc..5b5ea14a 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -1,4 +1,4 @@
-# encoding: UTF-8
+# encoding: utf-8
module Axlsx
# Package is responsible for managing all the bits and peices that Open Office XML requires to make a valid
# xlsx document including valdation and serialization.
@@ -253,7 +253,9 @@ module Axlsx
parts << {:entry => "xl/#{sheet.rels_pn}", :doc => sheet.relationships, :schema => RELS_XSD}
parts << {:entry => "xl/#{sheet.pn}", :doc => sheet, :schema => SML_XSD}
end
- parts
+
+ # Sort parts for correct MIME detection
+ parts.sort_by { |part| part[:entry] }
end
# Performs xsd validation for a signle document