linux_uuid 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm ruby-1.9.2-p0@linux_uuid
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rake"
4
+ gem "io-extra", "~> 1.2.3"
5
+
6
+ group :development do
7
+ # gem "minitest", "~> 2.0.0"
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,14 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ io-extra (1.2.3)
5
+ minitest (2.0.0)
6
+ rake (0.8.7)
7
+
8
+ PLATFORMS
9
+ ruby
10
+
11
+ DEPENDENCIES
12
+ io-extra (~> 1.2.3)
13
+ minitest (~> 2.0.0)
14
+ rake
data/LICENSE ADDED
@@ -0,0 +1,4 @@
1
+ "THE BEER-WARE LICENSE" (Revision 42):
2
+ <john@dewey.ws> wrote this file. As long as you retain this notice you
3
+ can do whatever you want with this stuff. If we meet some day, and you think
4
+ this stuff is worth it, you can buy me a beer in return John-B Dewey Jr.
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # linux_uuid
2
+
3
+ A non-portable, fast, simple, atomic UUID generator.
4
+
5
+ ## Usage
6
+
7
+ ### Bundler
8
+
9
+ gem "linux_uuid"
10
+
11
+ ### Example
12
+
13
+ UUID.generate
14
+
15
+ ## Dependencies
16
+
17
+ * linux:/proc/sys/kernel/random/uuid
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require "rubygems"
2
+ require "rake"
3
+
4
+ begin
5
+ require "jeweler"
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "linux_uuid"
8
+ gem.summary = %Q{A non-portable, fast, simple, atomic UUID generator.}
9
+ gem.email = "john@dewey.ws"
10
+ gem.homepage = "http://github.com/retr0h/linux_uuid"
11
+ gem.authors = ["retr0h"]
12
+ end
13
+ Jeweler::GemcutterTasks.new
14
+ rescue LoadError
15
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
16
+ end
17
+
18
+ require "rake/testtask"
19
+ Rake::TestTask.new(:test) do |test|
20
+ test.libs << "./lib" << "./test"
21
+ test.pattern = "test/**/test_*.rb"
22
+ test.verbose = true
23
+ end
24
+
25
+ task :default => :test
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.0.0
data/lib/linux_uuid.rb ADDED
@@ -0,0 +1,17 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ ##
4
+ # Durty UUID generation.
5
+
6
+ class UUID
7
+ FP = File.open("/proc/sys/kernel/random/uuid", "rb")
8
+ FD = FP.fileno
9
+ require "io/extra"
10
+
11
+ ##
12
+ # Atomic read of Linux's UUID implementation.
13
+
14
+ def self.generate
15
+ IO.pread(FD, 36, 0)
16
+ end
17
+ end
@@ -0,0 +1,54 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{linux_uuid}
8
+ s.version = "1.0.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["retr0h"]
12
+ s.date = %q{2010-11-23}
13
+ s.email = %q{john@dewey.ws}
14
+ s.extra_rdoc_files = [
15
+ "LICENSE",
16
+ "README.md"
17
+ ]
18
+ s.files = [
19
+ ".rvmrc",
20
+ "Gemfile",
21
+ "Gemfile.lock",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "lib/linux_uuid.rb",
27
+ "linux_uuid.gemspec",
28
+ "test/test_linux_uuid.rb"
29
+ ]
30
+ s.homepage = %q{http://github.com/retr0h/linux_uuid}
31
+ s.require_paths = ["lib"]
32
+ s.rubygems_version = %q{1.3.7}
33
+ s.summary = %q{A non-portable, fast, simple, atomic UUID generator.}
34
+ s.test_files = [
35
+ "test/test_linux_uuid.rb"
36
+ ]
37
+
38
+ if s.respond_to? :specification_version then
39
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
40
+ s.specification_version = 3
41
+
42
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
44
+ s.add_runtime_dependency(%q<io-extra>, ["~> 1.2.3"])
45
+ else
46
+ s.add_dependency(%q<rake>, [">= 0"])
47
+ s.add_dependency(%q<io-extra>, ["~> 1.2.3"])
48
+ end
49
+ else
50
+ s.add_dependency(%q<rake>, [">= 0"])
51
+ s.add_dependency(%q<io-extra>, ["~> 1.2.3"])
52
+ end
53
+ end
54
+
@@ -0,0 +1,16 @@
1
+ # -*- encoding: UTF-8 -*-
2
+
3
+ Bundler.setup :default, :test
4
+
5
+ require "minitest/spec"
6
+ require "linux_uuid"
7
+
8
+ MiniTest::Unit.autorun
9
+
10
+ describe "UUID" do
11
+ describe "::generate" do
12
+ it "returns a valid uuid" do
13
+ UUID.generate.must_match %r{[a-z0-9-]}
14
+ end
15
+ end
16
+ end
metadata ADDED
@@ -0,0 +1,101 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: linux_uuid
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 0
8
+ - 0
9
+ version: 1.0.0
10
+ platform: ruby
11
+ authors:
12
+ - retr0h
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-11-23 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ prerelease: false
32
+ version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: io-extra
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 1
42
+ - 2
43
+ - 3
44
+ version: 1.2.3
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *id002
48
+ description:
49
+ email: john@dewey.ws
50
+ executables: []
51
+
52
+ extensions: []
53
+
54
+ extra_rdoc_files:
55
+ - LICENSE
56
+ - README.md
57
+ files:
58
+ - .rvmrc
59
+ - Gemfile
60
+ - Gemfile.lock
61
+ - LICENSE
62
+ - README.md
63
+ - Rakefile
64
+ - VERSION
65
+ - lib/linux_uuid.rb
66
+ - linux_uuid.gemspec
67
+ - test/test_linux_uuid.rb
68
+ has_rdoc: true
69
+ homepage: http://github.com/retr0h/linux_uuid
70
+ licenses: []
71
+
72
+ post_install_message:
73
+ rdoc_options: []
74
+
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ segments:
83
+ - 0
84
+ version: "0"
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
92
+ version: "0"
93
+ requirements: []
94
+
95
+ rubyforge_project:
96
+ rubygems_version: 1.3.7
97
+ signing_key:
98
+ specification_version: 3
99
+ summary: A non-portable, fast, simple, atomic UUID generator.
100
+ test_files:
101
+ - test/test_linux_uuid.rb