From 3eed649ae6499ab30aab819245aecc9c45e415cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Wed, 12 Jun 2024 16:40:07 +0200 Subject: [PATCH] Add GitDirectoryAssetLoader and GitMCRepositoryAssetLoader --- .../GitDirectoryAssetLoader.class/README.md | 0 .../class/newWithName.on..st | 5 +++++ .../instance/assetAt..st | 3 +++ .../instance/assetFSPaths.st | 3 +++ .../instance/assetsCache..st | 3 +++ .../instance/assetsCache.st | 3 +++ .../instance/directory..st | 3 +++ .../instance/directory.st | 3 +++ .../instance/initialize.st | 4 ++++ .../instance/mapperAt..st | 3 +++ .../instance/mappers.st | 3 +++ .../instance/readAsset..st | 6 ++++++ .../instance/readMappers.st | 9 +++++++++ .../instance/readStreamOn.do..st | 3 +++ .../methodProperties.json | 16 ++++++++++++++++ .../properties.json | 16 ++++++++++++++++ .../GitMCRepositoryAssetLoader.class/README.md | 0 .../class/newWithName.on..st | 5 +++++ .../class/scanFor.ifAbsent..st | 9 +++++++++ .../instance/directory.st | 6 ++++++ .../instance/repository..st | 3 +++ .../instance/repository.st | 3 +++ .../methodProperties.json | 8 ++++++++ .../properties.json | 14 ++++++++++++++ .../SquotMappersMapper.class/class/path.st | 3 +++ .../SquotMappersMapper.class/instance/path.st | 2 +- .../methodProperties.json | 4 ++-- 27 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/README.md create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/class/newWithName.on..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/assetAt..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/assetFSPaths.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/directory..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/directory.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/initialize.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/mapperAt..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/mappers.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/readAsset..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/readMappers.st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/instance/readStreamOn.do..st create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/methodProperties.json create mode 100644 src/Squot.package/GitDirectoryAssetLoader.class/properties.json create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/README.md create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/class/newWithName.on..st create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/class/scanFor.ifAbsent..st create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/instance/directory.st create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository..st create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository.st create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/methodProperties.json create mode 100644 src/Squot.package/GitMCRepositoryAssetLoader.class/properties.json create mode 100644 src/Squot.package/SquotMappersMapper.class/class/path.st diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/README.md b/src/Squot.package/GitDirectoryAssetLoader.class/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/class/newWithName.on..st b/src/Squot.package/GitDirectoryAssetLoader.class/class/newWithName.on..st new file mode 100644 index 000000000..86b1a0f60 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/class/newWithName.on..st @@ -0,0 +1,5 @@ +instance creation +newWithName: aString on: anFSReference + ^ (self newWithName: aString) + directory: anFSReference; + yourself \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetAt..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetAt..st new file mode 100644 index 000000000..2e6f4495f --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetAt..st @@ -0,0 +1,3 @@ +accessing +assetAt: aPath + ^ self assetsCache at: aPath ifAbsentPut: [self readAsset: aPath] \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetFSPaths.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetFSPaths.st new file mode 100644 index 000000000..b8cb8a092 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetFSPaths.st @@ -0,0 +1,3 @@ +accessing +assetFSPaths + ^ self mappers keys \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache..st new file mode 100644 index 000000000..50d255e7f --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache..st @@ -0,0 +1,3 @@ +accessing +assetsCache: aDictionary + assetsCache := aDictionary. \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache.st new file mode 100644 index 000000000..749709005 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache.st @@ -0,0 +1,3 @@ +accessing +assetsCache + ^ assetsCache \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory..st new file mode 100644 index 000000000..d1a962c13 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory..st @@ -0,0 +1,3 @@ +accessing +directory: anFSReference + directory := anFSReference \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory.st new file mode 100644 index 000000000..1b71cd791 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/directory.st @@ -0,0 +1,3 @@ +accessing +directory + ^ directory \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/initialize.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/initialize.st new file mode 100644 index 000000000..821d55edf --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/initialize.st @@ -0,0 +1,4 @@ +initialize-release +initialize + super initialize. + self assetsCache: Dictionary new. \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/mapperAt..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/mapperAt..st new file mode 100644 index 000000000..3604fb999 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/mapperAt..st @@ -0,0 +1,3 @@ +accessing +mapperAt: aPath + ^ self mappers at: aPath ifAbsent: [nil] \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/mappers.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/mappers.st new file mode 100644 index 000000000..a61a833b4 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/mappers.st @@ -0,0 +1,3 @@ +accessing +mappers + ^ mappersCache ifNil: [mappersCache := self readMappers]. \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/readAsset..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readAsset..st new file mode 100644 index 000000000..bc0de6492 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readAsset..st @@ -0,0 +1,6 @@ +accessing +readAsset: aPath + "Ideally, we could use SquotAssetMapper>>loadVersionFrom: here, but that takes a FileSystem + that is rooted at the repository root. We can't easily provide that, since the asset is stored on + disk and the disk FileSystem is not rooted at the repository root." + ^ self readStreamOn: aPath do: [:stream | ((self mapperAt: aPath) ifNil: [^ nil]) readVersionFrom: stream] \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/readMappers.st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readMappers.st new file mode 100644 index 000000000..3bcf40cd4 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readMappers.st @@ -0,0 +1,9 @@ +accessing +readMappers + "Ideally, we could use SquotMappersMapper>>loadMappersFromFileSystem: here, but that takes a FileSystem + that is rooted at the repository root. We can't easily provide that, since the asset is stored on + disk and the disk FileSystem is not rooted at the repository root." + ^ Dictionary newFrom: + (((self readStreamOn: SquotMappersMapper path do: [:stream | STON fromStream: stream]) + select: [:each | each isKindOf: SquotAssetMapper]) + collect: [:each | each path -> each]) \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/instance/readStreamOn.do..st b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readStreamOn.do..st new file mode 100644 index 000000000..8c111b7b5 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/instance/readStreamOn.do..st @@ -0,0 +1,3 @@ +accessing +readStreamOn: aPath do: aBlock + ^ (self directory resolve: (aPath relativeTo: FSPath root)) readStreamDo: aBlock \ No newline at end of file diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/methodProperties.json b/src/Squot.package/GitDirectoryAssetLoader.class/methodProperties.json new file mode 100644 index 000000000..f6a7939f9 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/methodProperties.json @@ -0,0 +1,16 @@ +{ + "class" : { + "newWithName:on:" : "mad 6/12/2024 15:37" }, + "instance" : { + "assetAt:" : "mad 6/12/2024 15:32", + "assetFSPaths" : "mad 6/12/2024 15:36", + "assetsCache" : "mad 6/12/2024 15:54", + "assetsCache:" : "mad 6/12/2024 15:54", + "directory" : "mad 6/12/2024 15:48", + "directory:" : "mad 6/12/2024 15:48", + "initialize" : "mad 6/12/2024 15:54", + "mapperAt:" : "mad 6/12/2024 15:35", + "mappers" : "mad 6/12/2024 15:33", + "readAsset:" : "mad 6/12/2024 16:30", + "readMappers" : "mad 6/12/2024 16:31", + "readStreamOn:do:" : "mad 6/12/2024 16:21" } } diff --git a/src/Squot.package/GitDirectoryAssetLoader.class/properties.json b/src/Squot.package/GitDirectoryAssetLoader.class/properties.json new file mode 100644 index 000000000..d6e66c282 --- /dev/null +++ b/src/Squot.package/GitDirectoryAssetLoader.class/properties.json @@ -0,0 +1,16 @@ +{ + "category" : "Squot-Mapper-Asset", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "directory", + "mappersCache", + "assetsCache" ], + "name" : "GitDirectoryAssetLoader", + "pools" : [ + ], + "super" : "GitNamedAssetLoader", + "type" : "normal" } diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/README.md b/src/Squot.package/GitMCRepositoryAssetLoader.class/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/class/newWithName.on..st b/src/Squot.package/GitMCRepositoryAssetLoader.class/class/newWithName.on..st new file mode 100644 index 000000000..8abad3c3a --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/class/newWithName.on..st @@ -0,0 +1,5 @@ +as yet unclassified +newWithName: aString on: aRepository + ^ (self newWithName: aString) + repository: aRepository; + yourself \ No newline at end of file diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/class/scanFor.ifAbsent..st b/src/Squot.package/GitMCRepositoryAssetLoader.class/class/scanFor.ifAbsent..st new file mode 100644 index 000000000..312fff786 --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/class/scanFor.ifAbsent..st @@ -0,0 +1,9 @@ +as yet unclassified +scanFor: aString ifAbsent: aBlock + | repository | + repository := MCRepositoryGroup default repositories + detect: [:each | + (each isKindOf: MCFilesystemFetchOnlyRepository) + and: [each projectPath endsWith: '/', aString]] + ifNone: [^ aBlock value]. + ^ self newWithName: aString on: repository \ No newline at end of file diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/directory.st b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/directory.st new file mode 100644 index 000000000..e874dfc17 --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/directory.st @@ -0,0 +1,6 @@ +accessing +directory + self directory: (self repository + projectDirectoryFrom: self repository projectPath + version: self repository projectVersion) asFSReference. + ^ super directory \ No newline at end of file diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository..st b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository..st new file mode 100644 index 000000000..b5b397b3a --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository..st @@ -0,0 +1,3 @@ +accessing +repository: anMCFilesystemFetchOnlyRepository + repository := anMCFilesystemFetchOnlyRepository \ No newline at end of file diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository.st b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository.st new file mode 100644 index 000000000..5be976386 --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository.st @@ -0,0 +1,3 @@ +accessing +repository + ^ repository \ No newline at end of file diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/methodProperties.json b/src/Squot.package/GitMCRepositoryAssetLoader.class/methodProperties.json new file mode 100644 index 000000000..e00baf224 --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/methodProperties.json @@ -0,0 +1,8 @@ +{ + "class" : { + "newWithName:on:" : "mad 6/12/2024 15:49", + "scanFor:ifAbsent:" : "mad 6/12/2024 15:49" }, + "instance" : { + "directory" : "mad 6/12/2024 16:03", + "repository" : "mad 6/12/2024 15:53", + "repository:" : "mad 6/12/2024 15:53" } } diff --git a/src/Squot.package/GitMCRepositoryAssetLoader.class/properties.json b/src/Squot.package/GitMCRepositoryAssetLoader.class/properties.json new file mode 100644 index 000000000..e3e3cff3e --- /dev/null +++ b/src/Squot.package/GitMCRepositoryAssetLoader.class/properties.json @@ -0,0 +1,14 @@ +{ + "category" : "Squot-Mapper-Asset", + "classinstvars" : [ + ], + "classvars" : [ + ], + "commentStamp" : "", + "instvars" : [ + "repository" ], + "name" : "GitMCRepositoryAssetLoader", + "pools" : [ + ], + "super" : "GitDirectoryAssetLoader", + "type" : "normal" } diff --git a/src/Squot.package/SquotMappersMapper.class/class/path.st b/src/Squot.package/SquotMappersMapper.class/class/path.st new file mode 100644 index 000000000..50cedc4be --- /dev/null +++ b/src/Squot.package/SquotMappersMapper.class/class/path.st @@ -0,0 +1,3 @@ +as yet unclassified +path + ^ FSPath / '.squot-materialize' \ No newline at end of file diff --git a/src/Squot.package/SquotMappersMapper.class/instance/path.st b/src/Squot.package/SquotMappersMapper.class/instance/path.st index 6b9bac339..464a85c36 100644 --- a/src/Squot.package/SquotMappersMapper.class/instance/path.st +++ b/src/Squot.package/SquotMappersMapper.class/instance/path.st @@ -1,3 +1,3 @@ accessing path - ^ FSPath / '.squot-materialize' \ No newline at end of file + ^ self class path \ No newline at end of file diff --git a/src/Squot.package/SquotMappersMapper.class/methodProperties.json b/src/Squot.package/SquotMappersMapper.class/methodProperties.json index 8ba401dab..c0ea101c5 100644 --- a/src/Squot.package/SquotMappersMapper.class/methodProperties.json +++ b/src/Squot.package/SquotMappersMapper.class/methodProperties.json @@ -1,6 +1,6 @@ { "class" : { - }, + "path" : "mad 6/12/2024 15:29" }, "instance" : { "addToSar:" : "mad 1/8/2024 20:54", "canBeRemoved" : "mad 2/20/2024 15:42", @@ -21,5 +21,5 @@ "mappedPaths" : "mad 10/21/2023 22:52", "mergeCommit:into:withBase:" : "mad 2/20/2024 15:11", "mergeCommit:into:withBase:in:" : "mad 2/20/2024 15:17", - "path" : "mad 9/20/2023 11:53", + "path" : "mad 6/12/2024 15:29", "referenceIn:" : "mad 9/20/2023 11:54" } }