h1. random_data h2. What This plugin defines a Random singleton class that has a bunch of class methods to quickly generate random test for testing and developmental use. h3. Contact Methods Random.phone, Random.international_phone, Random.email h3. Time/Date Methods Random.date h3. Location Methods Random.address_line_1, Random.address_line_2, Random.zipcode, Random.state, Random.country, Random.city, h3. Name Methods Random.firstname, Random.initial, Random.lastname, h3. Text Methods Random.alphanumeric, Random.paragraphs Note that some methods take parameters to bound or limit the amount of data returned. See RDocs for details. h2. Installing
sudo gem install random_data
require 'random_data'h2. Demonstration of usage
>> Random.alphanumeric => "cfbutm3vYfhZXil0"
>> Random.alphanumeric(5) => "XYVyn"
>> Random.paragraphs => "Ulysses, fighting evil and tyranny with all his power and with all of his might. Ulysses, fighting evil and tyranny with all his power and with all of his might. \n\nHe's got style, a groovy style, and a car that just won't stop. \n\n"
>> Random.firstname => "Thomas"
>> Random.initial => "E"
>> Random.lastname => "Robinson"
>> Random.date => Sun, 09 Sep 2007
>> Random.date(1000) => Sun, 26 Nov 2006
>> Random.email => "zrodriguez@example.com"
>> Random.phone => "564-103-8353"
>> Random.international_phone => "011-24-37-9704"
>> Random.address_line_1 => "38367 Adams Rd"
>> Random.address_line_2 => "Lot 247"
>> Random.zipcode => 22904 (note that the zipcodes are totally random and may not be real zipcodes)
>> Random.state => "MD"
>> Random.state_full => "New Mexico"
>> Random.country => "Philippines"h2. How to submit patches Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and e-mail the patch to me at "mike@subelsky.com":mailto:mike@subelsky.com. The trunk repository is
svn://rubyforge.org/var/svn/random_data/trunk
for anonymous access.
h2. License
This code is free to use under the terms of the MIT license.
h2. Contact
Comments are welcome. Send an email to "mike@subelsky.com":mailto:mike@subelsky.com