Friday, June 6, 2008
random_data v1.3.1 is out. Courtesy of stalwart contributor Hugh Sasse, this release includes more firstnames, and two new methods:
Random.firstname_male and
Random.firstname_female.
Install it via:
sudo gem install random_data
Labels: random_data, ruby
Sunday, May 25, 2008
random_data is a testing and seed data gem I wrote a few years back to help get Ruby projects up and running with semi-realistic fake data (the
faker gem provides similar functionality).
I just released version 1.3.0 which includes a bunch of RDoc enhancements as well as some new features contributed by the tireless (and patient!) Hugh Sasse:
- Added RandomData::Grammar, which lets you create simple random sentences from a grammar supplied as a hash, like so:
Random::grammatical_construct({:story => [:man, " bites ", :dog], :man => { :bob => "Bob"}, :dog => {:a =>"Rex", :b =>"Rover"}}, :story)
==> "Bob bites Rex"
- Added Random.bit and Random.bits
- Added Random.uk_post_code
- Bug fix: zipcodes should strings, not integers
Thanks Hugh! Open source is awesome!
Labels: random_data, ruby
Tuesday, December 4, 2007
Thanks to Paul Barry and Hugh Sasse for some awesome patches to random_data! They're responsible for all of the new stuff added this release.
1 major enhancement
- Added method_missing to Random class, which looks for a method_name.dat file and fetches a random line for you (see docs for details) (Hugh Sasse)
- Added Random.date_between method to get a date between 2 given dates (Paul Barry)
- Added Random.boolean method to get a random true or false (Paul Barry)
- Added Random.number to get a random number less than a number or within a given range (Paul Barry)
1 minor enhancement
- Enhanced Random.date method to handle a Range as well as a Fixnum, which allows you to get a date guaranteed to be in the past (Paul Barry)
1 minor fix
- Location sources organized into more understandable categories, for easier future expansion (Hugh Sasse)
- Fixed path of require statements in random_data.rb (Paul Barry)
- Make initial never return nil, because if it returns nil then ContactInfo#email can thrown and error because it tries to call nil. (Paul Barry)
Labels: random_data, ruby
Saturday, October 20, 2007
I received a patch from Hugh Sasse for random_data which adds separate male and female first names and adds more names. I've released these changes as v1.1.
sudo gem install random_data
or get it manually from the
rubyforge site.
Thanks, Hugh!
Labels: random_data, ruby