Module: Nanoc::CLI
- Defined in:
- lib/nanoc/cli.rb,
lib/nanoc/cli/cleaning_stream.rb,
lib/nanoc/cli/command_runner.rb,
lib/nanoc/cli/stream_cleaners.rb,
lib/nanoc/cli/ansi_string_colorizer.rb,
lib/nanoc/cli/logger.rb,
lib/nanoc/cli/error_handler.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 command-line 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.
72 73 74 |
# File 'lib/nanoc/cli.rb', line 72 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.
79 80 81 82 |
# File 'lib/nanoc/cli.rb', line 79 def self.after_setup(&block) # TODO: decide what should happen if the CLI is already set up add_after_setup_proc(block) end |
+ (void) debug=(boolean)
This method returns an undefined value.
46 47 48 |
# File 'lib/nanoc/cli.rb', line 46 def self.debug=(boolean) @debug = boolean end |
+ (Boolean) debug?
Returns true if debug output is enabled, false if not
36 37 38 |
# File 'lib/nanoc/cli.rb', line 36 def self.debug? @debug || false end |
+ (Cri::Command) root_command
Returns The root command, i.e. the command-line tool itself
63 64 65 |
# File 'lib/nanoc/cli.rb', line 63 def self.root_command @root_command end |
+ (void) run(args)
This method returns an undefined value.
Invokes the nanoc command-line tool with the given arguments.
55 56 57 58 59 60 |
# File 'lib/nanoc/cli.rb', line 55 def self.run(args) Nanoc::CLI::ErrorHandler.handle_while do setup root_command.run(args) end end |