| Server IP : 109.234.162.214 / Your IP : 216.73.216.157 Web Server : Apache System : Linux servd162214.srv.odns.fr 4.18.0-372.26.1.lve.1.el8.x86_64 #1 SMP Fri Sep 16 14:08:19 EDT 2022 x86_64 User : carpe ( 1178) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /opt/alt/ruby27/share/gems/gems/rake-13.0.1/lib/rake/ |
Upload File : |
# frozen_string_literal: true
module Rake
class Scope < LinkedList # :nodoc: all
# Path for the scope.
def path
map(&:to_s).reverse.join(":")
end
# Path for the scope + the named path.
def path_with_task_name(task_name)
"#{path}:#{task_name}"
end
# Trim +n+ innermost scope levels from the scope. In no case will
# this trim beyond the toplevel scope.
def trim(n)
result = self
while n > 0 && !result.empty?
result = result.tail
n -= 1
end
result
end
# Scope lists always end with an EmptyScope object. See Null
# Object Pattern)
class EmptyScope < EmptyLinkedList
@parent = Scope
def path
""
end
def path_with_task_name(task_name)
task_name
end
end
# Singleton null object for an empty scope.
EMPTY = EmptyScope.new
end
end