uuidtools 0.1.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -1
- data/lib/uuidtools.rb +22 -15
- data/rakefile +3 -2
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
== UUIDTools 1.0.0
|
2
|
+
* slight improvements to the random number generator
|
3
|
+
* fixed issue with failing to obtain mac address in certain environments
|
1
4
|
== UUIDTools 0.1.4
|
2
5
|
* improved speed when generating timestamp-based uuids
|
3
6
|
* fixed bug with rapid generation of timestamp uuids leading to dupicates
|
@@ -12,4 +15,4 @@
|
|
12
15
|
== UUIDTools 0.1.1
|
13
16
|
* changed helper methods to be protected like they should have been
|
14
17
|
== UUIDTools 0.1.0
|
15
|
-
* parsing and generation of UUIDs implemented
|
18
|
+
* parsing and generation of UUIDs implemented
|
data/lib/uuidtools.rb
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
#++
|
23
23
|
|
24
|
-
UUID_TOOLS_VERSION = "0.
|
24
|
+
UUID_TOOLS_VERSION = "1.0.0"
|
25
25
|
|
26
26
|
$:.unshift(File.dirname(__FILE__))
|
27
27
|
|
@@ -474,23 +474,29 @@ class UUID
|
|
474
474
|
end
|
475
475
|
else
|
476
476
|
begin
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
ifconfig_output = `ifconfig | grep HWaddr | cut -c39-`
|
482
|
-
mac_addresses = ifconfig_output.scan(
|
483
|
-
Regexp.new("(#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
484
|
-
end
|
485
|
-
if mac_addresses.size == 0
|
486
|
-
ifconfig_output = `/sbin/ifconfig`
|
477
|
+
mac_addresses = []
|
478
|
+
if File.exists?('/sbin/ifconfig')
|
479
|
+
ifconfig_output =
|
480
|
+
`/sbin/ifconfig 2>&1`
|
487
481
|
mac_addresses = ifconfig_output.scan(
|
488
482
|
Regexp.new("ether (#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
489
|
-
|
490
|
-
|
491
|
-
|
483
|
+
if mac_addresses.size == 0
|
484
|
+
ifconfig_output =
|
485
|
+
`/sbin/ifconfig | grep HWaddr | cut -c39- 2>&1`
|
486
|
+
mac_addresses = ifconfig_output.scan(
|
487
|
+
Regexp.new("(#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
488
|
+
end
|
489
|
+
else
|
490
|
+
ifconfig_output =
|
491
|
+
`ifconfig 2>&1`
|
492
492
|
mac_addresses = ifconfig_output.scan(
|
493
|
-
Regexp.new("(#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
493
|
+
Regexp.new("ether (#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
494
|
+
if mac_addresses.size == 0
|
495
|
+
ifconfig_output =
|
496
|
+
`ifconfig | grep HWaddr | cut -c39- 2>&1`
|
497
|
+
mac_addresses = ifconfig_output.scan(
|
498
|
+
Regexp.new("(#{(["[0-9a-fA-F]{2}"] * 6).join(":")})"))
|
499
|
+
end
|
494
500
|
end
|
495
501
|
if mac_addresses.size > 0
|
496
502
|
@@mac_address = mac_addresses.first.first
|
@@ -519,6 +525,7 @@ class UUID
|
|
519
525
|
hash.update(rand.to_s)
|
520
526
|
hash.update(hash.object_id.to_s)
|
521
527
|
hash.update(self.methods.inspect)
|
528
|
+
hash.update($:.to_s)
|
522
529
|
begin
|
523
530
|
random_device = nil
|
524
531
|
if File.exists? "/dev/urandom"
|
data/rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rake/gempackagetask'
|
|
7
7
|
require 'rake/contrib/rubyforgepublisher'
|
8
8
|
|
9
9
|
PKG_NAME = 'uuidtools'
|
10
|
-
PKG_VERSION = '0.
|
10
|
+
PKG_VERSION = '1.0.0'
|
11
11
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
12
12
|
|
13
13
|
RELEASE_NAME = "REL #{PKG_VERSION}"
|
@@ -35,7 +35,8 @@ Rake::TestTask.new("test_all") { |t|
|
|
35
35
|
Rake::RDocTask.new { |rdoc|
|
36
36
|
rdoc.rdoc_dir = 'doc'
|
37
37
|
rdoc.title = "UUID Tools -- universally unique id generation tools"
|
38
|
-
rdoc.options << '--line-numbers --inline-source
|
38
|
+
rdoc.options << '--line-numbers' << '--inline-source' <<
|
39
|
+
'--accessor' << 'cattr_accessor=object'
|
39
40
|
rdoc.template = "#{ENV['template']}.rb" if ENV['template']
|
40
41
|
rdoc.rdoc_files.include('README', 'CHANGELOG')
|
41
42
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: uuidtools
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.
|
7
|
-
date:
|
6
|
+
version: 1.0.0
|
7
|
+
date: 2006-02-13 00:00:00 -05:00
|
8
8
|
summary: Generation of UUIDs.
|
9
9
|
require_paths:
|
10
10
|
- lib
|