class Build::Files::Paths
Represents an explicit list of file paths.
def self.directory(root, relative_paths)
@parameter relative_paths [Array(String)] The relative paths.
@parameter root [Path] The root directory.
Create a paths list from a directory root and relative paths.
def self.directory(root, relative_paths) paths = relative_paths.collect do |path| Path.join(root, path) end self.new(paths, [root]) end
def count
Get the count of paths in the list.
def count @list.count end
def each
@yields {|path| ...} Each path in the list.
Iterate over all paths in the list.
def each return to_enum(:each) unless block_given? @list.each{|path| yield path} end
def eql?(other)
@parameter other [Paths] The other paths list to compare.
Check equality with another paths list.
def eql?(other) self.class.eql?(other.class) and @list.eql?(other.list) end
def hash
Compute the hash value for this paths list.
def hash @list.hash end
def initialize(list, roots = nil)
@parameter list [Array] The array of paths.
Initialize a paths list.
def initialize(list, roots = nil) @list = Array(list).freeze @roots = roots end
def inspect
Generate a string representation for debugging.
def inspect "<Paths #{@list.inspect}>" end
def roots
def roots @roots ||= super end
def to_paths
Return this paths list unchanged.
def to_paths self end