diff --git a/README.md b/README.md index 1e89a13..561d5a3 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Macros expanding into code that can be safely used in guard clauses. Update your `mix.exs` file and run `mix deps.get`. ```elixir defp deps do - [{:guardsafe, "~> 0.3.1"}] + [{:guardsafe, "~> 0.4.0"}] end ``` @@ -71,6 +71,14 @@ than `Kernel` you need to require it before use, e.g. `require Integer`. * `divisible_by?/2` - checks whether two integers are evenly divisible. * `even?/1` - returns true for even integers. * `odd?/1` - returns true for odd integers. +* `within?/3` - checks whether a value is in the range of the last two arguments. + +#### Macros for dates and times +* `date?/1` - checks if the term is an Erlang-style date tuple. +* `datetime?/1` - checks if the term is an Erlang-style datetime tuple. +* `time?/1` - checks if the term is an Erlang-style time tuple. + +_These can come in handy when working with a library such as [GoodTimes](https://github.com/magplus/good_times)._ ### Why nil? and float? instead of is_nil and is_float diff --git a/lib/guardsafe.ex b/lib/guardsafe.ex index da5a1bb..35427d3 100644 --- a/lib/guardsafe.ex +++ b/lib/guardsafe.ex @@ -1,5 +1,5 @@ defmodule Guardsafe do - @vsn "0.3.1" + @vsn "0.4.0" @doc false def version, do: @vsn diff --git a/mix.exs b/mix.exs index 11d1db7..17f5819 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Guardsafe.Mixfile do def project do [ app: :guardsafe, - version: "0.3.1", + version: "0.4.0", name: "Guardsafe", source_url: "https://github.com/DevL/guardsafe", homepage_url: "https://hex.pm/packages/guardsafe",