class Bake::Loader

Represents a directory which contains bakefiles.

def each

@parameter path [String] The Ruby source file path.
@yields {|path| ...}
Enumerate all bakefiles within the loaders root directory.
def each
	return to_enum unless block_given?
	
	Dir.glob("**/*.rb", base: @root) do |file_path|
		yield file_path.sub(/\.rb$/, '').split(File::SEPARATOR)
	end
end

def initialize(root, name: nil)

@parameter root [String] A file-system path.
Initialize the loader with the specified root path.
def initialize(root, name: nil)
	@root = root
	@name = name
end

def scope_for(path)

@parameter path [Array(String)] A relative path.
Load the {Scope} for the specified relative path within this loader, if it exists.
def scope_for(path)
	*directory, file = *path
	
	file_path = File.join(@root, directory, "#{file}.rb")
	
	if File.exist?(file_path)
		return Scope.load(file_path, path)
	end
end

def to_s

def to_s
	"#{self.class} #{@name || @root}"
end