lib/write_xlsx/package/app.rb in write_xlsx-0.72.2 vs lib/write_xlsx/package/app.rb in write_xlsx-0.72.3.beta1

- old
+ new

@@ -18,26 +18,25 @@ def set_xml_writer(filename) @writer.set_xml_writer(filename) end def assemble_xml_file - write_xml_declaration - write_properties do - write_application - write_doc_security - write_scale_crop - write_heading_pairs - write_titles_of_parts - write_manager - write_company - write_links_up_to_date - write_shared_doc - write_hyperlinks_changed - write_app_version + write_xml_declaration do + write_properties do + write_application + write_doc_security + write_scale_crop + write_heading_pairs + write_titles_of_parts + write_manager + write_company + write_links_up_to_date + write_shared_doc + write_hyperlinks_changed + write_app_version + end end - @writer.crlf - @writer.close end def add_part_name(part_name) @part_names.push(part_name) end @@ -55,24 +54,20 @@ @properties = properties end private - def write_xml_declaration - @writer.xml_decl - end - # # Write the <Properties> element. # def write_properties tag = 'Properties' schema = 'http://schemas.openxmlformats.org/officeDocument/2006/' attributes = [ - 'xmlns', "#{schema}extended-properties", - 'xmlns:vt', "#{schema}docPropsVTypes" + ['xmlns', "#{schema}extended-properties"], + ['xmlns:vt', "#{schema}docPropsVTypes"] ] @writer.tag_elements('Properties', attributes) { yield } end @@ -125,11 +120,11 @@ # # Write the <vt:vector> element. # def write_vt_vector(base_type, data) attributes = [ - 'size', data.size, - 'baseType', base_type + ['size', data.size], + ['baseType', base_type] ] @writer.tag_elements('vt:vector', attributes) do data.each do |a| if base_type == 'variant'