class Rake::Scope

Constants

EMPTY

Singleton null object for an empty scope.

Public Instance Methods

path() click to toggle source

Path for the scope.

# File lib/rake/scope.rb, line 5
def path
  map { |item| item.to_s }.reverse.join(":")
end
path_with_task_name(task_name) click to toggle source

Path for the scope + the named path.

# File lib/rake/scope.rb, line 10
def path_with_task_name(task_name)
  "#{path}:#{task_name}"
end
trim(n) click to toggle source

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

# File lib/rake/scope.rb, line 16
def trim(n)
  result = self
  while n > 0 && ! result.empty?
    result = result.tail
    n -= 1
  end
  result
end