class SiSU_XML_ODF_ODT::Source::Output
Public Class Methods
new(content,md,env)
click to toggle source
# File lib/sisu/xml_odf_odt.rb, line 827 def initialize(content,md,env) @content,@md,@env=content,md,env end
Public Instance Methods
odf()
click to toggle source
# File lib/sisu/xml_odf_odt.rb, line 830 def odf #%odf output env=SiSU_Env::FileOp.new(@md) env.mkdir header=SiSU_XML_ODF_ODT_Format::ODT_Head_1_2.new(@md) filename="#{@env.processing_path.odt}/manifest.rdf" od=File.new(filename,'w+') od << header.manifest_rdf od.close filename="#{@env.processing_path.odt}/META-INF/manifest.xml" od=File.new(filename,'w+') od << header.meta_inf_manifest_xml(@md) od.close filename="#{@env.processing_path.odt}/meta.xml" od=File.new(filename,'w+') od << header.meta_xml od.close filename="#{@env.processing_path.odt}/settings.xml" od=File.new(filename,'w+') od << header.settings_xml od.close filename="#{@env.processing_path.odt}/styles.xml" od=File.new(filename,'w+') od << header.styles_xml od.close filename="#{@env.processing_path.odt}/mimetype" od=File.new(filename,'w+') od << header.mimetype od.close env.make_path(@env.processing_path.odt) env.make_path(@md.file.output_path.odt.dir) filename="#{@env.processing_path.odt}/content.xml" od=File.new(filename,'w+') @content.compact.each do |para| # this is a hack od.puts para unless para =~/\A\s*\Z/ end od.close opendoc=@md.file.base_filename.odt #watch where output by language FileUtils::mkdir_p(@md.file.output_path.odt.dir) \ unless FileTest.directory?(@md.file.output_path.odt.dir) if FileTest.directory?(@env.processing_path.odt) \ and SiSU_Env::SystemCall.new.zip pwd=Dir.pwd Dir.chdir(@env.processing_path.odt) system(" zip -qr #{opendoc} * ") FileUtils::mv(opendoc, @md.file.place_file.odt.dir) Dir.chdir(pwd) else SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).mark('*EXITED odf* zip program not found') unless SiSU_Env::SystemCall.new.zip end end