class Build::Files::Difference

Represents a list of files with exclusions applied.

def -(list)

@returns [Difference] A new difference with expanded exclusions.
@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

@parameter path [Path] The current file path.
@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

Freeze the difference list and its dependencies.
def freeze
	@list.freeze
	@excludes.freeze
	
	super
end

def include?(path)

@returns [Boolean] True if the path is in the base list but not excluded.
@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 excludes [List] The list of files to exclude.
@parameter list [List] The base list of files.
Initialize a difference list.
def initialize(list, excludes)
	@list = list
	@excludes = excludes
end

def inspect

@returns [String] A debug string showing the difference structure.
Generate a string representation for debugging.
def inspect
	"<Difference #{@list.inspect} - #{@excludes.inspect}>"
end

def rebase(root)

@returns [Difference] A new difference with rebased files.
@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