diff --git a/src/Microdown-Blog-Tests/MicSingleSummarizerTest.class.st b/src/Microdown-Blog-Tests/MicSingleSummarizerTest.class.st index fddad1e1..357a1a46 100644 --- a/src/Microdown-Blog-Tests/MicSingleSummarizerTest.class.st +++ b/src/Microdown-Blog-Tests/MicSingleSummarizerTest.class.st @@ -221,7 +221,7 @@ MicSingleSummarizerTest >> testWithFromFileNil [ micSingleSummarizer verifyFromFile: root. - self assert: root fromFile equals: 'fakedFile' + self assert: root fromFile base equals: 'fakedFile' ] { #category : 'tests' } @@ -271,7 +271,7 @@ MicSingleSummarizerTest >> testWithoutFromFile [ micSingleSummarizer verifyFromFile: root. - self assert: root fromFile equals: 'fakedFile' + self assert: root fromFile basename equals: 'fakedFile' ] { #category : 'tests' } diff --git a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st index f348e9e0..9e2463fa 100644 --- a/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st +++ b/src/Microdown-BookTester-Tests/MicReferenceCheckerTest.class.st @@ -346,9 +346,7 @@ MicReferenceCheckerTest >> testDefFig1AndRefToAncS0UnknowAnchor [ visitor checkProject: defFig1AndRefToAnsC0. self deny: visitor isOkay. self assert: visitor results first anchorLabel equals: 'ancS0'. - self - assert: visitor results first source - equals: '/defFig1AndRefToAncS0.md' + self assert: visitor results first source equals: '/defFig1AndRefToAncS0.md' ] { #category : 'tests - single file ok references' } @@ -398,9 +396,8 @@ MicReferenceCheckerTest >> testDefS1ButRefersToS0UnknownAnchor [ self deny: visitor isOkay. self assert: visitor results size equals: 1. self assert: visitor results first anchorLabel equals: 'ancS0'. - self - assert: visitor results first source - equals: '/fileDefAncS1UndAncS0.md' + self assert: visitor results first source equals: '/fileDefAncS1UndAncS0.md' + ] { #category : 'tests - directory api' } @@ -503,7 +500,7 @@ MicReferenceCheckerTest >> testDuplicatedAnchorInDifferentFilesOfTheSameDir [ equals: 'ancS1'. dict := visitor results groupedBy: [ :each | each class ]. duplicated := (dict at: MicDuplicatedAnchorResult) first. - self assert: duplicated source equals: '/myDirectory/file2.md'. + self assert: visitor results first source equals: '/myDirectory/file2.md'. self assert: duplicated anchorLabel equals: 'ancS1' @@ -729,7 +726,7 @@ MicReferenceCheckerTest >> testRefersToUnkAncS1 [ self deny: visitor isOkay. self assert: visitor results size equals: 1. self assert: visitor results first anchorLabel equals: 'ancS1'. - self assert: visitor results first source equals: '/fileRefAncS1.md' + self assert: visitor results first source equals: '/fileRefAncS1.md'. ] { #category : 'tests - duplicated' } diff --git a/src/Microdown-BookTester/MicDesynchronizedCodeResult.class.st b/src/Microdown-BookTester/MicDesynchronizedCodeResult.class.st index 9a5b5e67..4d9c779a 100644 --- a/src/Microdown-BookTester/MicDesynchronizedCodeResult.class.st +++ b/src/Microdown-BookTester/MicDesynchronizedCodeResult.class.st @@ -34,7 +34,7 @@ MicDesynchronizedCodeResult >> bookContents: aString [ { #category : 'accessing' } MicDesynchronizedCodeResult >> explanation [ - ^ 'The code block body of ', originString , ' is not in sync with the version in Pharo ', pharoVersion, 'in file: ', source fromFile + ^ 'The code block body of ', originString , ' is not in sync with the version in Pharo ', pharoVersion, 'in file: ', source fullName ] { #category : 'accessing' } diff --git a/src/Microdown-BookTester/MicExampleTesterStrategy.class.st b/src/Microdown-BookTester/MicExampleTesterStrategy.class.st index 72c1c4d2..d65f00a9 100644 --- a/src/Microdown-BookTester/MicExampleTesterStrategy.class.st +++ b/src/Microdown-BookTester/MicExampleTesterStrategy.class.st @@ -40,7 +40,7 @@ MicExampleTesterStrategy >> verify: aCodeBlock [ | result | result := MicBookTestResult new. result text: aCodeBlock code. - [ result source: aCodeBlock fromFile ] + [ result source: aCodeBlock fromFile fullName] on: Error do: [ result source: nil ]. results add: result. diff --git a/src/Microdown-BookTester/MicFileCollector.class.st b/src/Microdown-BookTester/MicFileCollector.class.st index b9543dc1..1164e895 100644 --- a/src/Microdown-BookTester/MicFileCollector.class.st +++ b/src/Microdown-BookTester/MicFileCollector.class.st @@ -68,7 +68,7 @@ MicFileCollector >> visitRoot: micDocument [ [ worklist isEmpty ] whileFalse: [ | currentDocument | currentDocument := worklist removeFirst. - visitedFileStrings add: currentDocument fromFile. + visitedFileStrings add: currentDocument fromFile fullName. currentDocument resolveYourself. visitedFiles add: currentDocument. diff --git a/src/Microdown-BookTester/MicReferenceChecker.class.st b/src/Microdown-BookTester/MicReferenceChecker.class.st index bf0ba975..f51b1247 100644 --- a/src/Microdown-BookTester/MicReferenceChecker.class.st +++ b/src/Microdown-BookTester/MicReferenceChecker.class.st @@ -44,7 +44,7 @@ MicReferenceChecker >> addBadReferenceAnchor: anAnchorReference [ micResultInstance := MicUndefinedAnchorResult new. micResultInstance anchorLabel: anAnchorReference anchorLabel; - source: anAnchorReference fromFile. + source: anAnchorReference fromFile fullName. results add: micResultInstance ] @@ -55,7 +55,7 @@ MicReferenceChecker >> addDuplicatedAnchor: anAnchor [ micResultInstance := MicDuplicatedAnchorResult new. micResultInstance anchorLabel: anAnchor anchorLabel; - source: anAnchor fromFile. + source: anAnchor fromFile fullName. results add: micResultInstance ] @@ -133,7 +133,7 @@ MicReferenceChecker >> handleAnchorOf: anElement [ MicReferenceChecker >> handleUndefinedFilesFrom: collector [ collector unexistingFiles do: [ :each | - results add: (MicUndefinedInputFileResult new inputFileBlock: each ; source: each fromFile ; yourself ) + results add: (MicUndefinedInputFileResult new inputFileBlock: each ; source: each fromFile fullName; yourself ) ] ] diff --git a/src/Microdown-Tests/MicFileResourceReferenceTest.class.st b/src/Microdown-Tests/MicFileResourceReferenceTest.class.st index 147aacb8..286d0bb9 100644 --- a/src/Microdown-Tests/MicFileResourceReferenceTest.class.st +++ b/src/Microdown-Tests/MicFileResourceReferenceTest.class.st @@ -160,7 +160,7 @@ MicFileResourceReferenceTest >> testContentsOfDirectory [ MicFileResourceReferenceTest >> testContentsSet [ |ref header | ref := (MicResourceReference fromUri: 'file:/example.md') - filesystem: filesystem. + fileSystem: filesystem. ref contents: '### Super cool header'. header := ref loadMicrodown children first. self assert: header level equals: 3. @@ -216,7 +216,7 @@ MicFileResourceReferenceTest >> testLoadImage [ | ref image | ref := (MicResourceReference fromUri: 'file:/toplevel.png') - filesystem: filesystem. + fileSystem: filesystem. image := ref loadImage. self assert: image isNotNil. self assert: image height equals: 90. @@ -227,7 +227,7 @@ MicFileResourceReferenceTest >> testLoadImage [ MicFileResourceReferenceTest >> testLoadMicrodown [ | ref doc | ref := (MicResourceReference fromUri: 'file:/readme.md') - filesystem: filesystem. + fileSystem: filesystem. doc := ref loadMicrodown. self assert: doc children first class equals: MicHeaderBlock. self assert: doc children first text equals: 'Test documents' @@ -238,7 +238,7 @@ MicFileResourceReferenceTest >> testLoadMicrodown [ MicFileResourceReferenceTest >> testLoadNotCorrectImage [ | ref | ref := (MicResourceReference fromUri: 'file:/readme.md') - filesystem: filesystem . + fileSystem: filesystem . self should: [ref loadImage] raise: UnrecognizedImageFormatError @@ -249,7 +249,7 @@ MicFileResourceReferenceTest >> testLoadNotCorrectMicrodown [ | ref | ref := (MicResourceReference fromUri: 'file:///toplevel.png') - filesystem: filesystem. + fileSystem: filesystem. self should: [ ref loadMicrodown ] raise: ZnInvalidUTF8 @@ -259,7 +259,7 @@ MicFileResourceReferenceTest >> testLoadNotCorrectMicrodown [ MicFileResourceReferenceTest >> testLoadNotFoundImage [ | ref | - ref := (MicResourceReference fromUri: 'file:///readme.md') filesystem: emptyFilesystem. + ref := (MicResourceReference fromUri: 'file:///readme.md') fileSystem: emptyFilesystem. [ ref loadImage. self fail @@ -271,7 +271,7 @@ MicFileResourceReferenceTest >> testLoadNotFoundImage [ MicFileResourceReferenceTest >> testLoadNotFoundMicrodown [ | uri ref | uri := 'file:///readme.md'. - ref := (MicResourceReference fromUri: uri) filesystem: emptyFilesystem. + ref := (MicResourceReference fromUri: uri) fileSystem: emptyFilesystem. [ ref loadMicrodown. diff --git a/src/Microdown-Tests/MicZincPathResolverTest.class.st b/src/Microdown-Tests/MicZincPathResolverTest.class.st index e4ea15ab..148bb6fd 100644 --- a/src/Microdown-Tests/MicZincPathResolverTest.class.st +++ b/src/Microdown-Tests/MicZincPathResolverTest.class.st @@ -17,13 +17,13 @@ MicZincPathResolverTest >> testVisitFileImage [ self assert: imageNode reference isRelative. self assert: imageNode reference relativePath equals: 'images/pharo.png'. absoluteFile := (MicResourceReference fromUri: 'file:/my/deep/directory/sourceFile.md') - filesystem: #Bogus; + fileSystem: #Bogus; yourself. MicZincPathResolver resolve: doc withBase: absoluteFile. self assert: imageNode reference isRelative not. self assert: imageNode reference uriString equals: 'file:///my/deep/directory/images/pharo.png'. - self assert: imageNode reference filesystem equals: #Bogus + self assert: imageNode reference fileSystem equals: #Bogus ] { #category : 'tests' } diff --git a/src/Microdown-Tests/MicrodownTest.class.st b/src/Microdown-Tests/MicrodownTest.class.st index eda06612..c7e78c0a 100644 --- a/src/Microdown-Tests/MicrodownTest.class.st +++ b/src/Microdown-Tests/MicrodownTest.class.st @@ -76,7 +76,7 @@ MicrodownTest >> testFromFileInAnyElement [ | root | root := Microdown parseFile: filesystem workingDirectory / 'anExample1.md'. - self assert: root children first children first fromFile equals: (filesystem workingDirectory / 'anExample1.md') fullName . + self assert: root children first children first fromFile fullName equals: (filesystem workingDirectory / 'anExample1.md') fullName . ] @@ -85,7 +85,7 @@ MicrodownTest >> testFromFileInRootDocument [ | root | root := Microdown parseFile: filesystem workingDirectory / 'anExample1.md'. - self assert: root fromFile equals: (filesystem workingDirectory / 'anExample1.md') fullName + self assert: root fromFile fullName equals: (filesystem workingDirectory / 'anExample1.md') fullName ] diff --git a/src/Microdown-Transformer-Tests/MicFileIncluderTest.class.st b/src/Microdown-Transformer-Tests/MicFileIncluderTest.class.st index d108c9ed..d49f752e 100644 --- a/src/Microdown-Transformer-Tests/MicFileIncluderTest.class.st +++ b/src/Microdown-Transformer-Tests/MicFileIncluderTest.class.st @@ -54,7 +54,7 @@ MicFileIncluderTest >> testBeforeIncludingTheInputFile [ setStream: stream; inputFile: 'anExample1.md' ]. - reference := (MicResourceReference fromUri: 'file:///test.md') filesystem: filesystem . + reference := (MicResourceReference fromUri: 'file:///test.md') fileSystem: filesystem . root := reference loadMicrodown. self assert: root children first class equals: MicInputfileBlock. @@ -111,7 +111,7 @@ MicFileIncluderTest >> testHandleNestedFileResolution [ header: [ builder text: 'Example2' ] withLevel: 1 ]. reference := (MicResourceReference fromUri: - 'file:///Chapters/SUnit.md') filesystem: filesystem. + 'file:///Chapters/SUnit.md') fileSystem: filesystem. includer topFile: reference fileReference parent. includer visit: (root := reference loadMicrodown). @@ -158,7 +158,7 @@ MicFileIncluderTest >> testHandleNestedFileResolutionOnDifferentLevel [ header: [ builder text: 'Example2' ] withLevel: 1 ]. reference := (MicResourceReference fromUri: - 'file:///Chapters/SUnit.md') filesystem: filesystem. + 'file:///Chapters/SUnit.md') fileSystem: filesystem. includer topFile: reference fileReference parent. includer visit: (root := reference loadMicrodown). @@ -198,7 +198,7 @@ MicFileIncluderTest >> testIncluderIncludesInputFileFromTheSameLevel [ inputfile: 'anExample1.md' ]. reference := (MicResourceReference fromUri: - 'file:///Chapters/SUnit/SUnit.md') filesystem: + 'file:///Chapters/SUnit/SUnit.md') fileSystem: filesystem. root := reference loadMicrodown. @@ -228,7 +228,7 @@ MicFileIncluderTest >> testIncluderIncludesInputFilesWithinTheSameParagraph [ inputfile: 'anExample1.md'; inputfile: 'anExample2.md' ]. reference := (MicResourceReference fromUri: 'file:///test.md') - filesystem: filesystem. + fileSystem: filesystem. root := reference loadMicrodown. includer visit: root. @@ -259,7 +259,7 @@ MicFileIncluderTest >> testIncluderJustReturnInputFileBlockWhenIncludedFileDoesN setStream: stream; inputfile: 'anExample3.md']. - reference := (MicResourceReference fromUri: 'file:///test.md') filesystem: filesystem. + reference := (MicResourceReference fromUri: 'file:///test.md') fileSystem: filesystem. root := reference loadMicrodown. includer beRelaxed. @@ -279,7 +279,7 @@ MicFileIncluderTest >> testMicFileInclusionTransformMicInputFiles [ inputfile: 'anExample1.md'; paragraph: ''; inputfile: 'anExample2.md' ]. - reference := (MicResourceReference fromUri: 'file:///test.md') filesystem: filesystem. + reference := (MicResourceReference fromUri: 'file:///test.md') fileSystem: filesystem. root := reference loadMicrodown. includer visit: root. diff --git a/src/Microdown/MicFileResourceReference.class.st b/src/Microdown/MicFileResourceReference.class.st index e26acd65..7bd6811a 100644 --- a/src/Microdown/MicFileResourceReference.class.st +++ b/src/Microdown/MicFileResourceReference.class.st @@ -20,7 +20,7 @@ Class { #name : 'MicFileResourceReference', #superclass : 'MicAbsoluteResourceReference', #instVars : [ - 'filesystem' + 'fileSystem' ], #category : 'Microdown-Core', #package : 'Microdown', @@ -36,7 +36,7 @@ MicFileResourceReference class >> fromFileRef: aFileReference [ ifTrue: [ znUrl addPathSegment: $/ "Yes, a Character not a string" ]. ^ self new uri: znUrl; - filesystem: aFileReference fileSystem + fileSystem: aFileReference fileSystem ] { #category : 'instance creation' } @@ -77,18 +77,18 @@ MicFileResourceReference >> contents: aString [ { #category : 'accessing' } MicFileResourceReference >> fileReference [ - ^ self filesystem referenceTo: self path + ^ self fileSystem referenceTo: self path ] { #category : 'accessing' } -MicFileResourceReference >> filesystem [ - ^ filesystem +MicFileResourceReference >> fileSystem [ + ^ fileSystem ] { #category : 'accessing' } -MicFileResourceReference >> filesystem: anObject [ +MicFileResourceReference >> fileSystem: anObject [ - filesystem := anObject + fileSystem := anObject ] { #category : 'accessing' } @@ -99,7 +99,7 @@ MicFileResourceReference >> fullName [ { #category : 'initialization' } MicFileResourceReference >> initialize [ super initialize. - filesystem := FileSystem disk. + fileSystem := FileSystem disk. ] { #category : 'accessing' } diff --git a/src/Microdown/MicRootBlock.class.st b/src/Microdown/MicRootBlock.class.st index 160b58eb..829299d4 100644 --- a/src/Microdown/MicRootBlock.class.st +++ b/src/Microdown/MicRootBlock.class.st @@ -38,10 +38,10 @@ MicRootBlock >> fromFile [ ] { #category : 'accessing' } -MicRootBlock >> fromFile: aFile [ +MicRootBlock >> fromFile: aFileReference [ "Store the file from which the document was built" - self propertyAt: #file put: aFile + self propertyAt: #file put: (aFileReference ifNotNil: [aFileReference asFileReference]) ] { #category : 'accessing' } diff --git a/src/Microdown/MicZincPathResolver.class.st b/src/Microdown/MicZincPathResolver.class.st index bd21b21b..b5c1edbd 100644 --- a/src/Microdown/MicZincPathResolver.class.st +++ b/src/Microdown/MicZincPathResolver.class.st @@ -55,7 +55,7 @@ MicZincPathResolver >> resolveReferenceIn: aNode [ aNode reference isRelative ifFalse: [ ^ self ]. resolvedUri := absoluteReference uri withRelativeReference: aNode reference relativePath. resolvedReference := MicResourceReference fromUri: resolvedUri printString. - resolvedReference isMicrodownResourceFileReference ifTrue: [ resolvedReference filesystem: absoluteReference filesystem ]. + resolvedReference isMicrodownResourceFileReference ifTrue: [ resolvedReference fileSystem: absoluteReference fileSystem ]. aNode reference: resolvedReference ] diff --git a/src/Microdown/Microdown.class.st b/src/Microdown/Microdown.class.st index 9fb1fff2..509de398 100644 --- a/src/Microdown/Microdown.class.st +++ b/src/Microdown/Microdown.class.st @@ -156,7 +156,7 @@ Microdown >> parseFile: aFile [ |root| root := MicrodownParser parse: aFile contents. - root fromFile: aFile fullName. + root fromFile: aFile. ^ root ]