diff --git a/.gitignore b/.gitignore index 0d123ee..02eca6b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,8 @@ erl_crash.dump # Also ignore archive artifacts (built via "mix archive.build"). *.ez -.elixir_ls \ No newline at end of file +# Ignore package tarball (built via "mix hex.build"). +gen_state_machine-*.tar + +# Temporary files for e.g. tests +/tmp diff --git a/README.md b/README.md index de10b79..fe05d18 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,12 @@ -[![Elixir CI](https://github.com/ericentin/gen_state_machine/workflows/Elixir%20CI/badge.svg)](https://github.com/ericentin/gen_state_machine/actions?query=workflow%3A%22Elixir+CI%22) - # GenStateMachine +[![Elixir CI](https://github.com/ericentin/gen_state_machine/workflows/Elixir%20CI/badge.svg)](https://github.com/ericentin/gen_state_machine/actions?query=workflow%3A%22Elixir+CI%22) +[![Module Version](https://img.shields.io/hexpm/v/gen_state_machine.svg)](https://hex.pm/packages/gen_state_machine) +[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/gen_state_machine/) +[![Total Download](https://img.shields.io/hexpm/dt/gen_state_machine.svg)](https://hex.pm/packages/gen_state_machine) +[![License](https://img.shields.io/hexpm/l/gen_state_machine.svg)](https://github.com/ericentin/gen_state_machine/blob/master/LICENSE) +[![Last Updated](https://img.shields.io/github/last-commit/ericentin/gen_state_machine.svg)](https://github.com/ericentin/gen_state_machine/commits/master) + An idiomatic Elixir wrapper for `gen_statem` in OTP 20 (and above). **Full documentation is available [here](https://hexdocs.pm/gen_state_machine).** @@ -24,23 +29,37 @@ added to `Logger`. ## Installation - 1. Add `gen_state_machine` to your list of dependencies in `mix.exs`: +Add `:gen_state_machine` to your list of dependencies in `mix.exs`: - ```elixir - def deps do - [{:gen_state_machine, "~> 3.0"}] - end - ``` +```elixir +def deps do + [{:gen_state_machine, "~> 3.0"}] +end +``` - 2. Ensure `gen_state_machine` is added to your applications: +Ensure `:gen_state_machine` is added to your applications: - ```elixir - def application do - [applications: [:gen_state_machine]] - end - ``` +```elixir +def application do + [applications: [:gen_state_machine]] +end +``` ## Special Thanks I would like to give special thanks to @fishcakez and @michalmuskala, who both provided invaluable feedback on this library! + +## License + +Copyright (c) 2016 Eric Entin + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/lib/gen_state_machine.ex b/lib/gen_state_machine.ex index 9bcf0e1..e932fe7 100644 --- a/lib/gen_state_machine.ex +++ b/lib/gen_state_machine.ex @@ -420,7 +420,7 @@ defmodule GenStateMachine do @doc """ Whenever a `GenStateMachine` in callback mode `:handle_event_function` (the - default) receives a call, cast, or normal process messsage, this callback will + default) receives a call, cast, or normal process message, this callback will be invoked. This function can optionally throw a result to return it. diff --git a/mix.exs b/mix.exs index 2461ddf..8762e26 100644 --- a/mix.exs +++ b/mix.exs @@ -12,6 +12,7 @@ end defmodule GenStateMachine.Mixfile do use Mix.Project + @source_url "https://github.com/ericentin/gen_state_machine" @version "3.0.0" def project do @@ -24,11 +25,12 @@ defmodule GenStateMachine.Mixfile do deps: deps(), description: description(), package: package(), - source_url: "https://github.com/ericentin/gen_state_machine", docs: [ - main: "GenStateMachine", - extras: ["README.md"], - source_ref: "v#{@version}" + main: "readme", + extras: ["CHANGELOG.md", "README.md"], + source_url: @source_url, + source_ref: "v#{@version}", + api_reference: false ] ] end @@ -53,11 +55,12 @@ defmodule GenStateMachine.Mixfile do defp package do [ - files: ["lib", "mix.exs", "README.md", "LICENSE"], + files: ["lib", "mix.exs", "README.md", "CHANGELOG.md", "LICENSE"], maintainers: ["Eric Entin"], - licenses: ["Apache 2.0"], + licenses: ["Apache-2.0"], links: %{ - "GitHub" => "https://github.com/ericentin/gen_state_machine" + "Changelog" => "https://hexdocs.pm/gen_state_machine/changelog.html", + "GitHub" => @source_url } ] end