Sha256: 5ddbbba7e2c77ee0b7b349e6749b5ea17df5ff53c664c6988ac6e7947469198c

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'kitabu'
require 'kitabu/templates'
require 'main'

Main {
  description <<-TXT
    The 'kitabu' command creates a new book with a default
    directory structure at the path you specify.
    
    VERSION: #{Kitabu::VERSION}
    
    USAGE: kitabu path [parameters]
  TXT
  
  argument(:path) {
    description "The output path."
    required
    validate {|path| !File.exists?(path) }
    attr
  }
  
  option(:l, :layout){
    description "Specify which layout to use.  Available: #{Kitabu::Base.layouts.join(', ')}"
    cast :string
    defaults "boom"
    argument :optional
    validate {|layout| Kitabu::Base.layout?(layout) }
    attr
  }
  
  option(:t, :theme){
    description "Specify which syntax highlight theme to use. Available: #{Kitabu::Base.themes.join(', ')}"
    cast :string
    defaults "eiffel"
    argument :optional
    validate {|theme| Kitabu::Base.theme?(theme) }
    attr
  }
  
  def run
    Kitabu::Templates.process!(:layout => layout, :theme => theme, :path => path)
  end
}

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fnando-kitabu-0.3.0 bin/kitabu
fnando-kitabu-0.3.1 bin/kitabu
fnando-kitabu-0.3.10 bin/kitabu
fnando-kitabu-0.3.2 bin/kitabu
fnando-kitabu-0.3.3 bin/kitabu
fnando-kitabu-0.3.4 bin/kitabu
fnando-kitabu-0.3.5 bin/kitabu
fnando-kitabu-0.3.6 bin/kitabu
fnando-kitabu-0.3.7 bin/kitabu
fnando-kitabu-0.3.8 bin/kitabu
fnando-kitabu-0.3.9 bin/kitabu