Checks a README's install snippet against the version being released.
The requirement is read from the first {:app_name, "requirement"} in the
source. The version compared against is the one being released, not the one in
mix.exs.
Modes
:satisfies— the version must satisfy the requirement the README names.:exact— the README must name~> MAJOR.MINORof the version.
Summary
Functions
Whether source is fit to publish version of app under mode.
The requirement source names for app, from a {:app, "requirement"} pair.
Types
Functions
Whether source is fit to publish version of app under mode.
Returns :ok, or {:error, message} naming what the README says and what it
should say.
Examples
iex> Plumb.Readme.check(~s|{:drafter, "~> 0.3"}|, :drafter, "0.3.1", :satisfies)
:ok
iex> Plumb.Readme.check(~s|{:drafter, "~> 0.3"}|, :drafter, "0.3.1", :exact)
:ok
The requirement source names for app, from a {:app, "requirement"} pair.
Takes the first occurrence. Returns {:error, message} when the app is not
named at all, which is treated as a failure rather than a pass — a README with
no install snippet cannot be verified.
Examples
iex> Plumb.Readme.requirement(~s|{:drafter, "~> 0.3"}|, :drafter)
{:ok, "~> 0.3"}