Skip to content

Commit

Permalink
change "InsertFunction.insert" to "InsertFunction.config"
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfpleite committed Aug 4, 2024
1 parent a3ee6f1 commit bddce99
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Install.elm
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
12 changes: 6 additions & 6 deletions src/Install/Function/InsertFunction.elm
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Install.Function.InsertFunction exposing
( insert
( config
, Config, withInsertAfter
)

{-| Add a function in a given module if it is not present.
-- code for ReviewConfig.elm:
rule =
Install.Function.InsertFunction.insert
Install.Function.InsertFunction.config
"Frontend"
"view"
"""view model =
Expand All @@ -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
-}
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/Install/FunctionTest.elm
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ test2 =
rule2 : Installation
rule2 =
InsertFunction.insert
InsertFunction.config
"Frontend"
"newFunction"
"""newFunction model =
Expand Down Expand Up @@ -263,7 +263,7 @@ test2a =

rule2a : Installation
rule2a =
InsertFunction.insert
InsertFunction.config
"Frontend"
"makeLinks"
makeLinks
Expand Down Expand Up @@ -327,7 +327,7 @@ type alias Model =

rule3 : Installation
rule3 =
InsertFunction.insert
InsertFunction.config
"Frontend"
"newFunction"
"""newFunction model =
Expand Down Expand Up @@ -371,7 +371,7 @@ test4 =

rule4 : Installation
rule4 =
InsertFunction.insert
InsertFunction.config
"Frontend"
"newFunction"
"""newFunction model =
Expand Down Expand Up @@ -418,7 +418,7 @@ test4a =
rule4a : Installation
rule4a =
InsertFunction.insert
InsertFunction.config
"Frontend"
"newFunction"
"""newFunction model =
Expand Down Expand Up @@ -464,7 +464,7 @@ test4b =

rule4b : Installation
rule4b =
InsertFunction.insert
InsertFunction.config
"Frontend"
"newFunction"
"""newFunction model =
Expand Down

0 comments on commit bddce99

Please sign in to comment.