Since 0.7.0 there is method SanctoraleFactory.load_with_parents, recursively loading and correctly merging parent calendars specified in each file's YAML front matter. The only supported way to refer to a parent data file is by it's path relative to the current file. But there are scenarios when the library's user will want to be able to refer to well-known data files without knowing their relative filesystem path - e.g. to the data files bundled in calendarium-romanum. (There is already an example in the wild: some of the data files in https://github.com/calendarium-romanum/data-contrib need such references.) For cases like this, there should be an alternative parent loading method, looking for parent calendars in some sort of a repository object rather than interacting directly with the filesystem.
The repository mechanism should be flexible and (based on how the repository object is constructed) allow any combination of
filesystem lookup by (unlimited) relative paths, just like SanctoraleFactory.load_with_parents does
filesystem lookup limited to whitelisted directories (references to files outside of the whitelisted directories will result in an error)
id => in-memory data mapping in a Hash-like object
id => filesystem path mapping in a Hash like object
Since 0.7.0 there is method
SanctoraleFactory.load_with_parents
, recursively loading and correctly merging parent calendars specified in each file's YAML front matter. The only supported way to refer to a parent data file is by it's path relative to the current file. But there are scenarios when the library's user will want to be able to refer to well-known data files without knowing their relative filesystem path - e.g. to the data files bundled incalendarium-romanum
. (There is already an example in the wild: some of the data files in https://github.com/calendarium-romanum/data-contrib need such references.) For cases like this, there should be an alternative parent loading method, looking for parent calendars in some sort of a repository object rather than interacting directly with the filesystem.The repository mechanism should be flexible and (based on how the repository object is constructed) allow any combination of
SanctoraleFactory.load_with_parents
does