From 4403d6936f72d8676f04799c419ca7f556b47bd1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 8 Nov 2011 10:21:04 +0000 Subject: test/exec: remove "uuid" gem dependency on 1.8 Just borrow the code from 1.9.3 --- test/exec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/exec.rb b/test/exec.rb index 3c98369..b2c2bf9 100644 --- a/test/exec.rb +++ b/test/exec.rb @@ -12,8 +12,10 @@ module TestExec def uuid SecureRandom.uuid rescue NoMethodError - require "uuid" - UUID.generate + ary = SecureRandom.random_bytes(16).unpack("NnnnnN") + ary[2] = (ary[2] & 0x0fff) | 0x4000 + ary[3] = (ary[3] & 0x3fff) | 0x8000 + "%08x-%04x-%04x-%04x-%04x%08x" % ary end def yield_for_monitor_update # mogilefsd should update every 4 seconds -- cgit v1.2.3-24-ge0c7