Class: Rake::NameSpace

Inherits:
Object show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/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

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/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/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/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/name_space.rb', line 20

def [](name)
  @task_manager.lookup(name, @scope)
end

#scopeObject

The scope of the namespace (a LinkedList)



27
28
29
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/name_space.rb', line 27

def scope
  @scope.dup
end

#tasksObject

Return the list of tasks defined in this and nested namespaces.



34
35
36
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rake-13.0.6/lib/rake/name_space.rb', line 34

def tasks
  @task_manager.tasks_in_scope(@scope)
end