Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Spark.InfoGenerator #90

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/spark/info_generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,15 @@ defmodule Spark.InfoGenerator do

if unquote(is_nil(option.default)) do
def unquote(option.function_name)(dsl_or_extended) do
import Spark.Dsl.Extension, only: [get_opt: 3]
import Spark.Dsl.Extension, only: [fetch_opt: 3]

case get_opt(
case fetch_opt(
dsl_or_extended,
unquote(option.path),
unquote(option.name)
) do
:error -> :error
value -> {:ok, value}
{:ok, value} -> {:ok, value}
end
end
else
Expand All @@ -222,7 +222,7 @@ defmodule Spark.InfoGenerator do
unquote(option.name)
) do
:error -> {:ok, unquote(option.default)}
value -> {:ok, value}
{:ok, value} -> {:ok, value}
end
end
end
Expand All @@ -244,7 +244,7 @@ defmodule Spark.InfoGenerator do
on = get_persisted(dsl_or_extended, :module)
raise "No configuration for `#{unquote(option.name)}` present on #{inspect(on)}"

value ->
{:ok, value} ->
value
end
end
Expand All @@ -260,7 +260,7 @@ defmodule Spark.InfoGenerator do
:error ->
unquote(option.default)

value ->
{:ok, value} ->
value
end
end
Expand Down
Loading