Error out early if invalid paramter is provided.
This commit is contained in:
@@ -9,11 +9,21 @@ defmodule Mix.Tasks.Meditate do
|
|||||||
|
|
||||||
Options.start(args)
|
Options.start(args)
|
||||||
|
|
||||||
modules = Runner.modules_to_run
|
Options.initial_koan
|
||||||
Tracker.start(modules)
|
|> ok?
|
||||||
Runner.run(modules)
|
|> Runner.modules_to_run
|
||||||
|
|> Tracker.start
|
||||||
|
|> Runner.run
|
||||||
|
|
||||||
:timer.sleep(:infinity)
|
:timer.sleep(:infinity)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
defp ok?(koan) do
|
||||||
|
if Runner.koan?(koan) do
|
||||||
|
koan
|
||||||
|
else
|
||||||
|
Display.invalid_koan(koan, Runner.modules)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ defmodule Tracker do
|
|||||||
|> Enum.count
|
|> Enum.count
|
||||||
|
|
||||||
Agent.start_link(fn -> {total, MapSet.new()} end, name: __MODULE__)
|
Agent.start_link(fn -> {total, MapSet.new()} end, name: __MODULE__)
|
||||||
|
modules
|
||||||
end
|
end
|
||||||
|
|
||||||
def get do
|
def get do
|
||||||
|
|||||||
Reference in New Issue
Block a user