Nf.App (neo_faker v0.5.0)
View SourceProvides functions for generating app metadata.
This module includes functions to generate random app-related information, such as author names, app names, descriptions, versions, and licenses.
Summary
Functions
Returns a random app author.
Returns a short app description.
Returns a random open-source license.
Returns a random app name.
Returns a semantic version number.
Returns a simple version number.
Functions
@spec author() :: String.t()
Returns a random app author.
The author name is a randomly generated full name.
Examples
iex> Nf.App.author()
"José Valim"
@spec description() :: String.t()
Returns a short app description.
The description provides a brief summary of the app.
Examples
iex> Nf.App.description()
"Elixir library for generating fake data in tests and development."
@spec license() :: String.t()
Returns a random open-source license.
The license is selected from a predefined list based on ChooseALicense.
Examples
iex> Nf.App.license()
"MIT License"
Returns a random app name.
By default, the app name is generated in a standard format. A different naming style can be
specified using the :style
option.
Options
The accepted options are:
:style
- Specifies the style of the app name.
The values for :style
can be:
nil
(default) - Uses the standard format, e.g.,"Neo Faker"
.:camel_case
- Uses camel case, e.g.,"neoFaker"
.:pascal_case
- Uses Pascal case, e.g.,"NeoFaker"
.:dashed
- Uses a dashed style, e.g.,"Neo-faker"
.:underscore
- Uses an underscore style, e.g.,"neo_faker"
.:single
- Uses a single-word format, e.g.,"Faker"
.
Examples
iex> Nf.App.name()
"Neo Faker"
iex> Nf.App.name(style: :camel_case)
"neoFaker"
Returns a semantic version number.
The generated version number follows the Semantic Versioning (SemVer) standard. By default, it
generates a core version (MAJOR.MINOR.PATCH
). Additional versioning details can be specified
using the :type
option.
Options
The accepted options are:
:type
- Specifies the type of version format.
The values for :type
can be:
nil
(default) - Uses core SemVer format, e.g.,"1.2.3"
.:pre_release
- Includes a pre-release label, e.g.,"1.2.3-beta.1"
.:build
- Includes a build metadata label, e.g.,"1.2.3+20250325"
.:pre_release_build
- Includes both pre-release and build metadata, e.g.,"1.2.3-rc.1+20250325"
.
Examples
iex> Nf.App.semver()
"1.2.3"
iex> Nf.App.semver(:pre_release)
"1.2.3-beta.1"
@spec version() :: String.t()
Returns a simple version number.
This version format follows MAJOR.MINOR
.
Examples
iex> Nf.App.version()
"1.2"