Ruby 1.8 doesn't have Random class

Random class is provided by only  ruby 1.9 later. but my project uses ruyb 1.8 yet. Please accepte this PR.

I understand that ruby 1.8 is discontinued to support in Jun 2013. If this PR rejected, I'll use to my forked version.

Thanks.