diff --git a/repository/BaselineOfMustache/BaselineOfMustache.class.st b/repository/BaselineOfMustache/BaselineOfMustache.class.st index 4fc99ec..3a786ba 100644 --- a/repository/BaselineOfMustache/BaselineOfMustache.class.st +++ b/repository/BaselineOfMustache/BaselineOfMustache.class.st @@ -9,18 +9,11 @@ BaselineOfMustache >> baseline: spec [ spec for: #'common' do: [ - spec project: 'JSON' with: [ - spec - className: #ConfigurationOfJSON; - versionString: #'stable'; - loads: #('default' ); - repository: 'http://smalltalkhub.com/mc/PharoExtras/JSON/main/' ]. spec package: 'Mustache-Core'; package: 'Mustache-Tests' with: [ spec requires: #('Mustache-Core' ). ]; - package: #'Mustache-Cli' with: [ - spec requires: #('JSON' ). ]. + package: #'Mustache-Cli'. spec group: 'Core' with: #('Mustache-Core' ); group: 'Tests' with: #('Mustache-Tests' ); diff --git a/repository/Mustache-Cli/MustacheCommandLineHandler.class.st b/repository/Mustache-Cli/MustacheCommandLineHandler.class.st index 61d0a8b..b11f57b 100644 --- a/repository/Mustache-Cli/MustacheCommandLineHandler.class.st +++ b/repository/Mustache-Cli/MustacheCommandLineHandler.class.st @@ -10,20 +10,21 @@ Options: [--baseDirectory] a directory where files can be found " Class { - #name : #MustacheCommandLineHandler, - #superclass : #CommandLineHandler, + #name : 'MustacheCommandLineHandler', + #superclass : 'CommandLineHandler', #instVars : [ 'baseDirectory' ], - #category : 'Mustache-Cli' + #category : 'Mustache-Cli', + #package : 'Mustache-Cli' } -{ #category : #'as yet unclassified' } +{ #category : 'as yet unclassified' } MustacheCommandLineHandler class >> commandName [ ^'mustache' ] -{ #category : #activation } +{ #category : 'activation' } MustacheCommandLineHandler >> activate [ | result template json partials | self activateHelp @@ -35,41 +36,41 @@ MustacheCommandLineHandler >> activate [ template := (self baseDirectory resolve: self templateOption) contents. partials := self partialsToDictionary: self partialsOption. result := (MustacheTemplate on: template) - value: (Json readFrom: json readStream) + value: (STONJSON fromStream: json readStream) partials: partials. self stdout nextPutAll: result. self stdout flush. self exitSuccess ] -{ #category : #activation } +{ #category : 'activation' } MustacheCommandLineHandler >> baseDirectory [ ^ baseDirectory ifNil: [ FileSystem workingDirectory ] ] -{ #category : #accessing } +{ #category : 'accessing' } MustacheCommandLineHandler >> errorFileNotFound: aString [ self help. self exitFailure: 'The file ', aString, ' was not found'. ] -{ #category : #accessing } +{ #category : 'accessing' } MustacheCommandLineHandler >> errorNeed: aString [ self help. self exitFailure: 'You need to define ', aString. ] -{ #category : #accessing } +{ #category : 'accessing' } MustacheCommandLineHandler >> jsonDataOption [ ^ self optionAt: 'data' ifAbsent: [ self errorNeed: 'data' ] ] -{ #category : #accessing } +{ #category : 'accessing' } MustacheCommandLineHandler >> partialsOption [ ^ self optionAt: 'partials' ifAbsent: [ '' ]. ] -{ #category : #private } +{ #category : 'private' } MustacheCommandLineHandler >> partialsToDictionary: aString [ | fileNames file partials name | self flag: #TODO. @@ -87,7 +88,7 @@ MustacheCommandLineHandler >> partialsToDictionary: aString [ ^ partials ] -{ #category : #accessing } +{ #category : 'accessing' } MustacheCommandLineHandler >> templateOption [ ^ self optionAt: 'template' ifAbsent: [ self errorNeed: 'template' ] ] diff --git a/repository/Mustache-Cli/package.st b/repository/Mustache-Cli/package.st index 32a90e0..79af55e 100644 --- a/repository/Mustache-Cli/package.st +++ b/repository/Mustache-Cli/package.st @@ -1 +1 @@ -Package { #name : #'Mustache-Cli' } +Package { #name : 'Mustache-Cli' }