Sha256: b91dd43308584adb43dc1a4a34e1459a52e5f66c23448e41a606b147cbc08343

Contents?: true

Size: 980 Bytes

Versions: 4

Compression:

Stored size: 980 Bytes

Contents

require "techbook"
require "thor"

module Techbook
  class CLI < Thor
    class_option :output, aliases: 'o', default: Dir.pwd

    desc "generate NAME", "Create book templates as NAME in specified output."
    def generate(name)
      Generator::run name, output: options[:output]
    end

    option :pdf, type: :boolean, default: true
    option :mobi, type: :boolean
    option :epub, type: :boolean
    option :html, type: :boolean
    option :docbook, type: :boolean
    option :watch, type: :boolean
    desc "build", "Build the book."
    def build
      Builder.run pdf: options[:pdf],
                  mobi: options[:mobi],
                  epub: options[:epub],
                  html: options[:html],
                  docbook: options[:docbook],
                  output: options[:output],
                  watch: options[:watch]
    end

    # desc "publish", "Publish to common hosting services."
    # def publish
    #   puts "Hello world"
    # end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
techbook-0.2.3 lib/techbook/cli.rb
techbook-0.2.2 lib/techbook/cli.rb
techbook-0.2.1 lib/techbook/cli.rb
techbook-0.2.0 lib/techbook/cli.rb