Class: Jekyll::Commands::Fyll
- Inherits:
-
Command
- Object
- Command
- Jekyll::Commands::Fyll
- Defined in:
- lib/jekyll/commands/fyll.rb
Overview
jekyll fyll Command
Class Method Summary collapse
- .command_action(command) ⇒ Object
- .init_with_program(prog) ⇒ Object
- .options ⇒ Object
- .process(_args = [], options = {}, config = {}) ⇒ Object
Class Method Details
.command_action(command) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/jekyll/commands/fyll.rb', line 30 def self.command_action(command) command.action do |args, | = () process args, , end end |
.init_with_program(prog) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jekyll/commands/fyll.rb', line 8 def self.init_with_program(prog) prog.command(:fyll) do |c| c.syntax 'fyll [OPTIONS]' c.description 'Imports data from Contentful' .each { |opt| c.option(*opt) } (c) command_action(c) end end |
.options ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/jekyll/commands/fyll.rb', line 21 def self. [ [ 'rebuild', '-r', '--rebuild', 'Rebuild Jekyll Site after fetching data' ] ] end |
.process(_args = [], options = {}, config = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/jekyll/commands/fyll.rb', line 37 def self.process(_args = [], = {}, config = {}) starting = Process.clock_gettime(Process::CLOCK_MONOTONIC) Jekyll.logger.info '... Fylling Content ...' Jekyll::Contentfyll::Importer.new(config).run ending = Process.clock_gettime(Process::CLOCK_MONOTONIC) elapsed = ending - starting Jekyll.logger.info '... Content Fylled ... ' Jekyll.logger.info '... finished in #{elapsed} seconds' # return unless options['rebuild'] # Jekyll.logger.info 'Starting Jekyll Rebuild' # Jekyll::Commands::Build.process(options) end |