Method: Post#process

Defined in:
lib/den/post.rb

#processObject

Pull out metadata and markup the post



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/den/post.rb', line 46

def process
  File.open(@file) do |f|
    # Extract the date
    post = {
      :id => f.readline.chomp,
      :date => DateTime.strptime(f.readline.chomp, "%Y-%m-%d %H:%M:%S %z")
    }

    # Process the post
    post.merge!(markup(f.read))

    # Store the processed info
    @content = post
  end
end