From 8d33c0181a78ec8ffd7fc5b867b79227db7f4631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20H=2E=20Fjeld?= Date: Mon, 11 Nov 2024 13:26:14 +0100 Subject: [PATCH 1/2] chore: Update .gitignore with aider and env files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index e29dae7..4ed7ed8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,5 @@ # Libraries don't need dependency lock # Dependencies will be locked in application that uses them /shard.lock +.aider* +.env From fc8dbcf53eb9eb8eb5cad21adc73c699ec0d035f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20H=2E=20Fjeld?= Date: Mon, 11 Nov 2024 13:32:15 +0100 Subject: [PATCH 2/2] feat: Add support for unquoted and empty environment variables --- spec/fixtures/parse_sample.env | 4 +++- spec/spec_helper.cr | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/fixtures/parse_sample.env b/spec/fixtures/parse_sample.env index afc15d2..8621fe6 100644 --- a/spec/fixtures/parse_sample.env +++ b/spec/fixtures/parse_sample.env @@ -29,6 +29,8 @@ MULTIPLE_VARIABLE2=$STR$INT1 SINGLE_BLOCK_VARIABLE=${STR}${INT} SINGLE_QUOTES_VARIABLE='hello $STR!' DOUBLE_QUOTES_VARIABLE="hello ${STR}, my email is $USERNAME" +UNQUOTED_VARIABLE=Hello there! +EMPTY_VARIABLE= LIST_STR='foo,bar' LIST_STR_WITH_SPACES=' foo, bar' @@ -38,4 +40,4 @@ DICT_STR=key1=val1, key2=val2 DICT_INT=key1=1, key2=2 JSON='{"foo": "bar", "baz": [1, 2, 3]}' RETAIN_INNER_QUOTES={"foo": "bar"} -RETAIN_INNER_QUOTES_AS_STRING='{"foo": "bar"}' \ No newline at end of file +RETAIN_INNER_QUOTES_AS_STRING='{"foo": "bar"}' diff --git a/spec/spec_helper.cr b/spec/spec_helper.cr index a4dcf33..f9bf48a 100644 --- a/spec/spec_helper.cr +++ b/spec/spec_helper.cr @@ -38,6 +38,8 @@ def it_equal_group(data = nil, file = __FILE__, line = __LINE__) it_equal data, "SINGLE_BLOCK_VARIABLE", "foo42", file, line it_equal data, "SINGLE_QUOTES_VARIABLE", "hello $STR!", file, line it_equal data, "DOUBLE_QUOTES_VARIABLE", "hello foo, my email is user@example.com", file, line + it_equal data, "UNQUOTED_VARIABLE", "Hello there!", file, line + it_equal data, "EMPTY_VARIABLE", "", file, line end def it_equal(data, key, expected, file = __FILE__, line = __LINE__)