See what’s changed lately by reading the project history.
Your project may contain files that are intended to serve as explanatory samples of files provided by a project contributor or user, such as configuration and the like. The Mix tasks provided here enable you to easily find, copy, and check the freshness of example files and your copies of them.
Use example_files by adding it to a Mix deps declaration.
# mix.exs
# ...
defp deps do
[{:example_files, "~> 0.2", only: [:dev, :test]}]
end
# ...The example_files commands are exposed as Mix tasks. Get help on them through
Mix itself, with mix help | grep example_files and mix help example_files.
To list all example files in your project, mix example_files.
This task traverses the current working directory, looking for files that are
intended to serve as explanatory samples of files provided by a project
contributor or user. By default it uses **/*{example,Example,EXAMPLE}* as the
file glob pattern.
An example file may be “applied,” which means that it is copied into the same directory, using a file name that lacks the “example” nomenclature.
$ mix example_files
Using glob pattern **/*{example,Example,EXAMPLE}*
Missing: spec/fixtures/no_collisions/file
1 example file found
Collision detected! spec/fixtures/collisions/file1, corresponding to:
· spec/fixtures/collisions/file1.example
· spec/fixtures/collisions/EXAMPLE-file1
Status is one of three values:
- Missing — never applied
- Out-of-date — applied, but currently different in content from the example
- Up-to-date — applied and identical in content to the example
Your project may contain two or more example files that, when applied, use the same resulting file name. This constitutes a “collision.” Colliding example files are noted on stderr.
To submit a patch to the project:
- Fork the official repository.
- Create your feature branch:
git checkout -b my-new-feature. - Commit your changes:
git commit -am 'Add some feature'. - Push to the branch:
git push origin my-new-feature. - Create a new pull request.
After cloning the repository, mix deps.get to install dependencies. Then
mix espec to run the tests. You can also iex to get an interactive prompt
that will allow you to experiment. To build this package, mix hex.build.
To release a new version:
- Update the “Installation” section of this readme to reference the new version, and commit.
- Update the project history in History.md, and commit.
- Update the version number in mix.exs, and commit.
- Tag the commit and push commits and tags.
- Build and publish the package on Hex with
mix hex.publish.
Released under the MIT License.