Sha256: fbd2d30e94de2ba545ff2326499dd5b6506b46c7754540e2d6fc9aa3b467b200

Contents?: true

Size: 801 Bytes

Versions: 7

Compression:

Stored size: 801 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(Octopress.site(options), options).publish
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
octopress-3.0.0.rc.25 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.24 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.23 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.22 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.21 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.20 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.19 lib/octopress/commands/publish.rb