Skip to content

Commit

Permalink
Move Teapot extensions to its own package
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Sep 13, 2023
1 parent 499f70a commit e2bf46c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 12 deletions.
12 changes: 7 additions & 5 deletions source/BaselineOfStargate/BaselineOfStargate.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #TeaDynamicRouter }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-Teapot-Extensions' }
TeaDynamicRouter >> removeRoutesMatchedBy: aTeaRequestMatcher [

routes removeAllSuchThat: [ :route | route isMatchedBy: aTeaRequestMatcher ]
Expand Down
Original file line number Diff line number Diff line change
@@ -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 ] )
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #TeaRequestMatcher }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-Teapot-Extensions' }
TeaRequestMatcher >> isEquivalentTo: aRequestMatcher [

^ self printString = aRequestMatcher printString
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #TeaResponse }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-Teapot-Extensions' }
TeaResponse class >> noContent [

^ self code: ZnStatusLine noContent code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Extension { #name : #TeaRoute }

{ #category : #'*Stargate-Model' }
{ #category : #'*Stargate-Teapot-Extensions' }
TeaRoute >> isMatchedBy: aTeaRequestMatcher [

^ requestMatcher isEquivalentTo: aTeaRequestMatcher
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions source/Stargate-Teapot-Extensions/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Stargate-Teapot-Extensions' }

0 comments on commit e2bf46c

Please sign in to comment.