View Source Bonfire.Common.Simulation (Bonfire v0.9.11-social-beta.6)

Fake data generators

Summary

Functions

Picks a unique random url for an ap endpoint

Generates random base64 text

Generates a random boolean

Picks a random canonical url and makes it unique

Generate a random content type

Picks a remote url from a set of available ones.

Generates a random date of birth based on an age range of 18-99

Generates a random domain name

Generates a random unique email

Generates the first half of an email address

Returns false

Generate a random floating point number

Picks a date up to 300 days in the future, not including today

Picks a datetime up to 300 days in the future, not including today

Same as future_datetime, but as an ISO8601 formatted string.

Picks an icon url

Picks an image url

Generate a random signed integer

A random license for content

Returns a city and country

Generate a random boolean that can also be nil

Picks a name

Generate a random negative integer

Generates a random paragraph

Generates a random password string

Picks a date up to 300 days in the past, not including today

Picks a datetime up to 300 days in the past, not including today

Same as past_datetime, but as an ISO8601 formatted string.

Picks a path from a set of available files.

Generate a random positive integer

Picks a unique preferred_username

Picks a fake signing key

Repeats a function count times if count_or_range is a positive integer.

Picks a summary text paragraph

Returns true

Generates a random unique ID, optionally for a specific schema

Generates a random unique ULID

Generates a random url

Generates a random username

Generates a random unique UUID

A verb to be used for an activity.

A website address

Functions

ap_url_base()

Picks a unique random url for an ap endpoint

base64()

Generates random base64 text

bool()

Generates a random boolean

canonical_url()

Picks a random canonical url and makes it unique

content_type()

Generate a random content type

content_url()

Picks a remote url from a set of available ones.

date_of_birth()

Generates a random date of birth based on an age range of 18-99

domain()

Generates a random domain name

email()

Generates a random unique email

email_user()

Generates the first half of an email address

falsehood()

Returns false

float()

Generate a random floating point number

future_date()

Picks a date up to 300 days in the future, not including today

future_datetime()

Picks a datetime up to 300 days in the future, not including today

future_datetime_iso()

Same as future_datetime, but as an ISO8601 formatted string.

icon()

Picks an icon url

image()

Picks an image url

integer()

Generate a random signed integer

license()

A random license for content

location()

Returns a city and country

long_count()

long_list(gen)

markdown()

maybe_bool()

Generate a random boolean that can also be nil

maybe_one_of(list)

med_count()

med_list(gen)

name()

Picks a name

neg_integer()

Generate a random negative integer

one_of(gens)

paragraph()

Generates a random paragraph

password()

Generates a random password string

past_date()

Picks a date up to 300 days in the past, not including today

past_datetime()

Picks a datetime up to 300 days in the past, not including today

past_datetime_iso()

Same as past_datetime, but as an ISO8601 formatted string.

path()

Picks a path from a set of available files.

pos_integer()

Generate a random positive integer

preferred_username()

Picks a unique preferred_username

short_count()

short_list(gen)

signing_key()

Picks a fake signing key

some(count_or_range \\ 1, fun)

Repeats a function count times if count_or_range is a positive integer.

If count_or_range is a positive range, a random number from this range is selected and that value used as a count

summary()

Picks a summary text paragraph

title()

truth()

Returns true

uid(schema \\ nil)

Generates a random unique ID, optionally for a specific schema

ulid()

Generates a random unique ULID

url()

Generates a random url

username()

Generates a random username

uuid()

Generates a random unique UUID

verb()

A verb to be used for an activity.

website()

A website address