Class: OdtReplacer

Inherits:
Processor show all
Defined in:
lib/notroff/odt_replacer.rb

Instance Method Summary collapse

Constructor Details

#initialize(output_path) ⇒ OdtReplacer

Returns a new instance of OdtReplacer.



9
10
11
# File 'lib/notroff/odt_replacer.rb', line 9

def initialize( output_path )
  @output_path = output_path
end

Instance Method Details

#process(new_content) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/notroff/odt_replacer.rb', line 13

def process( new_content )
  FileUtils.cp( SKEL, @output_path )

  Zip::ZipFile.open( @output_path ) do |zipfile|
    zipfile.file.open("content.xml", "w") do |content|
      content.print( new_content )
    end
  end
end