schism v0.1.0 Schism

Sets up branch points in the code for conditional compilation.

Link to this section Summary

Functions

Picks the beliefs for one or more schisms. If the beliefs have changed it recompiles the code

Recompile your project according to the dogma. If the project has been compiled accroding to the dogma, it won’t be recompiled

Picks the beliefs for one or more schisms and recompiles the code

Recompile your project according to the dogma

Sets up a branch point for conditional compilation

Link to this section Functions

Link to this function convert(choices, opts \\ [])

Picks the beliefs for one or more schisms. If the beliefs have changed it recompiles the code.

Unlike Schism.force_convert/2, this function only recompiles the code if the beliefs have chnaged. This is not as safe but avoids useless recompilations which can take up a lot of time.

Currently, all files are compiled, not only files with schisms. Due to the dynamic nature of Elixir’s compilation, it can be hard to eliminate all traces of heresy and obsolete beliefs that plague your code. Purging all BEAM modules and recompiling might be safer. For that, use the Schism.force_convert/2 function.

Link to this function convert_to_dogma(opts \\ [])

Recompile your project according to the dogma. If the project has been compiled accroding to the dogma, it won’t be recompiled.

Reafirms the one true faith by rejecting heresy and converting into the dogma in all schisms.

Link to this function force_convert(choices, opts \\ [])

Picks the beliefs for one or more schisms and recompiles the code.

Due to the dynamic nature of Elixir’s compilation, it can be hard to eliminate all traces of heresy and obsolete beliefs that plague your code.

Link to this function force_convert_to_dogma(opts \\ [])

Recompile your project according to the dogma.

Reafirms the one true faith by rejecting heresy and converting into the dogma in all schisms.

Link to this macro schism(schism_name, list) (macro)

Sets up a branch point for conditional compilation.

Should be used like this:


schism "schism name" do
  # The default option
  dogma "dogma name" do
    # some code
  end

  heresy "heresy #1" do
    # some code...
  end

  heresy "heresy #2" do
    # some code...
  end
end