Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ erl_crash.dump
# Also ignore archive artifacts (built via "mix archive.build").
*.ez

.elixir_ls
# Ignore package tarball (built via "mix hex.build").
gen_state_machine-*.tar

# Temporary files for e.g. tests
/tmp
47 changes: 33 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).**
Expand All @@ -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.
2 changes: 1 addition & 1 deletion lib/gen_state_machine.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 10 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down