core: clean up unused vocabulary namespace stuff
This commit is contained in:
parent
e141841e78
commit
a1dcc4cc8f
2 changed files with 1 additions and 34 deletions
|
@ -45,35 +45,13 @@ defmodule RDF.Vocabulary.Namespace do
|
|||
defmacro __using__(_opts) do
|
||||
quote do
|
||||
import unquote(__MODULE__)
|
||||
|
||||
# Module.register_attribute __MODULE__, :vocabs_acc, accumulate: true
|
||||
#
|
||||
# @before_compile unquote(__MODULE__)
|
||||
end
|
||||
end
|
||||
|
||||
# defmacro __before_compile__(_env) do
|
||||
# quote do
|
||||
# @__vocabs__ normalize_vocabs(
|
||||
# Module.delete_attribute(__MODULE__, :vocabs_acc), __MODULE__)
|
||||
# def __all__, do: @__vocabs__
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def normalize_vocabs(vocabs, parent_module) do
|
||||
# Enum.reduce vocabs, %{}, fn ({name, opts}, vocabs) ->
|
||||
# Map.put(vocabs, name, normalize_vocab_opts(name, opts, parent_module))
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# defp normalize_vocab_opts(name, opts, parent_module) do
|
||||
# Keyword.put_new(opts, :module, Module.safe_concat([parent_module, name]))
|
||||
# end
|
||||
|
||||
@doc """
|
||||
Defines a `RDF.Namespace` module for a RDF vocabulary.
|
||||
"""
|
||||
defmacro defvocab({:__aliases__, _, [name_atom]} = name, opts) do
|
||||
defmacro defvocab(name, opts) do
|
||||
base_uri = base_uri!(opts)
|
||||
file = file!(opts)
|
||||
terms = terms!(opts)
|
||||
|
@ -83,8 +61,6 @@ defmodule RDF.Vocabulary.Namespace do
|
|||
capitalized_terms = Map.get(case_separated_terms, :capitalized, [])
|
||||
|
||||
quote do
|
||||
# @vocabs_acc {unquote(name_atom), unquote(opts)}
|
||||
|
||||
vocabdoc = Module.delete_attribute(__MODULE__, :vocabdoc)
|
||||
|
||||
defmodule unquote(name) do
|
||||
|
|
|
@ -29,15 +29,6 @@ defmodule RDF.Vocabulary.NamespaceTest do
|
|||
end
|
||||
|
||||
|
||||
# test "__all__ returns a list of all defined namespaces" do
|
||||
# assert Enum.count(TestNS.__all__) == 4
|
||||
# assert is_map(TestNS.__all__)
|
||||
# assert Map.has_key?(TestNS.__all__, :Example1)
|
||||
# assert Map.has_key?(TestNS.__all__, :Example2)
|
||||
# assert Map.has_key?(TestNS.__all__, :Example3)
|
||||
# assert Map.has_key?(TestNS.__all__, :Example4)
|
||||
# end
|
||||
|
||||
describe "defvocab" do
|
||||
test "fails without a base_uri" do
|
||||
assert_raise KeyError, fn ->
|
||||
|
|
Loading…
Reference in a new issue