class Ever2boost::CsonGenerator

Public Class Methods

build(folder_hash, note) click to toggle source
# File lib/ever2boost/cson_generator.rb, line 6
      def build(folder_hash, note)
        cson = <<-EOS
type: "MARKDOWN_NOTE"
folder: "#{folder_hash}"
title: "#{note.title}"
content: '''
  # #{note.title}
  #{note.md_content}
'''
tags: []
isStarred: false
createdAt: "#{timestamp}"
updatedAt: "#{timestamp}"
        EOS
      end
output(folder_hash, note, output_dir) click to toggle source
# File lib/ever2boost/cson_generator.rb, line 26
def output(folder_hash, note, output_dir)
  Util.make_notes_dir(output_dir)
  File.open("#{output_dir}/notes/#{note.file_name}.cson", 'w') do |f|
    f.write(build(folder_hash, note))
  end
end
timestamp() click to toggle source
# File lib/ever2boost/cson_generator.rb, line 22
def timestamp
  Time.new.getutc.strftime('%Y-%m-%dT%H:%M:%S')
end