Class: Rake::Application

Class | Rake::Application
In: | lib/rake.rb
Parent: | Object

Rake main application object. When invoking `rake` from the command line, a Rake::Application object is created and run.

### Methods

add_import add_loader collect_tasks command_line_options const_warning display_prerequisites display_tasks_and_comments do_option handle_options have_rakefile help load_imports load_rakefile new options rake_require rakefile_location run usage

### Included Modules

TaskManager

### Constants

RAKEFILES | = | ['rakefile', 'Rakefile', 'rakefile.rb', 'Rakefile.rb']
OPTIONS | = | [ ['--dry-run', '-n', GetoptLong::NO_ARGUMENT, "Do a dry run without executing actions."], ['--help', '-H', GetoptLong::NO_ARGUMENT, "Display this help message."], ['--libdir', '-I', GetoptLong::REQUIRED_ARGUMENT, "Include LIBDIR in the search path for required modules."], ['--rakelibdir', '-R', GetoptLong::REQUIRED_ARGUMENT, "Auto-import any .rake files in RAKELIBDIR. (default is 'rakelib')"], ['--nosearch', '-N', GetoptLong::NO_ARGUMENT, "Do not search parent directories for the Rakefile."], ['--prereqs', '-P', GetoptLong::NO_ARGUMENT, "Display the tasks and dependencies, then exit."], ['--quiet', '-q', GetoptLong::NO_ARGUMENT, "Do not log messages to standard output."], ['--rakefile', '-f', GetoptLong::OPTIONAL_ARGUMENT, "Use FILE as the rakefile."], ['--require', '-r', GetoptLong::REQUIRED_ARGUMENT, "Require MODULE before executing rakefile."], ['--silent', '-s', GetoptLong::NO_ARGUMENT, "Like --quiet, but also suppresses the 'in directory' announcement."], ['--tasks', '-T', GetoptLong::OPTIONAL_ARGUMENT, "Display the tasks (matching optional PATTERN) with descriptions, then exit."], ['--trace', '-t', GetoptLong::NO_ARGUMENT, "Turn on invoke/execute tracing, enable full backtrace."], ['--usage', '-h', GetoptLong::NO_ARGUMENT, "Display usage."], ['--verbose', '-v', GetoptLong::NO_ARGUMENT, "Log message to standard output (default)."], ['--version', '-V', GetoptLong::NO_ARGUMENT, "Display the program version."], ['--classic-namespace', '-C', GetoptLong::NO_ARGUMENT, "Put Task and FileTask in the top level namespace"], ]

### Attributes

original_dir | [R] | The original directory where rake was invoked.

### Public Class methods

new()

Create a Rake::Application object.

### Public Instance methods

add_import(fn)

Add a file to the list of files to be imported.

add_loader(ext, loader)

Add a loader to handle imported files ending in the extension `ext`.

collect_tasks()

Collect the list of tasks on the command line. If no tasks are give, return a list containing only the default task. Environmental assignments are processed at this time as well.

command_line_options()

Return a list of the command line options supported by the program.

const_warning(const_name)

Warn about deprecated use of top level constant names.

display_prerequisites()

Display the tasks and prerequisites

display_tasks_and_comments()

Display the tasks and dependencies.

do_option(opt, value)

Do the option defined by `opt` and `value`.

handle_options()

Read and handle the command line options.

have_rakefile()

True if one of the files in RAKEFILES is in the current directory. If a match is found, it is copied into @rakefile.

help()

Display the rake command line help.

load_imports()

Load the pending list of imported files.

load_rakefile()

Find the rakefile and then load it and any pending imports.

options()

Application options from the command line

rake_require(file_name, paths=$LOAD_PATH, loaded=$")

Similar to the regular Ruby `require` command, but will check for .rake files in addition to .rb files.

rakefile_location()
run()

Run the `rake` application.

usage()

Display the program usage line.

[Validate]