module Yorgi::Utils

Public Instance Methods

headlines() click to toggle source
# File lib/yorgi/utils.rb, line 12
def headlines
  filepath = File.join Settings.org_file
  file = File.read filepath
  parser = Orgmode::Parser.new(file)
  parser.headlines.map(&:to_s).join("\n")
end
write(file, text) click to toggle source
# File lib/yorgi/utils.rb, line 5
def write(file, text)
  f = File.open(file, "a")
  f.puts(text)
ensure
  f.close
end