uuid 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +7 -0
- data/README.rdoc +3 -10
- data/lib/uuid.rb +4 -3
- metadata +1 -1
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
2.0.1 (Pending)
|
2
|
+
* Fixed: MAC address parses correctly when using colon as separator, not
|
3
|
+
when using hyphen (ruby-mingw32). If your MAC address is all zero
|
4
|
+
(check with UUID.new.inspect), remove the ruby-uuid file, and it
|
5
|
+
will reset to the actual MAC address. (Rasha)
|
6
|
+
* Fixed: UUID.new.inspect not showing full MAC address.
|
7
|
+
|
1
8
|
2.0.0 (2008-08-28)
|
2
9
|
* Changed: API. UUID.generate still works as it always did, but the rest of
|
3
10
|
the API is brand spanking new, so if you rely on anything besides
|
data/README.rdoc
CHANGED
@@ -80,24 +80,17 @@ Stable release are made through RubyForge, to upgrade simply:
|
|
80
80
|
You can subscribe for notifications of new releases through the reliable-msg
|
81
81
|
project page at http://rubyforge.org/projects/reliable-msg
|
82
82
|
|
83
|
-
Source code and documentation hosted on Github:
|
84
|
-
|
85
|
-
http://github.com/assaf/uuid
|
83
|
+
Source code and documentation hosted on Github: http://github.com/assaf/uuid
|
86
84
|
|
87
85
|
To get UUID from source:
|
88
86
|
|
89
87
|
git clone git://github.com/assaf/uuid.git
|
90
88
|
|
91
89
|
|
92
|
-
== Change Log
|
93
|
-
|
94
|
-
:include: CHANGELOG
|
95
|
-
|
96
|
-
|
97
90
|
== License
|
98
91
|
|
99
|
-
This package is licensed under the MIT license and/or the
|
100
|
-
Commons Attribution-ShareAlike
|
92
|
+
This package is licensed under the MIT license and/or the Creative
|
93
|
+
Commons Attribution-ShareAlike.
|
101
94
|
|
102
95
|
:include: MIT-LICENSE
|
103
96
|
|
data/lib/uuid.rb
CHANGED
@@ -60,7 +60,7 @@ require 'macaddr'
|
|
60
60
|
|
61
61
|
class UUID
|
62
62
|
|
63
|
-
VERSION = '2.0.
|
63
|
+
VERSION = '2.0.1'
|
64
64
|
|
65
65
|
##
|
66
66
|
# Clock multiplier. Converts Time (resolution: seconds) to UUID clock
|
@@ -160,7 +160,8 @@ class UUID
|
|
160
160
|
if File.exist?(self.class.state_file) then
|
161
161
|
next_sequence
|
162
162
|
else
|
163
|
-
@mac = Mac.addr.gsub(
|
163
|
+
@mac = Mac.addr.gsub(/:|-/, '').hex & 0x7FFFFFFFFFFF
|
164
|
+
fail "Cannot determine MAC address from any available interface, tried with #{Mac.addr}" if @mac == 0
|
164
165
|
@sequence = rand 0x10000
|
165
166
|
|
166
167
|
open_lock 'w' do |io|
|
@@ -240,7 +241,7 @@ class UUID
|
|
240
241
|
end
|
241
242
|
|
242
243
|
def inspect
|
243
|
-
mac = ("%
|
244
|
+
mac = ("%012x" % @mac).scan(/[0-9a-f]{2}/).join(':')
|
244
245
|
"MAC: #{mac} Sequence: #{@sequence}"
|
245
246
|
end
|
246
247
|
|