Class: Webgen::CLI::GenerateCommand
- Inherits:
-
CmdParse::Command
- Object
- CmdParse::Command
- Webgen::CLI::GenerateCommand
- Defined in:
- lib/webgen/cli/commands/generate.rb
Overview
The CLI command for generating a webgen website.
Instance Method Summary collapse
-
#execute ⇒ Object
:nodoc:.
-
#initialize ⇒ GenerateCommand
constructor
:nodoc:.
Constructor Details
#initialize ⇒ GenerateCommand
:nodoc:
11 12 13 14 15 16 17 18 19 |
# File 'lib/webgen/cli/commands/generate.rb', line 11 def initialize # :nodoc: super('generate', takes_commands: false) short_desc('Generate the webgen website') long_desc("This command is executed by default when no other command was specified.") .on('-a', '--auto [SEC]', Integer, "Auto-generate the website every SEC seconds (5=default, 0=off)") do |val| @auto_generate_secs = val || 5 end @auto_generate_secs = 0 end |
Instance Method Details
#execute ⇒ Object
:nodoc:
21 22 23 24 25 26 27 |
# File 'lib/webgen/cli/commands/generate.rb', line 21 def execute # :nodoc: if @auto_generate_secs <= 0 command_parser.website.execute_task(:generate_website) else auto_generate end end |