class Build::Files::Difference
Represents a list of files with exclusions applied.
def -(list)
@parameter list [List] Additional files to exclude.
Subtract additional files from this difference.
def -(list) self.class.new(@list, Composite.new([@excludes, list])) end
def each
@yields {|path| ...} Each path not in the exclusion list.
Iterate over files in the base list, excluding those in the exclusion list.
def each return to_enum(:each) unless block_given? @list.each do |path| yield path unless @excludes.include?(path) end end
def freeze
def freeze @list.freeze @excludes.freeze super end
def include?(path)
@parameter path [Path] The path to check.
Check if the difference includes a specific path.
def include?(path) @list.include?(path) and !@excludes.include?(path) end
def initialize(list, excludes)
@parameter list [List] The base list of files.
Initialize a difference list.
def initialize(list, excludes) @list = list @excludes = excludes end
def inspect
Generate a string representation for debugging.
def inspect "<Difference #{@list.inspect} - #{@excludes.inspect}>" end
def rebase(root)
@parameter root [Path] The new root path.
Rebase the difference to a new root.
def rebase(root) self.class.new(@list.rebase(root), @excludes.rebase(root)) end