Copyright 2010, 2011, 2014 Todd A. Jacobs All Rights Reserved
Released under the GNU General Public License (GPL) http://www.gnu.org/copyleft/gpl.html This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Simple Sinatra app that is easy to maintain.
-
Minimalistic gem requirements.
-
Cross-platform support for generating random UUIDs.
Ruby didn’t provide cross-platform support for RFC-4122 UUIDs in the standard library until r21868 made its way into Ruby 1.9.3. Before then, you had to install a third-party gem or roll your own code in order to generate UUIDs. There are a number of use-cases in which uuid-serve.rb was (and perhaps still is) a better alternative.
-
Strict change-control policies make installing a third-party gem into multiple applications sub-optimal. With uuid-serve, you only have to make changes in a single server application, which is then available to all consumer processes.
-
Regulatory environments where third-party gems must be audited before inclusion into applications. By ensuring that only one application is generating the UUIDs, it may reduce the scope of any audit requirements.
-
Company policies which prohibit the inclusion of third-party gems within core applications. By treating UUIDs as a consumable web resource, rather than building them into the core application, it may be possible to place UUID generation outside an application’s policy footprint.
To address these use cases, this Sinatra app provides random UUIDs for consumption by external applications. Specifically, it provides a RESTful API for retrieving one or more RFC-4122 Version 4 UUID strings as plain text. Please see the running application’s home page for additional details.
ruby uuid-serve.rb
firefox http://localhost:4567/
If you’d like to see uuid-serve in action, you can use the reference implementation that’s already on the web.
-
Access the reference implementation via HTTP
http://uuids.codegnome.com/ -
Access the reference implementation using SSL
https://uuid-serve.herokuapp.com/
The reference implementation is open to the public. It is a free service, so you’re welcome to use it for production use of any kind.