Parent

Class Index [+]

Quicksearch

Webgen::CLI::CommandParser

This is the command parser class used for handling the webgen command line interface. After creating an instance, the inherited # method can be used for parsing the command line arguments and executing the requested command.

Attributes

directory[R]

The website directory. Default: the current working directory.

verbosity[R]

The verbosity level. Default: :normal

log_level[R]

The log level. Default: Logger::WARN

Public Instance Methods

create_website() click to toggle source

Utility method for sub-commands to create the correct Webgen::Website object.

     # File lib/webgen/cli.rb, line 109
109:       def create_website
110:         if !defined?(@website)
111:           @website = Webgen::Website.new(@directory) do |config|
112:             config['logger.mask'] = @log_filter
113:           end
114:           @website.logger.level = @log_level
115:           @website.logger.verbosity = @verbosity
116:         end
117:         @website
118:       end
parse(argv = ARGV) click to toggle source

:nodoc:

     # File lib/webgen/cli.rb, line 121
121:       def parse(argv = ARGV)
122:         Webgen::CLI.constants.select {|c| c =~ /.+Command$/ }.each do |c|
123:           self.add_command(Webgen::CLI.const_get(c).new, (c.to_s == 'RunCommand' ? true : false))
124:         end
125:         super
126:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.