-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitDirectoryAssetLoader and GitMCRepositoryAssetLoader
- Loading branch information
Showing
27 changed files
with
137 additions
and
3 deletions.
There are no files selected for viewing
Empty file.
5 changes: 5 additions & 0 deletions
5
src/Squot.package/GitDirectoryAssetLoader.class/class/newWithName.on..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
instance creation | ||
newWithName: aString on: anFSReference | ||
^ (self newWithName: aString) | ||
directory: anFSReference; | ||
yourself |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/assetAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
assetAt: aPath | ||
^ self assetsCache at: aPath ifAbsentPut: [self readAsset: aPath] |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/assetFSPaths.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
assetFSPaths | ||
^ self mappers keys |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
assetsCache: aDictionary | ||
assetsCache := aDictionary. |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/assetsCache.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
assetsCache | ||
^ assetsCache |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/directory..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
directory: anFSReference | ||
directory := anFSReference |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/directory.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
directory | ||
^ directory |
4 changes: 4 additions & 0 deletions
4
src/Squot.package/GitDirectoryAssetLoader.class/instance/initialize.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
initialize-release | ||
initialize | ||
super initialize. | ||
self assetsCache: Dictionary new. |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/mapperAt..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
mapperAt: aPath | ||
^ self mappers at: aPath ifAbsent: [nil] |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/mappers.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
mappers | ||
^ mappersCache ifNil: [mappersCache := self readMappers]. |
6 changes: 6 additions & 0 deletions
6
src/Squot.package/GitDirectoryAssetLoader.class/instance/readAsset..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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] |
9 changes: 9 additions & 0 deletions
9
src/Squot.package/GitDirectoryAssetLoader.class/instance/readMappers.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]) |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitDirectoryAssetLoader.class/instance/readStreamOn.do..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
readStreamOn: aPath do: aBlock | ||
^ (self directory resolve: (aPath relativeTo: FSPath root)) readStreamDo: aBlock |
16 changes: 16 additions & 0 deletions
16
src/Squot.package/GitDirectoryAssetLoader.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" } } |
16 changes: 16 additions & 0 deletions
16
src/Squot.package/GitDirectoryAssetLoader.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"category" : "Squot-Mapper-Asset", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"directory", | ||
"mappersCache", | ||
"assetsCache" ], | ||
"name" : "GitDirectoryAssetLoader", | ||
"pools" : [ | ||
], | ||
"super" : "GitNamedAssetLoader", | ||
"type" : "normal" } |
Empty file.
5 changes: 5 additions & 0 deletions
5
src/Squot.package/GitMCRepositoryAssetLoader.class/class/newWithName.on..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
as yet unclassified | ||
newWithName: aString on: aRepository | ||
^ (self newWithName: aString) | ||
repository: aRepository; | ||
yourself |
9 changes: 9 additions & 0 deletions
9
src/Squot.package/GitMCRepositoryAssetLoader.class/class/scanFor.ifAbsent..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
6 changes: 6 additions & 0 deletions
6
src/Squot.package/GitMCRepositoryAssetLoader.class/instance/directory.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing | ||
directory | ||
self directory: (self repository | ||
projectDirectoryFrom: self repository projectPath | ||
version: self repository projectVersion) asFSReference. | ||
^ super directory |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
repository: anMCFilesystemFetchOnlyRepository | ||
repository := anMCFilesystemFetchOnlyRepository |
3 changes: 3 additions & 0 deletions
3
src/Squot.package/GitMCRepositoryAssetLoader.class/instance/repository.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
repository | ||
^ repository |
8 changes: 8 additions & 0 deletions
8
src/Squot.package/GitMCRepositoryAssetLoader.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" } } |
14 changes: 14 additions & 0 deletions
14
src/Squot.package/GitMCRepositoryAssetLoader.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "Squot-Mapper-Asset", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"repository" ], | ||
"name" : "GitMCRepositoryAssetLoader", | ||
"pools" : [ | ||
], | ||
"super" : "GitDirectoryAssetLoader", | ||
"type" : "normal" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
path | ||
^ FSPath / '.squot-materialize' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing | ||
path | ||
^ FSPath / '.squot-materialize' | ||
^ self class path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters