add .formatter.exs + format
This commit is contained in:
@@ -2,7 +2,7 @@ defmodule Watcher do
|
||||
use GenServer
|
||||
|
||||
def start_link() do
|
||||
GenServer.start_link(__MODULE__, [dirs: ["lib/koans"]])
|
||||
GenServer.start_link(__MODULE__, dirs: ["lib/koans"])
|
||||
end
|
||||
|
||||
def init(args) do
|
||||
@@ -11,10 +11,11 @@ defmodule Watcher do
|
||||
{:ok, %{watcher_pid: watcher_pid}}
|
||||
end
|
||||
|
||||
def handle_info({:file_event, watcher_pid, {path, events}}, %{watcher_pid: watcher_pid}=state) do
|
||||
def handle_info({:file_event, watcher_pid, {path, events}}, %{watcher_pid: watcher_pid} = state) do
|
||||
if Enum.member?(events, :modified) do
|
||||
path |> normalize |> reload
|
||||
end
|
||||
|
||||
{:noreply, state}
|
||||
end
|
||||
|
||||
@@ -22,11 +23,11 @@ defmodule Watcher do
|
||||
if Path.extname(file) == ".ex" do
|
||||
try do
|
||||
file
|
||||
|> Code.load_file
|
||||
|> Enum.map(&(elem(&1, 0)))
|
||||
|> Code.load_file()
|
||||
|> Enum.map(&elem(&1, 0))
|
||||
|> Enum.find(&Runner.koan?/1)
|
||||
|> Runner.modules_to_run
|
||||
|> Runner.run
|
||||
|> Runner.modules_to_run()
|
||||
|> Runner.run()
|
||||
rescue
|
||||
e -> Display.show_compile_error(e)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user