From fb41a37e00088b44a1db941b9f6b83d5c8c7257b Mon Sep 17 00:00:00 2001 From: Tung Nguyen Date: Mon, 3 Jan 2022 22:13:13 +0000 Subject: [PATCH] pass value through untouch when expand method not defined --- lib/terraspace/plugin/expander/interface.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/terraspace/plugin/expander/interface.rb b/lib/terraspace/plugin/expander/interface.rb index 9e71eeff..cde76ae0 100644 --- a/lib/terraspace/plugin/expander/interface.rb +++ b/lib/terraspace/plugin/expander/interface.rb @@ -76,9 +76,13 @@ def strip(string) .sub('TMP_KEEP_HTTP', '://') # restore :// IE: https:// or http:// end - def var_value(name) - name = name.sub(':','').downcase - value = send(name).to_s + def var_value(unexpanded) + name = unexpanded.sub(':','').downcase + if respond_to?(name) + value = send(name).to_s + else + return unexpanded + end if name == "namespace" && Terraspace.config.layering.enable_names.expansion value = friendly_name(value) end