Travis CI Code Climate Test Coverage Issue Count Documentation

Small gem for creating and using UUIDs (universally unique identifier). It has no external dependencies.


Add this line to your application's Gemfile:

gem 'lazy-uuid'

Or to your gemspec:

spec.add_dependency 'lazy-uuid'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lazy-uuid


Script Usage

Include the Uuid class by doing:

require 'lazy-uuid'

To generate a new UUID:

uuid = Uuid.generate

To create a new UUID from a value:

value = "\xde\x30\x5d\x54\x75\xb4\x43\x1b\xad\xb2\xeb\x6b\x9e\x54\x60\x14"
uuid =

To parse an existing UUID string:

str = 'de305d54-75b4-431b-adb2-eb6b9e546014'
uuid = Uuid.parse(str)

Use #to_s to generate a human-readable representation of the UUID.

Command-line Usage

Run the generate-uuid script to generate and output a UUID.

$ generate-uuid

Or pass a number as an argument to generate multiple UUIDs.

$ generate-uuid 5


After checking out the repo, run bin/setup to install developer dependencies. Then, run bundle exec rake test to run the tests. It's recommended that you run bundle exec rake inspect to run inspections. You can also run bin/console for an interactive prompt that will allow you to experiment. bundle exec rake doc will generate documentation.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release. This will create a git tag for the version, push git commits and tags, and push the .gem file to


Bug reports and pull requests are welcome on GitHub.