Class: Middleman::Cli::Entry
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Middleman::Cli::Entry
- Includes:
- Thor::Actions
- Defined in:
- lib/middleman-journal/commands/entry.rb
Overview
This class provides an “entry” command for the middleman CLI.
Class Method Summary collapse
-
.source_root ⇒ String
Template files are relative to this file.
Instance Method Summary collapse
Class Method Details
.source_root ⇒ String
Template files are relative to this file
23 24 25 |
# File 'lib/middleman-journal/commands/entry.rb', line 23 def self.source_root File.dirname(__FILE__) end |
Instance Method Details
#entry ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/middleman-journal/commands/entry.rb', line 31 def entry @date = [:date] ? Chronic.parse([:date]) : Date.today @title = @date.strftime('%F') @slug = @date.strftime('%F') template template_path, destination_path end |