Get rid of the koan prefix

This commit is contained in:
Felipe Sere
2016-03-08 20:27:53 +00:00
parent a85e760e54
commit dc64bdf186
3 changed files with 4 additions and 27 deletions

View File

@@ -1,9 +1,6 @@
defmodule Koans do
@prefix "koan: "
defmacro koan(name, body) do
compiled_name = :"#{prefix}#{name}"
compiled_name = String.to_atom(name)
quote do
@koans unquote(compiled_name)
def unquote(compiled_name)() do
@@ -24,16 +21,10 @@ defmodule Koans do
import Koans
import BlankAssertions
@before_compile KoansBuilder
@before_compile Koans
end
end
def prefix do
@prefix
end
end
defmodule KoansBuilder do
defmacro __before_compile__(env) do
koans = Module.get_attribute(env.module, :koans) |> Enum.reverse
quote do