rust_uuid 0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0abc3fb62060665369a0a2c9dc94a47acbd05e1a
4
+ data.tar.gz: 8f8646a6a844228a8236032c03bb7f4e952e0f24
5
+ SHA512:
6
+ metadata.gz: bf0d6fec491a9f12e3cc509512ebd269d6bc0ec5a93823614d04700ec509eaf8ca1d148b7443a51b2be59d6c26f8638741020b43165546c666a167b2d535be82
7
+ data.tar.gz: f73e7d0287d8adfd552f983c7cdeca56acf68d198bdab47df8edfe8bef006b2a8b9442acaa96eb3582d2452c3a156043b07944e078e014c2f4b548e3a9dced42
@@ -0,0 +1,291 @@
1
+ [root]
2
+ name = "ruuid"
3
+ version = "0.1.0"
4
+ dependencies = [
5
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
6
+ "uuid_v1 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
7
+ ]
8
+
9
+ [[package]]
10
+ name = "aho-corasick"
11
+ version = "0.5.3"
12
+ source = "registry+https://github.com/rust-lang/crates.io-index"
13
+ dependencies = [
14
+ "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
15
+ ]
16
+
17
+ [[package]]
18
+ name = "bitflags"
19
+ version = "0.4.0"
20
+ source = "registry+https://github.com/rust-lang/crates.io-index"
21
+
22
+ [[package]]
23
+ name = "bitflags"
24
+ version = "0.5.0"
25
+ source = "registry+https://github.com/rust-lang/crates.io-index"
26
+
27
+ [[package]]
28
+ name = "byteorder"
29
+ version = "1.0.0"
30
+ source = "registry+https://github.com/rust-lang/crates.io-index"
31
+
32
+ [[package]]
33
+ name = "chrono"
34
+ version = "0.3.0"
35
+ source = "registry+https://github.com/rust-lang/crates.io-index"
36
+ dependencies = [
37
+ "num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
38
+ "time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
39
+ ]
40
+
41
+ [[package]]
42
+ name = "gcc"
43
+ version = "0.3.45"
44
+ source = "registry+https://github.com/rust-lang/crates.io-index"
45
+
46
+ [[package]]
47
+ name = "handlebars"
48
+ version = "0.16.1"
49
+ source = "registry+https://github.com/rust-lang/crates.io-index"
50
+ dependencies = [
51
+ "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
52
+ "lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
53
+ "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
54
+ "quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
55
+ "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)",
56
+ "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)",
57
+ ]
58
+
59
+ [[package]]
60
+ name = "interfaces"
61
+ version = "0.0.1"
62
+ source = "registry+https://github.com/rust-lang/crates.io-index"
63
+ dependencies = [
64
+ "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
65
+ "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)",
66
+ "handlebars 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)",
67
+ "ip 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
68
+ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
69
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
70
+ "nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
71
+ "rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)",
72
+ ]
73
+
74
+ [[package]]
75
+ name = "ip"
76
+ version = "1.1.1"
77
+ source = "registry+https://github.com/rust-lang/crates.io-index"
78
+
79
+ [[package]]
80
+ name = "itertools"
81
+ version = "0.4.19"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+
84
+ [[package]]
85
+ name = "kernel32-sys"
86
+ version = "0.2.2"
87
+ source = "registry+https://github.com/rust-lang/crates.io-index"
88
+ dependencies = [
89
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
90
+ "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
91
+ ]
92
+
93
+ [[package]]
94
+ name = "lazy_static"
95
+ version = "0.1.16"
96
+ source = "registry+https://github.com/rust-lang/crates.io-index"
97
+
98
+ [[package]]
99
+ name = "lazy_static"
100
+ version = "0.2.8"
101
+ source = "registry+https://github.com/rust-lang/crates.io-index"
102
+
103
+ [[package]]
104
+ name = "libc"
105
+ version = "0.2.21"
106
+ source = "registry+https://github.com/rust-lang/crates.io-index"
107
+
108
+ [[package]]
109
+ name = "log"
110
+ version = "0.3.7"
111
+ source = "registry+https://github.com/rust-lang/crates.io-index"
112
+
113
+ [[package]]
114
+ name = "memchr"
115
+ version = "0.1.11"
116
+ source = "registry+https://github.com/rust-lang/crates.io-index"
117
+ dependencies = [
118
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
119
+ ]
120
+
121
+ [[package]]
122
+ name = "nix"
123
+ version = "0.5.1"
124
+ source = "registry+https://github.com/rust-lang/crates.io-index"
125
+ dependencies = [
126
+ "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
127
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
128
+ ]
129
+
130
+ [[package]]
131
+ name = "num"
132
+ version = "0.1.37"
133
+ source = "registry+https://github.com/rust-lang/crates.io-index"
134
+ dependencies = [
135
+ "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
136
+ "num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)",
137
+ "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
138
+ ]
139
+
140
+ [[package]]
141
+ name = "num-integer"
142
+ version = "0.1.34"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ dependencies = [
145
+ "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
146
+ ]
147
+
148
+ [[package]]
149
+ name = "num-iter"
150
+ version = "0.1.33"
151
+ source = "registry+https://github.com/rust-lang/crates.io-index"
152
+ dependencies = [
153
+ "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)",
154
+ "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
155
+ ]
156
+
157
+ [[package]]
158
+ name = "num-traits"
159
+ version = "0.1.37"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+
162
+ [[package]]
163
+ name = "quick-error"
164
+ version = "1.1.0"
165
+ source = "registry+https://github.com/rust-lang/crates.io-index"
166
+
167
+ [[package]]
168
+ name = "rand"
169
+ version = "0.3.15"
170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
171
+ dependencies = [
172
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "redox_syscall"
177
+ version = "0.1.17"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+
180
+ [[package]]
181
+ name = "regex"
182
+ version = "0.1.80"
183
+ source = "registry+https://github.com/rust-lang/crates.io-index"
184
+ dependencies = [
185
+ "aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
186
+ "memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
187
+ "regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
188
+ "thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
189
+ "utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
190
+ ]
191
+
192
+ [[package]]
193
+ name = "regex-syntax"
194
+ version = "0.3.9"
195
+ source = "registry+https://github.com/rust-lang/crates.io-index"
196
+
197
+ [[package]]
198
+ name = "rustc-serialize"
199
+ version = "0.3.23"
200
+ source = "registry+https://github.com/rust-lang/crates.io-index"
201
+
202
+ [[package]]
203
+ name = "thread-id"
204
+ version = "2.0.0"
205
+ source = "registry+https://github.com/rust-lang/crates.io-index"
206
+ dependencies = [
207
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
208
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
209
+ ]
210
+
211
+ [[package]]
212
+ name = "thread_local"
213
+ version = "0.2.7"
214
+ source = "registry+https://github.com/rust-lang/crates.io-index"
215
+ dependencies = [
216
+ "thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
217
+ ]
218
+
219
+ [[package]]
220
+ name = "time"
221
+ version = "0.1.36"
222
+ source = "registry+https://github.com/rust-lang/crates.io-index"
223
+ dependencies = [
224
+ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
225
+ "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
226
+ "redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
227
+ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
228
+ ]
229
+
230
+ [[package]]
231
+ name = "utf8-ranges"
232
+ version = "0.1.3"
233
+ source = "registry+https://github.com/rust-lang/crates.io-index"
234
+
235
+ [[package]]
236
+ name = "uuid_v1"
237
+ version = "0.1.2"
238
+ source = "registry+https://github.com/rust-lang/crates.io-index"
239
+ dependencies = [
240
+ "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
241
+ "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
242
+ "interfaces 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
243
+ "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
244
+ "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
245
+ ]
246
+
247
+ [[package]]
248
+ name = "winapi"
249
+ version = "0.2.8"
250
+ source = "registry+https://github.com/rust-lang/crates.io-index"
251
+
252
+ [[package]]
253
+ name = "winapi-build"
254
+ version = "0.1.1"
255
+ source = "registry+https://github.com/rust-lang/crates.io-index"
256
+
257
+ [metadata]
258
+ "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66"
259
+ "checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3"
260
+ "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23"
261
+ "checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8"
262
+ "checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e"
263
+ "checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae"
264
+ "checksum handlebars 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf35fba54316319d55e8f97eedb97cf19484ad22bde6a312f141d32e25fb6855"
265
+ "checksum interfaces 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd8394a2da270283045b018c5b64ac07ec0251eb49206a22260aa344a0ccafe"
266
+ "checksum ip 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7349baf09910ffb475d8ea8a16f1bbe5ec2be295373feef33fb4fea658b8a0ef"
267
+ "checksum itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f"
268
+ "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
269
+ "checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"
270
+ "checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"
271
+ "checksum libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)" = "88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135"
272
+ "checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad"
273
+ "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"
274
+ "checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79"
275
+ "checksum num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "98b15ba84e910ea7a1973bccd3df7b31ae282bf9d8bd2897779950c9b8303d40"
276
+ "checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37"
277
+ "checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e"
278
+ "checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99"
279
+ "checksum quick-error 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0aad603e8d7fb67da22dbdf1f4b826ce8829e406124109e73cf1b2454b93a71c"
280
+ "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
281
+ "checksum redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b"
282
+ "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
283
+ "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
284
+ "checksum rustc-serialize 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "684ce48436d6465300c9ea783b6b14c4361d6b8dcbb1375b486a69cc19e2dfb0"
285
+ "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
286
+ "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
287
+ "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade"
288
+ "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f"
289
+ "checksum uuid_v1 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c71dd199c233ff1ce79868530f71599c64a76548b8d161a75ed4bb191aa25c"
290
+ "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
291
+ "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
@@ -0,0 +1,12 @@
1
+ [package]
2
+ name = "ruuid"
3
+ version = "0.1.0"
4
+ authors = ["blackanger"]
5
+
6
+ [lib]
7
+ name = "ruuid"
8
+ crate-type = ["dylib"]
9
+
10
+ [dependencies]
11
+ libc = "0.2.11"
12
+ uuid_v1 = "0.1.2"
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Daniel P. Clark
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # Usage
2
+
3
+ ```ruby
4
+ require 'ruuid'
5
+ Ruuid.generate #=> "67dd7f7a-2110-11e7-98e2-02420b8157eb"
6
+ ```
7
+
8
+ # Installation
9
+
10
+ Ensure Rust is installed:
11
+
12
+ [Rust Downloads](https://www.rust-lang.org/en-US/install.html)
13
+
14
+ ```
15
+ curl -sSf https://static.rust-lang.org/rustup.sh | sh
16
+ ```
17
+
18
+ Add this line to your application's Gemfile:
19
+
20
+ ```
21
+ gem instal 'ruuid', '~> 0.1.0'
22
+
23
+ ```
24
+ And then execute:
25
+
26
+ $ bundle
27
+
28
+ Or install it yourself as:
29
+
30
+ $ gem install ruuid
31
+
32
+ > MAC USERS: At the moment Mac users need to install the extension manualy.
33
+ > Go to the gem directory and run cargo build --release .
34
+ > There is an issue opened for this and I'm looking for people who have Macs to help on this.
@@ -0,0 +1,61 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+ require 'fileutils'
4
+ desc 'System Details'
5
+ task :sysinfo do
6
+ puts "faster_path #{FasterPath::VERSION}"
7
+ puts
8
+ puts `rustc -Vv`
9
+ puts `cargo -Vv`
10
+ IO.read('Cargo.toml').split('[dependencies]').last.split("\n").
11
+ select {|line| line =~ /=/ }.
12
+ each {|line| puts "%s\t%s" % line.match(/(\S+)[ ="']{1,4}([\d.]+)["']?/).captures }
13
+ puts
14
+ puts RUBY_DESCRIPTION
15
+ puts "bundler\t#{Bundler::VERSION}"
16
+ puts "rake\t#{Rake::VERSION}"
17
+ require 'ffi/version';
18
+ puts "ffi\t#{FFI::VERSION}"
19
+ begin
20
+ puts "%s\t%s" % IO.read('Gemfile.lock').match(/(mspec) \(([\d\.]+)\)/).captures
21
+ rescue Errno::ENOENT => _
22
+ puts "\nNo Gemfile.lock"
23
+ end
24
+ end
25
+
26
+ desc "Build Rust extension"
27
+ task :build_src do
28
+ puts "Building extension..."
29
+ sh "cargo build --release"
30
+ end
31
+
32
+ desc "Clean up Rust build"
33
+ task :clean_src do
34
+ puts "Cleaning up build..."
35
+ # Remove all but library file
36
+ FileUtils.
37
+ rm_rf(
38
+ Dir.
39
+ glob('target/release/*').
40
+ keep_if do |f|
41
+ !f[/\.(?:so|dll|dylib|deps)\z/]
42
+ end
43
+ )
44
+ end
45
+
46
+ desc "Build + clean up Rust extension"
47
+ task build_lib: [:build_src, :clean_src] do
48
+ puts "Completed build!"
49
+ end
50
+
51
+
52
+ Rake::TestTask.new(minitest: :build_lib) do |t|
53
+ t.libs << "test"
54
+ t.libs << "lib"
55
+ t.test_files = FileList['test/**/*_test.rb']
56
+ end
57
+
58
+
59
+
60
+
61
+ task default: :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "ruuid"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,19 @@
1
+ require 'mkmf'
2
+
3
+ have_header('Dummy Makefile')
4
+
5
+ unless find_executable('cargo')
6
+ puts "You need to have Rust installed for this gem to build natively."
7
+ puts "Please install the latest nightly build:"
8
+ puts
9
+ puts "curl -sSf https://static.rust-lang.org/rustup.sh | sudo sh -s -- --channel=nightly"
10
+ puts
11
+ at_exit { puts "Exiting..."}
12
+ end
13
+
14
+ Dir.chdir(File.expand_path("../../", File.dirname(__FILE__))) do
15
+ `rake build_src`
16
+ `rake clean_src`
17
+ end
18
+
19
+ create_makefile('ruuid/dummy')
@@ -0,0 +1,22 @@
1
+ require "ruuid/version"
2
+ require "ffi"
3
+
4
+ module Ruuid
5
+
6
+ def self.generate
7
+ Rust.generate_uuid
8
+ end
9
+
10
+ module Rust
11
+ extend FFI::Library
12
+
13
+ ffi_lib begin
14
+ prefix = Gem.win_platform? ? "" : "lib"
15
+ "#{File.expand_path("../target/release/", __dir__)}/#{prefix}ruuid.#{FFI::Platform::LIBSUFFIX}"
16
+ end
17
+
18
+ attach_function :generate_uuid, [], :string
19
+
20
+ end
21
+ private_constant :Rust
22
+ end
@@ -0,0 +1,3 @@
1
+ module Ruuid
2
+ VERSION="0.1"
3
+ end
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'ruuid/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rust_uuid"
8
+ spec.version = Ruuid::VERSION
9
+ spec.authors = ["blackanger"]
10
+ spec.email = ["blackanger.z@gmail.com"]
11
+ spec.summary = 'UUID generator dancing with Rust'
12
+ spec.description = 'UUID generator dancing with Rust'
13
+ spec.homepage = "https://github.com/RustStudy/ruuid"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = [
17
+ "Cargo.lock", "Cargo.toml", "Gemfile",
18
+ "MIT-LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup",
19
+ "ext/ruuid/extconf.rb", "ruuid.gemspec"
20
+ ]
21
+ spec.files += Dir['lib/**/*']
22
+ spec.files += Dir['src/**/*']
23
+
24
+ spec.extensions << "ext/ruuid/extconf.rb"
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_dependency "bundler", "~> 1.12"
28
+ spec.add_dependency "rake", "~> 12.0"
29
+ spec.add_dependency "ffi", "~> 1.9"
30
+ spec.add_development_dependency "method_source", "~> 0.8.2"
31
+ spec.add_development_dependency "minitest", "~> 5.10"
32
+ spec.add_development_dependency "minitest-reporters", "~> 1.1"
33
+ end
@@ -0,0 +1,10 @@
1
+ extern crate uuid_v1;
2
+
3
+ use libc::c_char;
4
+ use std::ffi::{CStr, CString};
5
+
6
+ #[no_mangle]
7
+ pub extern "C" fn generate_uuid() -> *const c_char {
8
+ let uuid = uuid_v1::new_v1();
9
+ CString::new(&*uuid.to_string()).unwrap().into_raw()
10
+ }
@@ -0,0 +1,3 @@
1
+ extern crate libc;
2
+
3
+ pub mod generate_uuid;
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rust_uuid
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - blackanger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.12'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '12.0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '12.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ffi
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.9'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: method_source
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.8.2
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.2
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest-reporters
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.1'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.1'
97
+ description: UUID generator dancing with Rust
98
+ email:
99
+ - blackanger.z@gmail.com
100
+ executables: []
101
+ extensions:
102
+ - ext/ruuid/extconf.rb
103
+ extra_rdoc_files: []
104
+ files:
105
+ - Cargo.lock
106
+ - Cargo.toml
107
+ - Gemfile
108
+ - MIT-LICENSE.txt
109
+ - README.md
110
+ - Rakefile
111
+ - bin/console
112
+ - bin/setup
113
+ - ext/ruuid/extconf.rb
114
+ - lib/ruuid.rb
115
+ - lib/ruuid/version.rb
116
+ - ruuid.gemspec
117
+ - src/generate_uuid.rs
118
+ - src/lib.rs
119
+ homepage: https://github.com/RustStudy/ruuid
120
+ licenses:
121
+ - MIT
122
+ metadata: {}
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.5.2
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: UUID generator dancing with Rust
143
+ test_files: []