Module: Nanoc::CLI
- Defined in:
- lib/nanoc/cli/logger.rb,
lib/nanoc/cli/command_runner.rb,
lib/nanoc/cli/ansi_string_colorizer.rb,
lib/nanoc/cli/error_handler.rb,
lib/nanoc/cli/cleaning_stream.rb,
lib/nanoc/cli/stream_cleaners.rb,
lib/nanoc/cli.rb
Defined Under Namespace
Modules: ANSIStringColorizer, Commands, StreamCleaners Classes: CleaningStream, CommandRunner, ErrorHandler, Logger
Constant Summary
- Command =
Deprecated.
Use CommandRunner instead
CommandRunner
Class Method Summary (collapse)
-
+ (void) add_command(cmd)
Adds the given command to the collection of available commands.
-
+ (void) after_setup(&block)
Schedules the given block to be executed after the CLI has been set up.
-
+ (void) debug=(boolean)
-
+ (Boolean) debug?
True if debug output is enabled, false if not.
-
+ (Cri::Command) root_command
The root command, i.e.
-
+ (void) run(args)
Invokes the nanoc commandline tool with the given arguments.
Class Method Details
+ (void) add_command(cmd)
This method returns an undefined value.
Adds the given command to the collection of available commands.
73 74 75 |
# File 'lib/nanoc/cli.rb', line 73 def self.add_command(cmd) root_command.add_command(cmd) end |
+ (void) after_setup(&block)
This method returns an undefined value.
Schedules the given block to be executed after the CLI has been set up.
80 81 82 83 |
# File 'lib/nanoc/cli.rb', line 80 def self.after_setup(&block) # TODO decide what should happen if the CLI is already set up self.add_after_setup_proc(block) end |
+ (void) debug=(boolean)
This method returns an undefined value.
47 48 49 |
# File 'lib/nanoc/cli.rb', line 47 def self.debug=(boolean) @debug = boolean end |
+ (Boolean) debug?
Returns true if debug output is enabled, false if not
37 38 39 |
# File 'lib/nanoc/cli.rb', line 37 def self.debug? @debug || false end |
+ (Cri::Command) root_command
Returns The root command, i.e. the commandline tool itself
64 65 66 |
# File 'lib/nanoc/cli.rb', line 64 def self.root_command @root_command end |
+ (void) run(args)
This method returns an undefined value.
Invokes the nanoc commandline tool with the given arguments.
56 57 58 59 60 61 |
# File 'lib/nanoc/cli.rb', line 56 def self.run(args) Nanoc::CLI::ErrorHandler.handle_while do setup root_command.run(args) end end |