Skip to content

Commit

Permalink
fixing circular dependency by creating chest examples in the Chest
Browse files Browse the repository at this point in the history
…class initialization
  • Loading branch information
adri09070 committed Apr 23, 2024
1 parent 357cf7e commit 90af337
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
25 changes: 5 additions & 20 deletions src/BaselineOfChest/BaselineOfChest.class.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Class {
#name : #BaselineOfChest,
#superclass : #BaselineOf,
#category : #BaselineOfChest
#name : 'BaselineOfChest',
#superclass : 'BaselineOf',
#category : 'BaselineOfChest',
#package : 'BaselineOfChest'
}

{ #category : #baselines }
{ #category : 'baselines' }
BaselineOfChest >> baseline: spec [

<baseline>
spec for: #common do: [
spec postLoadDoIt: #postload:package:.

spec
package: 'Chest';
Expand All @@ -22,18 +22,3 @@ BaselineOfChest >> baseline: spec [
with:
#( 'Chest' 'Chest-Commands' 'Chest-Tests' 'Chest-Commands-Tests' )
]

{ #category : #baselines }
BaselineOfChest >> createChestExamples [

Chest at: 'fortyTwo' put: 42.
(Chest newNamed: 'ExampleChest')
at: 'tata'
put: 'someExampleStringCalledTata'
]

{ #category : #baselines }
BaselineOfChest >> postload: loader package: packageSpec [

self createChestExamples
]
2 changes: 1 addition & 1 deletion src/BaselineOfChest/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : #BaselineOfChest }
Package { #name : 'BaselineOfChest' }
14 changes: 13 additions & 1 deletion src/Chest/Chest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,16 @@ Chest class >> contents [
^ self defaultInstance contents
]

{ #category : 'examples' }
Chest class >> createChestExamples [

<script>
Chest at: 'fortyTwo' put: 42.
(Chest newNamed: 'ExampleChest')
at: 'tata'
put: 'someExampleStringCalledTata'
]

{ #category : 'accessing' }
Chest class >> default [

Expand Down Expand Up @@ -245,7 +255,9 @@ Chest class >> initialize [

ChestDictionary := Dictionary new.
nextAvailableID := 1.
defaultInstance := nil
defaultInstance := nil.

self createChestExamples
]

{ #category : 'class initialization' }
Expand Down

0 comments on commit 90af337

Please sign in to comment.