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

Version Path
octopress-3.0.0.rc.17 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.16 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.15 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.14 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.13 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.12 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.11 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.10 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.9 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.8 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.7 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.6 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.5 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.4 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.3 lib/octopress/commands/publish.rb
octopress-3.0.0.rc.2 lib/octopress/commands/publish.rb