Class: JekyllPageBoilerplate::Application

Inherits:
Thor
  • Object
show all
Defined in:
lib/jekyll_page_boilerplate_cli.rb

Constant Summary collapse

SHARED_OPTIONS =
{
  title: { type: :string, aliases: [:t], desc: "`path/<title>.md` `'Foo Bar' > foo-bar.md`" },
  path: { type: :string, aliases: [:p], desc: "`<path>/title.md`" },
  slug: { type: :string, aliases: [:u], desc: "`path/<slug-template>.md` `{{title}}-{{date}}`" },
  timestamp: { type: :boolean, aliases: [:s], desc: "`path/<time.now>-title.md`" },
  suffix: { type: :string, aliases: [:x], desc: "`path/title.<md, markdown, txt>`" }
  # TODO: rename suffix to ext ^^^
}

Instance Method Summary collapse

Instance Method Details

#create(plate, title = nil, *args) ⇒ Object



36
37
38
39
40
# File 'lib/jekyll_page_boilerplate_cli.rb', line 36

def create plate, title = nil, *args
  _options = options.dup.transform_values(&:dup) || {}
  _options[:title] ||= title if title
  JekyllPageBoilerplate.page plate, args, _options
end

#initObject



23
24
25
# File 'lib/jekyll_page_boilerplate_cli.rb', line 23

def init
  puts JekyllPageBoilerplate.init
end

#listObject



28
29
30
# File 'lib/jekyll_page_boilerplate_cli.rb', line 28

def list
  JekyllPageBoilerplate.list
end

#readmeObject



43
44
45
# File 'lib/jekyll_page_boilerplate_cli.rb', line 43

def readme
  JekyllPageBoilerplate.readme
end

#versionObject



18
19
20
# File 'lib/jekyll_page_boilerplate_cli.rb', line 18

def version
  puts JekyllPageBoilerplate::VERSION.to_s
end