Sunday, May 25, 2008

random_data v1.3.0 released

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!