Method: IsoDoc::Function::ToWordHtml#init_file

Defined in:
lib/isodoc/function/to_word_html.rb

#init_file(filename, debug) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/isodoc/function/to_word_html.rb', line 19

def init_file(filename, debug)
  filepath = Pathname.new(filename)
  filename = filepath.sub_ext('').to_s
  dir = "#{filename}_files"
  unless debug
    Dir.mkdir(dir) unless File.exists?(dir)
    FileUtils.rm_rf "#{dir}/*"
  end
  @filename = filename
  @localdir = filepath.parent.to_s + '/'
  [filename, dir]
end