Skip to content

Latest commit

 

History

History
36 lines (30 loc) · 1.1 KB

generating_fake_demo_data.md

File metadata and controls

36 lines (30 loc) · 1.1 KB

Generating fake demo data

If you need to generate data for demo please don't do it as "Name0", "Name1", .... Instead you should use fake data generators such as forgery.

Installing

Just add it to Gemfile:

group :development do
  gem 'forgery'
end

Examples of usage

Generate title for blog post:

> Forgery(:lorem_ipsum).words(4, random: true).capitalize
=> "Purus sit amet nulla"

Generate user name and email:

> Forgery(:name).full_name
=> "Shawn Smith"
> Forgery(:email).address
=> "[email protected]"

Generate credit card number:

> Forgery(:credit_card).number(type: 'Visa')
=> "4532443581421162"

See additional information about usage in official README, wiki or in code base.

Notes

Code of forgery is easy to read and understand. Feel free to explore and contribute. It especially need documentation improvements.