123456789_123456789_123456789_123456789_123456789_

Class: Rake::Scope

Do not use. This class is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, LinkedList
Instance Chain:
self, LinkedList, Enumerable
Inherits: Rake::LinkedList
Defined in: lib/rake/scope.rb

Constant Summary

LinkedList - Inherited

EMPTY

Class Method Summary

LinkedList - Inherited

.cons

Cons a new head onto the tail list.

.empty

The standard empty list class for the given LinkedList class.

.make

Make a list out of the given arguments.

.new

Instance Attribute Summary

LinkedList - Inherited

#empty?

Is the list empty? .make guards against a list being empty making any instantiated LinkedList object not empty by default You should consider overriding this method if you implement your own .make method.

#head, #tail

Instance Method Summary

LinkedList - Inherited

#==

Lists are structurally equivalent.

#conj

Polymorphically add a new element to the head of a list.

#each

For each item in the list.

#inspect

Same as to_s, but with inspected items.

#to_s

Convert to string: LL(item, item…).

Constructor Details

This class inherits a constructor from Rake::LinkedList

Instance Method Details

#path

Path for the scope.

[ GitHub ]

  
# File 'lib/rake/scope.rb', line 6

def path
  map(&:to_s).reverse.join(":")
end

#path_with_task_name(task_name)

Path for the scope + the named path.

[ GitHub ]

  
# File 'lib/rake/scope.rb', line 11

def path_with_task_name(task_name)
  "#{path}:#{task_name}"
end

#trim(n)

Trim n innermost scope levels from the scope. In no case will this trim beyond the toplevel scope.

[ GitHub ]

  
# File 'lib/rake/scope.rb', line 17

def trim(n)
  result = self
  while n > 0 && !result.empty?
    result = result.tail
    n -= 1
  end
  result
end