From bddce99e3fcebbe9d8835bcd2e7f3333be8d9ea9 Mon Sep 17 00:00:00 2001 From: Mateus Date: Sun, 4 Aug 2024 10:03:41 -0300 Subject: [PATCH] change "InsertFunction.insert" to "InsertFunction.config" --- src/Install.elm | 2 +- src/Install/Function/InsertFunction.elm | 12 ++++++------ tests/Install/FunctionTest.elm | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Install.elm b/src/Install.elm index 9f9251f..bea36e2 100644 --- a/src/Install.elm +++ b/src/Install.elm @@ -87,7 +87,7 @@ addElementToList = AddElementToList -{-| Insert a function, defined by [`Install.Function.InsertFunction.insert`](Install-Function-InsertFunction#insert). +{-| Insert a function, defined by [`Install.Function.InsertFunction.config`](Install-Function-InsertFunction#config). -} insertFunction : Install.Function.InsertFunction.Config -> Installation insertFunction = diff --git a/src/Install/Function/InsertFunction.elm b/src/Install/Function/InsertFunction.elm index a32c028..24386ba 100644 --- a/src/Install/Function/InsertFunction.elm +++ b/src/Install/Function/InsertFunction.elm @@ -1,5 +1,5 @@ module Install.Function.InsertFunction exposing - ( insert + ( config , Config, withInsertAfter ) @@ -7,7 +7,7 @@ module Install.Function.InsertFunction exposing -- code for ReviewConfig.elm: rule = - Install.Function.InsertFunction.insert + Install.Function.InsertFunction.config "Frontend" "view" """view model = @@ -19,13 +19,13 @@ Running this rule will insert the function `view` in the module `Frontend` with The form of the rule is the same for nested modules: rule = - Install.Function.InsertFunction.insert + Install.Function.InsertFunction.config "Foo.Bar" "earnInterest" "hoho model = { model | interest = 1.03 * model.interest }" |> Install.insertFunction -@docs insert +@docs config @docs Config, withInsertAfter -} @@ -41,8 +41,8 @@ type alias Config = {-| Initialize the configuration for the rule. -} -insert : String -> String -> String -> Config -insert hostModuleName functionName functionImplementation = +config : String -> String -> String -> Config +config hostModuleName functionName functionImplementation = Internal.Config { hostModuleName = String.split "." hostModuleName , functionName = functionName diff --git a/tests/Install/FunctionTest.elm b/tests/Install/FunctionTest.elm index 71e044e..b3c58df 100644 --- a/tests/Install/FunctionTest.elm +++ b/tests/Install/FunctionTest.elm @@ -210,7 +210,7 @@ test2 = rule2 : Installation rule2 = - InsertFunction.insert + InsertFunction.config "Frontend" "newFunction" """newFunction model = @@ -263,7 +263,7 @@ test2a = rule2a : Installation rule2a = - InsertFunction.insert + InsertFunction.config "Frontend" "makeLinks" makeLinks @@ -327,7 +327,7 @@ type alias Model = rule3 : Installation rule3 = - InsertFunction.insert + InsertFunction.config "Frontend" "newFunction" """newFunction model = @@ -371,7 +371,7 @@ test4 = rule4 : Installation rule4 = - InsertFunction.insert + InsertFunction.config "Frontend" "newFunction" """newFunction model = @@ -418,7 +418,7 @@ test4a = rule4a : Installation rule4a = - InsertFunction.insert + InsertFunction.config "Frontend" "newFunction" """newFunction model = @@ -464,7 +464,7 @@ test4b = rule4b : Installation rule4b = - InsertFunction.insert + InsertFunction.config "Frontend" "newFunction" """newFunction model =