Module: Nanoc::CLI Private
- Defined in:
- lib/nanoc/cli.rb,
lib/nanoc/cli/logger.rb,
lib/nanoc/cli/error_handler.rb,
lib/nanoc/cli/command_runner.rb,
lib/nanoc/cli/cleaning_stream.rb,
lib/nanoc/cli/stream_cleaners.rb,
lib/nanoc/cli/ansi_string_colorizer.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Modules: ANSIStringColorizer, Commands, StreamCleaners Classes: CleaningStream, CommandRunner, ErrorHandler, Logger
Class Method Summary collapse
-
.add_command(cmd) ⇒ void
private
Adds the given command to the collection of available commands.
-
.after_setup(&block) ⇒ void
private
Schedules the given block to be executed after the CLI has been set up.
- .debug=(boolean) ⇒ void private
-
.debug? ⇒ Boolean
private
True if debug output is enabled, false if not.
-
.root_command ⇒ Cri::Command
private
The root command, i.e.
-
.run(args) ⇒ void
private
Invokes the Nanoc command-line tool with the given arguments.
Class Method Details
.add_command(cmd) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Adds the given command to the collection of available commands.
60 61 62 |
# File 'lib/nanoc/cli.rb', line 60 def self.add_command(cmd) root_command.add_command(cmd) end |
.after_setup(&block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Schedules the given block to be executed after the CLI has been set up.
67 68 69 70 |
# File 'lib/nanoc/cli.rb', line 67 def self.after_setup(&block) # TODO: decide what should happen if the CLI is already set up add_after_setup_proc(block) end |
.debug=(boolean) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
34 35 36 |
# File 'lib/nanoc/cli.rb', line 34 def self.debug=(boolean) @debug = boolean end |
.debug? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns true if debug output is enabled, false if not.
24 25 26 |
# File 'lib/nanoc/cli.rb', line 24 def self.debug? @debug || false end |
.root_command ⇒ Cri::Command
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns The root command, i.e. the command-line tool itself.
51 52 53 |
# File 'lib/nanoc/cli.rb', line 51 def self.root_command @root_command end |
.run(args) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Invokes the Nanoc command-line tool with the given arguments.
43 44 45 46 47 48 |
# File 'lib/nanoc/cli.rb', line 43 def self.run(args) Nanoc::CLI::ErrorHandler.handle_while do setup root_command.run(args) end end |