lib/roo/excelx.rb in roo-1.13.0 vs lib/roo/excelx.rb in roo-1.13.1

- old
+ new

@@ -97,19 +97,13 @@ @style_definitions = Array.new # TODO: ??? { |h,k| h[k] = {} } if File.exist?(File.join(tmpdir, 'roo_styles.xml')) @styles_doc = load_xml(File.join(tmpdir, 'roo_styles.xml')) read_styles(@styles_doc) end - @sheet_doc = @sheet_files.compact.map do |item| - load_xml(item) - end - @comments_doc = @comments_files.compact.map do |item| - load_xml(item) - end - @rels_doc = @rels_files.map do |item| - load_xml(item) - end + @sheet_doc = load_xmls(@sheet_files) + @comments_doc = load_xmls(@comments_files) + @rels_doc = load_xmls(@rels_files) end super(filename, options) @formula = Hash.new @excelx_type = Hash.new @excelx_value = Hash.new @@ -344,9 +338,15 @@ [] end end private + + def load_xmls(paths) + paths.compact.map do |item| + load_xml(item) + end + end # helper function to set the internal representation of cells def set_cell_values(sheet,x,y,i,v,value_type,formula, excelx_type=nil, excelx_value=nil,