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.
11 12 13 14 |
# File 'lib/rake/name_space.rb', line 11 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.
19 20 21 |
# File 'lib/rake/name_space.rb', line 19 def [](name) @task_manager.lookup(name, @scope) end |
#scope ⇒ Object
The scope of the namespace (a LinkedList)
26 27 28 |
# File 'lib/rake/name_space.rb', line 26 def scope @scope.dup end |
#tasks ⇒ Object
Return the list of tasks defined in this and nested namespaces.
33 34 35 |
# File 'lib/rake/name_space.rb', line 33 def tasks @task_manager.tasks_in_scope(@scope) end |