Ruby 1.8 doesn't have Random class
applied mrkn's review
Merge pull request #3 from hsbt/compatible-ruby18

Ruby 1.8 doesn't have Random class