Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve postload to not break the Pharo bootstrap #909

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 11 additions & 24 deletions src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,13 @@ BaselineOfMicrodown >> mustache: spec [
{ #category : 'baselines' }
BaselineOfMicrodown >> postload: loader package: packageSpec [

| p |
self class name, ' postload ' traceCr.

p := (IceRepository repositoryNamed: 'microdown').
p ifNil: [ p := (IceRepository repositoryNamed: 'Microdown') ].
[
(p ifNotNil: [ :p2 | (p2 packageNamed: 'BaselineOfMicrodown') reload ])
]
on: MCMergeOrLoadWarning
do: [ :ex | ex load ]



"If it is absent it's because we are in the Pharo bootstrap"
self class environment at: #IceRepository ifPresent: [ :class |
| repository |
repository := (class repositoryNamed: 'microdown') ifNil: [ class repositoryNamed: 'Microdown' ].
[ repository ifNotNil: [ (repository packageNamed: 'BaselineOfMicrodown') reload ] ]
on: MCMergeOrLoadWarning
do: [ :ex | ex load ] ]
]

{ #category : 'baselines' }
Expand All @@ -175,21 +169,14 @@ BaselineOfMicrodown >> preload: loader package: packageSpec [
found
unload;
forget ] ]"

| packagesToUnload |
self class name, ' preload ' traceCr.
packagesToUnload := ((PackageOrganizer default packages
select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ])
reject: [ :each |
#('Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests') includes: each ].
packagesToUnload := ((PackageOrganizer default packages select: [ :each | each name beginsWith: 'Microdown' ]) collect: [ :each | each name ]) reject: [ :each |
#( 'Microdown-RichTextPresenter' 'Microdown-RichTextPresenter-Tests' ) includes: each ].
"these two are not managed by the microdown repo but the documentation.
I should rename them in the future to avoid confusion"

packagesToUnload do:
[ :each |
((IceRepository repositoryNamed: 'Microdown') packageNamed: each) unload ].


packagesToUnload do: [ :each | ((IceRepository repositoryNamed: 'Microdown') packageNamed: each) unload ]
]

{ #category : 'external projects' }
Expand Down
Loading