Class: Jekyll::Commands::Book
- Inherits:
-
Command
- Object
- Command
- Jekyll::Commands::Book
- Defined in:
- lib/jekyll/commands/book.rb
Class Method Summary collapse
Class Method Details
.add_options(cmd) ⇒ Object
24 25 26 27 28 |
# File 'lib/jekyll/commands/book.rb', line 24 def self.(cmd) cmd.option "name", "-n", "--name NAME" cmd.option "title", "-t", "--title TITLE" cmd.option "forced", "-f", "--forced" end |
.init_with_program(prog) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/jekyll/commands/book.rb', line 6 def self.init_with_program(prog) prog.command(:book) do |c| c.syntax "book [options]" c.description 'Create a new book.' (c) c.action do |args, | configs = Jekyll.configuration() BookWriter.new( ["name"], File.join(configs["source"], "_books"), ).run end end end |