BeamPatch (beam_patch v0.1.1)
View SourcePatch Elixir & Erlang modules at runtime
Example
require BeamPatch
assert String.jaro_distance("same", "same") == 1.0
BeamPatch.patch_and_load! String do
@modifier 2
def jaro_distance(a, b), do: super(a, b) * @modifier
end
assert String.jaro_distance("same", "same") == 2.0
Installation
def deps do
[
{:beam_patch, "~> 0.1.1"}
]
end
Summary
Functions
@spec load(BeamPatch.Patch.t()) :: :ok | {:error, BeamPatch.Error.t()}
@spec load!(BeamPatch.Patch.t()) :: :ok
@spec patch_quoted(module(), body :: Macro.t()) :: {:ok, BeamPatch.Patch.t()} | {:error, BeamPatch.Error.t()}
@spec patch_quoted!(module(), body :: Macro.t()) :: BeamPatch.Patch.t()
@spec patch_quoted_and_load(module(), body :: Macro.t()) :: {:ok, BeamPatch.Patch.t()} | {:error, BeamPatch.Error.t()}