From 2f3115ff860919622ce8b24e1b791e6934f051d6 Mon Sep 17 00:00:00 2001 From: Yann Le Goff Date: Thu, 18 Jul 2024 15:05:58 +0200 Subject: [PATCH] Fix bugs --- .../BlGridLayoutSpec.extension.st | 11 +++++++++++ src/Bloc-Serialization/TBlSerializer.trait.st | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st diff --git a/src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st b/src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st new file mode 100644 index 0000000..d9f5e3c --- /dev/null +++ b/src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st @@ -0,0 +1,11 @@ +Extension { #name : #BlGridLayoutSpec } + +{ #category : #'*Bloc-Serialization-STON' } +BlGridLayoutSpec class >> fromSton: stonReader [ + "Create a new instance and delegate decoding to instance side. + Override only when new instance should be created directly (see implementors). " + + ^ (self start: UNDEFINED) + fromSton: stonReader; + yourself +] diff --git a/src/Bloc-Serialization/TBlSerializer.trait.st b/src/Bloc-Serialization/TBlSerializer.trait.st index f0228f5..6bfc6d2 100644 --- a/src/Bloc-Serialization/TBlSerializer.trait.st +++ b/src/Bloc-Serialization/TBlSerializer.trait.st @@ -1,6 +1,6 @@ Trait { #name : #TBlSerializer, - #category : #'Bloc-Serialization' + #category : #'Bloc-Serialization-Core' } { #category : #serialization } @@ -9,7 +9,7 @@ TBlSerializer classSide >> materialize: aString [ | blElement | aString isString not ifTrue:[ BlocMaterializationError signal: 'Cannot materialize a no String object into BlElement' ]. "Try to materialize and catch an error into a BlocMaterialization error" - [ blElement := STON fromString: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ]. + [ blElement := self materializeImplementation: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ]. blElement ifNil:[ BlocMaterializationError signal: 'Bloc materialization result is nil' ]. ^ blElement @@ -25,7 +25,7 @@ TBlSerializer classSide >> serialize: aBlElementOrABlElementsCollection [ ifFalse: [ self verifyElement: aBlElementOrABlElementsCollection ]. "Try to serialize and catch an error into a BlocSerialization error" - [ string := STON toStringPretty: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ]. + [ string := self serializeImplementation: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ]. ^ string ]