From a4f8648f530108ea3305826111274679bb6ad374 Mon Sep 17 00:00:00 2001 From: Simon McConell Date: Wed, 15 Dec 2021 10:25:55 +0800 Subject: [PATCH] Allow multiple providers in Planner DSL - add .editorconfig and .gitattributes to force LF newlines so that tests can be run on Windows machines --- .editorconfig | 2 ++ .gitattributes | 1 + lib/vapor/planner.ex | 13 +++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..270106b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,2 @@ +[*] +end_of_line = lf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf diff --git a/lib/vapor/planner.ex b/lib/vapor/planner.ex index 73f9a9b..9596491 100644 --- a/lib/vapor/planner.ex +++ b/lib/vapor/planner.ex @@ -64,6 +64,19 @@ defmodule Vapor.Planner do end end + defmacro config(name, providers) when is_list(providers) do + quote do + @config_plan unquote(name) + + defp __vapor_config__(unquote(name)) do + %Group{ + name: unquote(name), + providers: unquote(providers) + } + end + end + end + defmacro config(name, provider) do quote do @config_plan unquote(name)