mirror of
https://github.com/ash-project/igniter.git
synced 2024-09-19 21:12:54 +12:00
fix: :error consistency in remove_keyword_key and argument_equals? in Config.configure (#68)
This commit is contained in:
parent
fa5f849928
commit
e860b1f9d3
2 changed files with 8 additions and 8 deletions
|
@ -215,15 +215,15 @@ defmodule Igniter.Code.Keyword do
|
||||||
if Igniter.Code.Tuple.tuple?(item) do
|
if Igniter.Code.Tuple.tuple?(item) do
|
||||||
case Igniter.Code.Tuple.tuple_elem(item, 0) do
|
case Igniter.Code.Tuple.tuple_elem(item, 0) do
|
||||||
{:ok, first_elem} ->
|
{:ok, first_elem} ->
|
||||||
Common.node_matches_pattern?(first_elem, ^key)
|
Common.nodes_equal?(first_elem, key)
|
||||||
|
|
||||||
:error ->
|
:error ->
|
||||||
false
|
:error
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end) do
|
end) do
|
||||||
:error ->
|
:error ->
|
||||||
{:ok, zipper}
|
:error
|
||||||
|
|
||||||
{:ok, zipper} ->
|
{:ok, zipper} ->
|
||||||
{:ok, zipper |> Zipper.remove()}
|
{:ok, zipper |> Zipper.remove()}
|
||||||
|
|
|
@ -400,8 +400,8 @@ defmodule Igniter.Project.Config do
|
||||||
:config,
|
:config,
|
||||||
3,
|
3,
|
||||||
fn function_call ->
|
fn function_call ->
|
||||||
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name) &&
|
Igniter.Code.Function.argument_equals?(function_call, 0, app_name) &&
|
||||||
Igniter.Code.Function.argument_matches_pattern?(function_call, 1, ^config_item)
|
Igniter.Code.Function.argument_equals?(function_call, 1, config_item)
|
||||||
end
|
end
|
||||||
) do
|
) do
|
||||||
:error ->
|
:error ->
|
||||||
|
@ -418,8 +418,8 @@ defmodule Igniter.Project.Config do
|
||||||
:config,
|
:config,
|
||||||
3,
|
3,
|
||||||
fn function_call ->
|
fn function_call ->
|
||||||
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name) &&
|
Igniter.Code.Function.argument_equals?(function_call, 0, app_name) &&
|
||||||
(Igniter.Code.Function.argument_matches_pattern?(function_call, 1, ^config_item) ||
|
(Igniter.Code.Function.argument_equals?(function_call, 1, config_item) ||
|
||||||
Igniter.Code.Function.argument_matches_predicate?(
|
Igniter.Code.Function.argument_matches_predicate?(
|
||||||
function_call,
|
function_call,
|
||||||
1,
|
1,
|
||||||
|
@ -448,7 +448,7 @@ defmodule Igniter.Project.Config do
|
||||||
:config,
|
:config,
|
||||||
2,
|
2,
|
||||||
fn function_call ->
|
fn function_call ->
|
||||||
Igniter.Code.Function.argument_matches_pattern?(function_call, 0, ^app_name)
|
Igniter.Code.Function.argument_equals?(function_call, 0, app_name)
|
||||||
end
|
end
|
||||||
) do
|
) do
|
||||||
:error ->
|
:error ->
|
||||||
|
|
Loading…
Reference in a new issue