Sha256: 7ffd69f52f3118507c9a6dc1e5d3cd35aff9ccf5de33c7a3e68fc72e378bb127
Contents?: true
Size: 776 Bytes
Versions: 16
Compression:
Stored size: 776 Bytes
Contents
module Octopress class Publish < Command def self.init_with_program(p) p.command(:publish) do |c| c.syntax 'publish <PATH> [options]' c.description 'Convert a draft to a normal published post.' c.option 'date', '--date DATE', 'String that is parseable by Time#parse. (default: Time.now.iso8601)' c.option 'force', '--force', 'Overwrite file if it already exists' c.option 'dir', '--dir DIR', 'Create post at _posts/DIR/.' CommandHelpers.add_common_options c c.action do |args, options| abort "You must specify a path." if args.empty? options['path'] = args.first options['type'] = 'post from draft' Draft.new(options).publish end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems