From c62f8376a13e7a4f493167aba1c66a9201fc59c6 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Wed, 26 Nov 2025 19:02:28 -0500 Subject: New upstream version 3.0.0. --- lib/roo/excelx.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/roo/excelx.rb') diff --git a/lib/roo/excelx.rb b/lib/roo/excelx.rb index 91ebc1e..14a6b4f 100755 --- a/lib/roo/excelx.rb +++ b/lib/roo/excelx.rb @@ -333,7 +333,7 @@ module Roo wb = entries.find { |e| e.name[/workbook.xml$/] } fail ArgumentError 'missing required workbook file' if wb.nil? - wb.extract(path) + wb.extract(File.basename(path), destination_directory: File.dirname(path)) workbook_doc = Roo::Utils.load_xml(path).remove_namespaces! workbook_doc.xpath('//sheet').map { |s| s['id'] } end @@ -357,7 +357,7 @@ module Roo wb_rels = entries.find { |e| e.name[/workbook.xml.rels$/] } fail ArgumentError 'missing required workbook file' if wb_rels.nil? - wb_rels.extract(path) + wb_rels.extract(File.basename(path), destination_directory: File.dirname(path)) rels_doc = Roo::Utils.load_xml(path).remove_namespaces! relationships = rels_doc.xpath('//Relationship').select do |relationship| @@ -378,7 +378,7 @@ module Roo path = "#{tmpdir}/roo_sheet#{i + 1}" sheet_files << path @sheet_files << path - entry.extract(path) + entry.extract(File.basename(path), destination_directory: File.dirname(path)) end end @@ -387,7 +387,7 @@ module Roo img_entries.each do |entry| path = "#{@tmpdir}/roo#{entry.name.gsub(/xl\/|\//, "_")}" image_files << path - entry.extract(path) + entry.extract(File.basename(path), destination_directory: File.dirname(path)) end end @@ -402,7 +402,7 @@ module Roo zip_file.read_from_stream zipfilename_or_stream end - process_zipfile_entries zip_file.to_a.sort_by(&:name) + process_zipfile_entries zip_file.entries.sort_by(&:name) end def process_zipfile_entries(entries) @@ -462,7 +462,7 @@ module Roo image_rels[nr - 1] = "#{@tmpdir}/roo_image_rels#{nr}" end - entry.extract(path) if path + entry.extract(File.basename(path), destination_directory: File.dirname(path)) if path end end -- cgit v1.2.3