Class: Cukehead::FreemindWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/cukehead/freemind_writer.rb

Instance Method Summary collapse

Instance Method Details

#add_newline_after_tags(xml) ⇒ Object



5
6
7
8
9
# File 'lib/cukehead/freemind_writer.rb', line 5

def add_newline_after_tags(xml)
  t = ""
  xml.each_char {|c| c == ">" ? t << c + "\n" : t << c}
  return t
end

#write_mm(filename, mmxml) ⇒ Object



12
13
14
15
16
17
# File 'lib/cukehead/freemind_writer.rb', line 12

def write_mm(filename, mmxml)
  s = add_newline_after_tags mmxml
  File.open(filename, 'w') do |f|
    f.write(s)
  end
end