Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
README.md
Rakefile
factory_randomizer.gemspec

README.md

Randomizer

https://github.com/bluerail/randomizer

By Rene van Lieshout rene@bluerail.nl

Description

Randomizer is a gem that provides a diversity of random values, such as names and e-mail addresses. It might provide you with initial data for developing an application and require some feel of how it would look like when used.

Please not that random does not equal unique!

Installation

gem install factory_randomizer

Usage

Any of the available creators can be accessed using Randomizer:

Names

  • Randomizer.first_name => "Darnell"
  • Randomizer.surname => "Stanley"
  • Randomizer.full_name => "Alexa Hickman"

E-mail addresses

Numbers

  • Randomizer.number => 281845123
  • Randomizer.number(:min => 10, :max => 100) => 29

Password

  • Randomizer.password => "2cafe8"
  • Randomizer.password(:length => 10) => "9480b52bf1"

Or, to create 100 random Users:

100.times{ User.create(:name => Randomizer.full_name) }

When a validate_uniqueness_of :name is set, this might create less then 100 users and could fail if .create! is used.

Planned features

  • Generation of addresses
  • Generation of phone numbers
  • Knowledge of country specific address / phone number format
  • Generation of company names
  • Generation of ...

Contributions are welcome! Feel free to fork and send a pull request through Github.

Something went wrong with that request. Please try again.