mirror of
https://github.com/askn/faker.git
synced 2023-08-10 21:13:01 +03:00
Faker is a Crystal library that generates fake data for you
examples | ||
spec | ||
src | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
README.md | ||
shard.yml |
faker
This shard is a port of Faker gem that generates fake data.
Installation
Add this to your application's shard.yml
:
dependencies:
faker:
github: askn/faker
Usage
require "faker"
Faker::Name.name
### Faker::Address
Faker::Address.city
Faker::Address.street_name
Faker::Address.street_address
Faker::Address.secondary_address
Faker::Address.building_number
Faker::Address.zip_code
Faker::Address.postcode
Faker::Address.time_zone
Faker::Address.street_suffix
Faker::Address.city_suffix
Faker::Address.city_prefix
Faker::Address.state
Faker::Address.state_abbr
Faker::Address.country
Faker::Address.latitude
Faker::Address.longitude
Faker::Commerce
Faker::Commerce.color
Faker::Commerce.department
Faker::Commerce.product_name
Faker::Commerce.price
Faker::Company
Faker::Company.name
Faker::Company.suffix
Faker::Internet
Faker::Internet.email
Faker::Internet.email("Nancy")
Faker::Internet.free_email
Faker::Internet.free_email("Nancy")
Faker::Internet.safe_email
Faker::Internet.safe_email("Nancy")
Faker::Internet.user_name
Faker::Internet.user_name("Nancy")
Faker::Internet.user_name("Nancy Johnson", %w(. _ -))
Faker::Internet.domain_name
Faker::Internet.domain_word
Faker::Internet.domain_suffix
Faker::Internet.ip_v4_address
Faker::Internet.url
Faker::Internet.slug
Faker::Lorem
Faker::Lorem.words
Faker::Lorem.words(4)
Faker::Lorem.words(4, true)
Faker::Lorem.characters
Faker::Lorem.characters(10)
Faker::Lorem.sentence
Faker::Lorem.sentence(3)
Faker::Lorem.sentence(3, true)
Faker::Lorem.sentences
Faker::Lorem.sentences(1)
Faker::Lorem.sentences(1, true)
Faker::Lorem.paragraph
Faker::Lorem.paragraph(2)
Faker::Lorem.paragraph(2, true)
Faker::Lorem.paragraphs
Faker::Lorem.paragraphs(1)
Faker::Lorem.paragraphs(1, true)
### Faker::Name
Faker::Name.name
Faker::Name.first_name
Faker::Name.last_name
Faker::Name.prefix
Faker::Name.suffix
Faker::Name.title
### Faker::Number
Faker::Number.number(10)
Faker::Number.decimal(2)
Faker::Number.decimal(2, 3)
Faker::Number.digit
Faker::PhoneNumber
Faker::PhoneNumber.phone_number
Contributing
- Fork it ( https://github.com/askn/faker/fork )
- 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
Contributors
- askn Aşkın Gedik - creator, maintainer