Skip to content

Commit

Permalink
chore: README updates (#444)
Browse files Browse the repository at this point in the history
* chore: README updates

* add release please comments

---------

Co-authored-by: Blake Kostner <git@btkostner.io>
  • Loading branch information
doomspork and btkostner authored May 21, 2024
1 parent 5b05689 commit a4352dd
Showing 1 changed file with 13 additions and 34 deletions.
47 changes: 13 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# ExMachina

[![Circle CI](https://circleci.com/gh/thoughtbot/ex_machina.svg?style=svg&circle-token=fea4685d4951936734e764796c4b37c3686cdab3)](https://circleci.com/gh/thoughtbot/ex_machina)

**ExMachina is part of the [thoughtbot Elixir family][elixir-phoenix] of projects.**
[![Continuous Integration](https://github.com/beam-community/ex_machina/actions/workflows/ci.yaml/badge.svg)](https://github.com/beam-community/ex_machina/actions/workflows/ci.yaml)
[![Module Version](https://img.shields.io/hexpm/v/ex_machina.svg)](https://hex.pm/packages/ex_machina)
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ex_machina/)
[![Total Download](https://img.shields.io/hexpm/dt/ex_machina.svg)](https://hex.pm/packages/ex_machina)
[![License](https://img.shields.io/hexpm/l/ex_machina.svg)](https://github.com/beam-community/ex_machina/blob/master/LICENSE)
[![Last Updated](https://img.shields.io/github/last-commit/beam-community/ex_machina.svg)](https://github.com/beam-community/ex_machina/commits/master)

ExMachina makes it easy to create test data and associations. It works great
with Ecto, but is configurable to work with any persistence library.
Expand All @@ -12,41 +15,17 @@ with Ecto, but is configurable to work with any persistence library.

## Installation

#### To install in all environments (useful for generating seed data in dev/prod):

In `mix.exs`, add the ExMachina dependency:

```elixir
def deps do
# Get the latest from hex.pm. Works with Ecto 3.0
[
{:ex_machina, "~> 2.7.0"},
]
end
```

And start the ExMachina application. For most projects (such as
Phoenix apps) this will mean adding `:ex_machina` to the list of applications in
`mix.exs`. You can skip this step if you are using Elixir 1.4 or later.

```elixir
def application do
[mod: {MyApp, []},
applications: [:ex_machina, :other_apps...]]
end
```

#### Install in just the test environment with Phoenix:

In `mix.exs`, add the ExMachina dependency:

<!-- {x-release-please-start-version} -->
```elixir
def deps do
[
{:ex_machina, "~> 2.7.0", only: :test},
]
end
```
<!-- {x-release-please-end} -->

Add your factory module inside `test/support` so that it is only compiled in the
test environment.
Expand All @@ -58,7 +37,7 @@ ExUnit.start:
{:ok, _} = Application.ensure_all_started(:ex_machina)
```

#### Install in just the test environment for non-Phoenix projects:
#### Install in just the test environment for non-Phoenix projects

You will follow the same instructions as above, but you will also need to add
`test/support` to your compilation paths (elixirc_paths) if you have not done
Expand Down Expand Up @@ -494,10 +473,10 @@ MyApp.Factory.json_encode(:user)

Before opening a pull request, please open an issue first.

$ git clone https://github.com/thoughtbot/ex_machina.git
$ cd ex_machina
$ mix deps.get
$ mix test
git clone https://github.com/thoughtbot/ex_machina.git
cd ex_machina
mix deps.get
mix test

Once you've made your additions and `mix test` passes, go ahead and open a PR!

Expand Down

0 comments on commit a4352dd

Please sign in to comment.