Class: Rake::NameSpace
- Inherits:
-
Object
- Object
- Rake::NameSpace
- Defined in:
- lib/rake/name_space.rb
Overview
The NameSpace class will lookup task names in the scope defined by a namespace
command.
Instance Method Summary collapse
-
#[](name) ⇒ Object
Lookup a task named
name
in the namespace. -
#initialize(task_manager, scope_list) ⇒ NameSpace
constructor
Create a namespace lookup object using the given task manager and the list of scopes.
-
#scope ⇒ Object
The scope of the namespace (a LinkedList).
-
#tasks ⇒ Object
Return the list of tasks defined in this and nested namespaces.
Constructor Details
#initialize(task_manager, scope_list) ⇒ NameSpace
Create a namespace lookup object using the given task manager and the list of scopes.
12 13 14 15 |
# File 'lib/rake/name_space.rb', line 12 def initialize(task_manager, scope_list) @task_manager = task_manager @scope = scope_list.dup end |
Instance Method Details
#[](name) ⇒ Object
Lookup a task named name
in the namespace.
20 21 22 |
# File 'lib/rake/name_space.rb', line 20 def [](name) @task_manager.lookup(name, @scope) end |
#scope ⇒ Object
The scope of the namespace (a LinkedList)
27 28 29 |
# File 'lib/rake/name_space.rb', line 27 def scope @scope.dup end |
#tasks ⇒ Object
Return the list of tasks defined in this and nested namespaces.
34 35 36 |
# File 'lib/rake/name_space.rb', line 34 def tasks @task_manager.tasks_in_scope(@scope) end |