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

fix #832 (Is metaData well exported ) #833

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
96 changes: 5 additions & 91 deletions src/BaselineOfMicrodown/BaselineOfMicrodown.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,9 @@ BaselineOfMicrodown >> baseline: spec [

<baseline>
spec for: #common do: [

self xmlParserHtml: spec.
self mustache: spec.
" I disable this because against all my best effort, I cannot avoid the fucking pop up to raise
even if I unload all the packages. I get the Microdown-RichTextComposer in conflict."

spec preLoadDoIt: #'preload:package:'.


"I disable this because in a postload
(IceRepository repositoryNamed: 'microdown') is nil and I do not get why"

spec postLoadDoIt: #'postload:package:'.

self xmlParserHtml: spec.

spec
package: #Microdown;
package: #'Microdown-Tests'
Expand Down Expand Up @@ -82,22 +71,10 @@ BaselineOfMicrodown >> baseline: spec [
package: #'Microdown-PrettyPrinter'
with: [ spec requires: #( #Microdown ) ];


package: #'Microdown-PrettyPrinter-Tests'
with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ];
with: [ spec requires: #( #'Microdown-PrettyPrinter' #'Microdown-Tests') ].

package: #'Microdown-ParentChildrenChecker' with: [
spec requires: #( #'Microdown' ) ];
package: #'Microdown-BookTester' with: [
spec requires: #( #'Microdown' ) ];
package: #'Microdown-BookTester-Tests' with: [
spec requires: #( #'Microdown-BookTester' ) ];

package: #'Microdown-Blog' with: [
spec requires: #( #'Microdown' #'Mustache') ];
package: #'Microdown-Blog-Tests' with: [
spec requires: #( #'Microdown-Blog' ) ].


"I do not want group without tests for now"
spec
group: 'Core' with: #('Microdown');
Expand All @@ -110,7 +87,6 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-DocumentBrowser'
#'Microdown-DocumentBrowser-Tests'
"

#'Microdown-Evaluator'
#'Microdown-Evaluator-Tests'
#'Microdown-PrettyPrinter'
Expand All @@ -120,72 +96,10 @@ BaselineOfMicrodown >> baseline: spec [
#'Microdown-LaTeXExporter'
#'Microdown-LaTeXExporter-Tests'
#'Microdown-Transformer'
#'Microdown-Transformer-Tests'
#'Microdown-ParentChildrenChecker'
#'Microdown-BookTester'
#'Microdown-BookTester-Tests'

);
#'Microdown-Transformer-Tests');
group: 'All' with: #('Core' 'Tests' 'Extensions' 'Microdown-Pharo-Tools' 'RichText') ]
]

{ #category : 'baselines' }
BaselineOfMicrodown >> mustache: spec [

spec baseline: 'Mustache' with: [
spec
repository: 'github://noha/mustache:v1.0/repository';
loads: #( 'Core' 'Tests' ) ]
]

{ #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 ]



]

{ #category : 'baselines' }
BaselineOfMicrodown >> preload: loader package: packageSpec [
"Ignore pre and post loads if already executed"

" the prelosing GH script cannot work because
it will remove the baseline and repository itself :)
#( 'Microdown' ) do: [ :name |
(IceRepository repositoryNamed: name)
ifNil: [ self inform: 'Project not found: ' , name ]
ifNotNil: [ :found |
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 ].
"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 ].


]

{ #category : 'external projects' }
BaselineOfMicrodown >> xmlParserHtml: spec [

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Class {
'factory',
'visitor',
'visitorClass',
'parser'
'parser',
'file'
],
#pools : [
'MicroSharedPool'
Expand Down Expand Up @@ -36,7 +37,8 @@ MicTextualMicrodownExporterTest >> setUp [
super setUp.
factory := MicMicrodownSnippetFactory new.
visitor := self visitorClass new.
parser := Microdown new
parser := Microdown new.
file := FileSystem memory / 'test.md'.
]

{ #category : 'tests-anchor' }
Expand Down Expand Up @@ -318,6 +320,24 @@ MicTextualMicrodownExporterTest >> testMetaData [
"the builder wait a collection of associotion or a dictionnary but a metaData has not that"

self verifyObtain: factory metaDataSample
]

{ #category : 'tests - list' }
MicTextualMicrodownExporterTest >> testMetaDataIsWellExported [

| newDocument |

file ensureCreateFile.
newDocument := parser parse: factory metaDataSample.
visitor visit: newDocument.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sarah on n'a pas besoin de ce fichier car on veut un test sur le convertisseur seul.
Je suis entrain de le faire.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'accord monsieur. Le premier test que j'avais fait ne contenait pas le fichier mais j'ai pensé qu'il fallait le rajouter. Merci à vous

self assert: (visitor contents includesSubstring: '"title" : "The title"') .
file writeStreamDo: [ :stream | stream nextPutAll: visitor contents ].
file delete.




]

{ #category : 'tests-header' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ MicTextualMicrodownExporter >> visitMathInline: aMicMathInline [
{ #category : 'visit - block' }
MicTextualMicrodownExporter >> visitMetaData: aMetaData [

builder metaDataFromAssociations: aMetaData body
builder metaDataFromAssociations: aMetaData body associations
]

{ #category : 'visit - format' }
Expand Down
Loading