From 75da14fc1d00831fea8a0523db85f249a66b2153 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Wed, 20 Sep 2023 11:05:37 -0300 Subject: [PATCH] Fix loading configuration from JSON in GS64 --- ...urationFromJsonSettingsFileProvider.class.st | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/source/Launchpad-Configuration/ConfigurationFromJsonSettingsFileProvider.class.st b/source/Launchpad-Configuration/ConfigurationFromJsonSettingsFileProvider.class.st index 29e3bac..4a301c8 100644 --- a/source/Launchpad-Configuration/ConfigurationFromJsonSettingsFileProvider.class.st +++ b/source/Launchpad-Configuration/ConfigurationFromJsonSettingsFileProvider.class.st @@ -21,6 +21,13 @@ ConfigurationFromJsonSettingsFileProvider class >> loading: aJsonFileReference c ^ self new initializeLoading: aJsonFileReference chainedWith: aConfigurationProvider ] +{ #category : #private } +ConfigurationFromJsonSettingsFileProvider >> asJsonPath: aConfigurationParameter [ + + ^ (aConfigurationParameter sectionsAsAttributeNames copyWith: + aConfigurationParameter attributeName) collect: #asSymbol +] + { #category : #initialization } ConfigurationFromJsonSettingsFileProvider >> initializeLoading: aFileReference chainedWith: aConfigurationProvider [ @@ -46,9 +53,11 @@ ConfigurationFromJsonSettingsFileProvider >> reloadConfiguration [ { #category : #resolving } ConfigurationFromJsonSettingsFileProvider >> valueFor: aConfigurationParameter ifFound: aPresentBlock ifNone: aFailBlock [ - ^ ( json atPath: - ( aConfigurationParameter sectionsAsAttributeNames copyWith: - aConfigurationParameter attributeName ) ) ifNil: [ - nextProvider valueFor: aConfigurationParameter ifFound: aPresentBlock ifNone: aFailBlock ] + ^ (json atPath: (self asJsonPath: aConfigurationParameter)) + ifNil: [ + nextProvider + valueFor: aConfigurationParameter + ifFound: aPresentBlock + ifNone: aFailBlock ] ifNotNil: aPresentBlock ]