Forum: Ruby backporting to ruby 1.8.7

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
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.
This topic is locked and can not be replied to.