X7ROOT File Manager
Current Path:
/opt/alt/ruby21/lib64/ruby/2.1.0/rake
opt
/
alt
/
ruby21
/
lib64
/
ruby
/
2.1.0
/
rake
/
ðŸ“
..
📄
alt_system.rb
(3.13 KB)
📄
application.rb
(20.78 KB)
📄
backtrace.rb
(715 B)
📄
clean.rb
(1.37 KB)
📄
cloneable.rb
(482 B)
ðŸ“
contrib
📄
default_loader.rb
(164 B)
📄
dsl_definition.rb
(4.15 KB)
📄
early_time.rb
(273 B)
ðŸ“
ext
📄
file_creation_task.rb
(670 B)
📄
file_list.rb
(11.82 KB)
📄
file_task.rb
(1.28 KB)
📄
file_utils.rb
(3.03 KB)
📄
file_utils_ext.rb
(4.05 KB)
📄
gempackagetask.rb
(116 B)
📄
invocation_chain.rb
(1.23 KB)
📄
invocation_exception_mixin.rb
(431 B)
ðŸ“
lib
📄
linked_list.rb
(2.27 KB)
ðŸ“
loaders
📄
multi_task.rb
(315 B)
📄
name_space.rb
(618 B)
📄
packagetask.rb
(5.11 KB)
📄
pathmap.rb
(26 B)
📄
phony.rb
(351 B)
📄
private_reader.rb
(364 B)
📄
promise.rb
(2.28 KB)
📄
pseudo_status.rb
(427 B)
📄
rake_module.rb
(727 B)
📄
rake_test_loader.rb
(341 B)
📄
rdoctask.rb
(126 B)
📄
ruby182_test_unit_fix.rb
(870 B)
📄
rule_recursion_overflow_error.rb
(353 B)
📄
runtest.rb
(471 B)
📄
scope.rb
(868 B)
📄
task.rb
(10.96 KB)
📄
task_argument_error.rb
(119 B)
📄
task_arguments.rb
(1.88 KB)
📄
task_manager.rb
(8.4 KB)
📄
tasklib.rb
(580 B)
📄
testtask.rb
(5.22 KB)
📄
thread_history_display.rb
(1.11 KB)
📄
thread_pool.rb
(4.74 KB)
📄
trace_output.rb
(529 B)
📄
version.rb
(178 B)
📄
win32.rb
(1.54 KB)
Editing: linked_list.rb
module Rake # Polylithic linked list structure used to implement several data # structures in Rake. class LinkedList include Enumerable attr_reader :head, :tail def initialize(head, tail=EMPTY) @head = head @tail = tail end # Polymorphically add a new element to the head of a list. The # type of head node will be the same list type has the tail. def conj(item) self.class.cons(item, self) end # Is the list empty? def empty? false end # Lists are structurally equivalent. def ==(other) current = self while ! current.empty? && ! other.empty? return false if current.head != other.head current = current.tail other = other.tail end current.empty? && other.empty? end # Convert to string: LL(item, item...) def to_s items = map { |item| item.to_s }.join(", ") "LL(#{items})" end # Same as +to_s+, but with inspected items. def inspect items = map { |item| item.inspect }.join(", ") "LL(#{items})" end # For each item in the list. def each current = self while ! current.empty? yield(current.head) current = current.tail end self end # Make a list out of the given arguments. This method is # polymorphic def self.make(*args) result = empty args.reverse_each do |item| result = cons(item, result) end result end # Cons a new head onto the tail list. def self.cons(head, tail) new(head, tail) end # The standard empty list class for the given LinkedList class. def self.empty self::EMPTY end # Represent an empty list, using the Null Object Pattern. # # When inheriting from the LinkedList class, you should implement # a type specific Empty class as well. Make sure you set the class # instance variable @parent to the assocated list class (this # allows conj, cons and make to work polymorphically). class EmptyLinkedList < LinkedList @parent = LinkedList def initialize end def empty? true end def self.cons(head, tail) @parent.cons(head, tail) end end EMPTY = EmptyLinkedList.new end end
Upload File
Create Folder