From e2bf46c723fd14d4e73abd0ab9b475ff959618c3 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 13 Sep 2023 14:26:28 -0300 Subject: [PATCH] Move Teapot extensions to its own package --- .../BaselineOfStargate/BaselineOfStargate.class.st | 12 +++++++----- .../TeaDynamicRouter.extension.st | 2 +- .../TeaRequest.extension.st | 2 +- .../TeaRequestMatcher.extension.st | 2 +- .../TeaResponse.extension.st | 2 +- .../TeaRoute.extension.st | 2 +- .../Teapot.extension.st | 4 ++-- source/Stargate-Teapot-Extensions/package.st | 1 + 8 files changed, 15 insertions(+), 12 deletions(-) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/TeaDynamicRouter.extension.st (79%) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/TeaRequest.extension.st (79%) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/TeaRequestMatcher.extension.st (76%) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/TeaResponse.extension.st (70%) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/TeaRoute.extension.st (74%) rename source/{Stargate-Model => Stargate-Teapot-Extensions}/Teapot.extension.st (81%) create mode 100644 source/Stargate-Teapot-Extensions/package.st diff --git a/source/BaselineOfStargate/BaselineOfStargate.class.st b/source/BaselineOfStargate/BaselineOfStargate.class.st index 01637d4..b17e0a0 100644 --- a/source/BaselineOfStargate/BaselineOfStargate.class.st +++ b/source/BaselineOfStargate/BaselineOfStargate.class.st @@ -38,11 +38,13 @@ BaselineOfStargate >> setUpCorePackages: spec [ group: 'Core' with: 'Stargate-Model'; group: 'Deployment' with: 'Stargate-Model'. - spec - package: 'Stargate-Zinc-Extensions' - with: [ spec requires: 'Stargate-Model' ]; - group: 'Core' with: 'Stargate-Zinc-Extensions'; - group: 'Deployment' with: 'Stargate-Zinc-Extensions' + #( 'Stargate-Zinc-Extensions' 'Stargate-Teapot-Extensions' ) do: [ + :extensionPackageName | + spec + package: extensionPackageName + with: [ spec requires: 'Stargate-Model' ]; + group: 'Core' with: extensionPackageName; + group: 'Deployment' with: extensionPackageName ] ] { #category : #baselines } diff --git a/source/Stargate-Model/TeaDynamicRouter.extension.st b/source/Stargate-Teapot-Extensions/TeaDynamicRouter.extension.st similarity index 79% rename from source/Stargate-Model/TeaDynamicRouter.extension.st rename to source/Stargate-Teapot-Extensions/TeaDynamicRouter.extension.st index e54bdea..9074fc6 100644 --- a/source/Stargate-Model/TeaDynamicRouter.extension.st +++ b/source/Stargate-Teapot-Extensions/TeaDynamicRouter.extension.st @@ -1,6 +1,6 @@ Extension { #name : #TeaDynamicRouter } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } TeaDynamicRouter >> removeRoutesMatchedBy: aTeaRequestMatcher [ routes removeAllSuchThat: [ :route | route isMatchedBy: aTeaRequestMatcher ] diff --git a/source/Stargate-Model/TeaRequest.extension.st b/source/Stargate-Teapot-Extensions/TeaRequest.extension.st similarity index 79% rename from source/Stargate-Model/TeaRequest.extension.st rename to source/Stargate-Teapot-Extensions/TeaRequest.extension.st index 7353b83..5bdfe7c 100644 --- a/source/Stargate-Model/TeaRequest.extension.st +++ b/source/Stargate-Teapot-Extensions/TeaRequest.extension.st @@ -1,6 +1,6 @@ Extension { #name : #TeaRequest } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } TeaRequest >> at: key ifPresent: aPresentBlock ifAbsent: anAbsentBlock [ ^ aPresentBlock cull: ( self at: key ifAbsent: [ ^ anAbsentBlock value ] ) diff --git a/source/Stargate-Model/TeaRequestMatcher.extension.st b/source/Stargate-Teapot-Extensions/TeaRequestMatcher.extension.st similarity index 76% rename from source/Stargate-Model/TeaRequestMatcher.extension.st rename to source/Stargate-Teapot-Extensions/TeaRequestMatcher.extension.st index abdf350..065dd46 100644 --- a/source/Stargate-Model/TeaRequestMatcher.extension.st +++ b/source/Stargate-Teapot-Extensions/TeaRequestMatcher.extension.st @@ -1,6 +1,6 @@ Extension { #name : #TeaRequestMatcher } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } TeaRequestMatcher >> isEquivalentTo: aRequestMatcher [ ^ self printString = aRequestMatcher printString diff --git a/source/Stargate-Model/TeaResponse.extension.st b/source/Stargate-Teapot-Extensions/TeaResponse.extension.st similarity index 70% rename from source/Stargate-Model/TeaResponse.extension.st rename to source/Stargate-Teapot-Extensions/TeaResponse.extension.st index 0855e56..e90b4e2 100644 --- a/source/Stargate-Model/TeaResponse.extension.st +++ b/source/Stargate-Teapot-Extensions/TeaResponse.extension.st @@ -1,6 +1,6 @@ Extension { #name : #TeaResponse } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } TeaResponse class >> noContent [ ^ self code: ZnStatusLine noContent code diff --git a/source/Stargate-Model/TeaRoute.extension.st b/source/Stargate-Teapot-Extensions/TeaRoute.extension.st similarity index 74% rename from source/Stargate-Model/TeaRoute.extension.st rename to source/Stargate-Teapot-Extensions/TeaRoute.extension.st index 9b90cab..9db97e4 100644 --- a/source/Stargate-Model/TeaRoute.extension.st +++ b/source/Stargate-Teapot-Extensions/TeaRoute.extension.st @@ -1,6 +1,6 @@ Extension { #name : #TeaRoute } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } TeaRoute >> isMatchedBy: aTeaRequestMatcher [ ^ requestMatcher isEquivalentTo: aTeaRequestMatcher diff --git a/source/Stargate-Model/Teapot.extension.st b/source/Stargate-Teapot-Extensions/Teapot.extension.st similarity index 81% rename from source/Stargate-Model/Teapot.extension.st rename to source/Stargate-Teapot-Extensions/Teapot.extension.st index 5805197..7e6aa8c 100644 --- a/source/Stargate-Model/Teapot.extension.st +++ b/source/Stargate-Teapot-Extensions/Teapot.extension.st @@ -1,6 +1,6 @@ Extension { #name : #Teapot } -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } Teapot >> addRouteMatchedBy: aTeaRequestMatcher action: aTeaAction [ current := dynamicRouter addRoute: ( TeaRoute matcher: aTeaRequestMatcher @@ -9,7 +9,7 @@ Teapot >> addRouteMatchedBy: aTeaRequestMatcher action: aTeaAction [ port: server port ) ] -{ #category : #'*Stargate-Model' } +{ #category : #'*Stargate-Teapot-Extensions' } Teapot >> removeRoutesMatchedBy: aTeaRequestMatcher [ dynamicRouter removeRoutesMatchedBy: aTeaRequestMatcher diff --git a/source/Stargate-Teapot-Extensions/package.st b/source/Stargate-Teapot-Extensions/package.st new file mode 100644 index 0000000..ad1cc80 --- /dev/null +++ b/source/Stargate-Teapot-Extensions/package.st @@ -0,0 +1 @@ +Package { #name : #'Stargate-Teapot-Extensions' }