How ruby/rake works
Rake is a Ruby-based build-task runner. A user invokes the command-line application, which loads a Ruby Rakefile; the DSL declares tasks and prerequisites, and the task manager resolves them for invocation. Tasks run prerequisites before their own actions, while file tasks use timestamps to determine whether rebuilding is needed. Other documented capabilities include implicit rule patterns, file lists, parallel execution, and prepackaged tasks. The graph follows documented behavior and visible source references; unsampled implementation details are omitted where their connections cannot be verified.
Main entry points: application.rb Application CLI · task_manager.rb Task manager · dsl_definition.rb Task DSL · task.rb Task invocation
Components 17
Entry and configuration
- Application CLI
lib/rake/application.rb - CLI options
lib/rake/options.rb
Task definition and resolution
- Task DSL
lib/rake/dsl_definition.rb - Task manager
lib/rake/task_manager.rb - Task invocation
lib/rake/task.rb - Implicit rules
lib/rake/task_manager.rb
File and build support
- File tasks
lib/rake/file_task.rb - File lists
lib/rake/file_list.rb - File utilities
lib/rake/file_utils_ext.rb - Path mapping
lib/rake/ext/string.rb
Execution and extensions
- Parallel tasks
lib/rake/thread_pool.rb - Work promises
lib/rake/promise.rb - Package tasks
lib/rake/packagetask.rb - Test tasks
lib/rake/testtask.rb
Other components
- Rake user
- Ruby Rakefile
- Build actions
Connections 21
- Rake user → Application CLI: invokes
- Application CLI → CLI options: parses options
lib/rake/application.rb - Application CLI → Task manager: manages tasks
lib/rake/application.rb - Application CLI → Ruby Rakefile: loads rules
- Ruby Rakefile → Task DSL: declares tasks
- Task DSL → Task manager: defines tasks
lib/rake/dsl_definition.rb - Task manager → Task invocation: resolves tasks
lib/rake/task_manager.rb - Task invocation → Task invocation: invokes prerequisites
lib/rake/task.rb - Task invocation → Build actions: runs actions
- Task manager → Implicit rules: synthesizes tasks
lib/rake/task_manager.rb - Task manager → File tasks: creates rule tasks
lib/rake/task_manager.rb - Task DSL → File tasks: defines file tasks
lib/rake/dsl_definition.rb - File tasks → Build actions: rebuilds files
lib/rake/file_task.rb - Application CLI → File lists: uses file lists
lib/rake/application.rb - File lists → File utilities: uses file utilities
lib/rake/file_list.rb - File lists → Path mapping: maps paths
lib/rake/file_list.rb - Task DSL → File utilities: exposes utilities
lib/rake/dsl_definition.rb - Parallel tasks → Work promises: queues work
lib/rake/thread_pool.rb - Ruby Rakefile → Parallel tasks: requests parallel tasks
- Ruby Rakefile → Package tasks: uses package tasks
- Ruby Rakefile → Test tasks: uses test tasks