Forum: Ruby backporting to ruby 1.8.7

Ea53f9259a1faa04ca2843ce34a648ae?d=identicon&s=25 Jake Ho (fiddle_jake)
on 2016-11-09 19:50
Sorry, newbie question here.

I need securerandom.uuid on ruby 1.8.7.  I found this

http://softover.com/UUID_in_Ruby_1.8

Which says to cut and paste the code.  But cut and paste it to where?

Could someone tell me what to do with that code?

Thanks so much!
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2016-11-11 08:05
Eh .... paste it into your code. The most important point is that it
gets executed before the methods are actually used.

You could simply paste it into your main program, which might be handy
for a quick test. For a cleaner solution, especially for a larger
project, I would put this code into a separate file (say:
securerandom_monkeypatch.rb) and require this file whereever you want to
use uuid.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.