How do I generate a globally unique ID in ruby (without rails/merb)?
+1
A:
Google yields the following Ruby library:
http://raa.ruby-lang.org/project/ruby-guid/
Also, over at http://www.ruby-forum.com/topic/99262 they say you can install a gem (execute gem uuid
on the command line to install it) and then do
gem 'uuid'
puts UUID.new
in your code to see a new UUID.
(Hint: I Googled for guid ruby)
Marc W
2009-10-05 23:32:22
thx I saw that but it's super old, just looking for something active, like a recent gem?
viatropos
2009-10-05 23:33:56
Nothing's wrong with an old library.
Ben Alpert
2009-10-05 23:35:40
How about the uuid gem I added to my answer? Or is that the one you were referring to?
Marc W
2009-10-05 23:35:50
UUIDTools works much better ...
Sam Saffron
2009-10-07 04:51:24