From 73d501615d1765474e6bfe4d6e567207262a7647 Mon Sep 17 00:00:00 2001 From: Diego Ruidajo Date: Wed, 15 Sep 2021 19:37:57 -0500 Subject: [PATCH] Refactoring. --- repository/TiddlyWiki/TiddlyWiki.class.st | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index e4151d3..31ffbc7 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -18,14 +18,18 @@ Class { { #category : 'accessing' } TiddlyWiki >> addToConfigFile [ - | configDict cleaned | - configDict := STONJSON fromString: self configFile contents. + | cleaned | cleaned := self copy. cleaned tiddlers: nil. - configDict + self configDictonary at: cleaned name put: cleaned; yourself. - MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: configDict) + MarkupFile exportAsFileOn: self configFile containing:(STON toStringPretty: self configDictonary) +] + +{ #category : 'accessing' } +TiddlyWiki >> configDictonary [ + ^ STONJSON fromString: self configFile contents. ] { #category : 'accessing' } @@ -79,6 +83,12 @@ TiddlyWiki >> importJSONFile [ ]) ] +{ #category : 'accessing' } +TiddlyWiki >> loadFromConfig: wikiname [ + self configDictonary + +] + { #category : 'accessing' } TiddlyWiki >> local [ ^ self file