Current section

Files

Jump to
sass lib sass compiler.ex
Raw

lib/sass/compiler.ex

defmodule Sass.Compiler do
@moduledoc """
Connection to the NIF for sass
"""
@on_load { :init, 0 }
@doc """
Loads the sass.so library
"""
app = Mix.Project.config[:app]
def init do
path = :filename.join(:code.priv_dir(unquote(app)), 'sass_nif')
:ok = :erlang.load_nif(path, 0)
end
@doc """
A noop that gets overwritten by the NIF compile
"""
def compile(_,_) do
exit(:nif_library_not_loaded)
end
@doc """
A noop that gets overwritten by the NIF compile_file
"""
def compile_file(_,_) do
exit(:nif_library_not_loaded)
end
end