seandenigris / Resources-Live

GNU General Public License v3.0
4 stars 0 forks source link

Ensure file locations are contained by lib folder #21

Open seandenigris opened 5 years ago

seandenigris commented 5 years ago

FS magic can get confusing e.g. (FileLocator home / ') resolve' = FileLocator root resolve "WTF".

Here's a snippet to translate a reference into a "locator + path":

locator := FileLocator home.
subchild := (FileLocator imageDirectory / 'k') resolve: 'd/j/r'.
relPath := locator makeRelative: subchild.
result := locator withPath: relPath.
self assert: result = subchild.