Class: Jekyll::Draft

### Home Classes Methods

### In Files

- lib/jekyll/draft.rb

### Parent

Post

### Methods

- ::valid?
- #containing_dir
- #process

### Files

- LICENSE

### Class/Module Index

Quicksearch

- Jekyll
- Jekyll::Command
- Jekyll::Commands
- Jekyll::Commands::Build
- Jekyll::Commands::Doctor
- Jekyll::Commands::New
- Jekyll::Commands::Serve
- Jekyll::Configuration
- Jekyll::Converter
- Jekyll::Converters
- Jekyll::Converters::Identity
- Jekyll::Converters::Markdown
- Jekyll::Converters::Markdown::KramdownParser
- Jekyll::Converters::Markdown::MarukuParser
- Jekyll::Converters::Markdown::RDiscountParser
- Jekyll::Converters::Markdown::RedcarpetParser
- Jekyll::Converters::Markdown::RedcarpetParser::CommonMethods
- Jekyll::Converters::Markdown::RedcarpetParser::WithPygments
- Jekyll::Converters::Markdown::RedcarpetParser::WithoutPygments
- Jekyll::Converters::Textile
- Jekyll::Convertible
- Jekyll::Deprecator
- Jekyll::Draft
- Jekyll::Excerpt
- Jekyll::FatalException
- Jekyll::Filters
- Jekyll::Generator
- Jekyll::Generators
- Jekyll::Generators::Pagination
- Jekyll::GistTag
- Jekyll::Layout
- Jekyll::Page
- Jekyll::Pager
- Jekyll::Plugin
- Jekyll::Post
- Jekyll::RelatedPosts
- Jekyll::Site
- Jekyll::Site::Cleaner
- Jekyll::StaticFile
- Jekyll::Stevenson
- Jekyll::Tags
- Jekyll::Tags::HighlightBlock
- Jekyll::Tags::IncludeTag
- Jekyll::Tags::PostComparer
- Jekyll::Tags::PostUrl
- Jekyll::URL
- Date
- Enumerable
- Hash
- Object

No matching classes.

# Jekyll::Draft

### Constants

MATCHER

  Valid post name regex (no date)

### Public Class Methods

valid?(name) click to toggle source

Draft name validator. Draft filenames must be like: my-awesome-post.textile

Returns true if valid, false if not.

    # File lib/jekyll/draft.rb, line 12
    def self.valid?(name)
      name =~ MATCHER
    end

### Public Instance Methods

containing_dir(source, dir) click to toggle source

Get the full path to the directory containing the draft files

    # File lib/jekyll/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/jekyll/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

[Validate]

Generated with the Darkfish Rdoc Generator 2.