class Moft::Draft
Constants
- MATCHER
Valid post name regex (no date)
Public Class Methods
Public Instance Methods
containing_dir(source, dir)
click to toggle source
Get the full path to the directory containing the draft files
# File lib/moft/draft.rb, line 17 def containing_dir(source, dir) File.join(source, dir, '_drafts') end
process(name)
click to toggle source
Extract information from the post filename.
name - The String
filename of the post file.
Returns nothing.
# File lib/moft/draft.rb, line 26 def process(name) m, slug, ext = *name.match(MATCHER) self.date = File.mtime(File.join(@base, name)) self.slug = slug self.ext = ext end