barking_iguana-unique_id 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/barking_iguana-unique_id.gemspec +1 -1
- data/bin/unique_id +8 -0
- data/lib/barking_iguana/unique_id.rb +4 -3
- data/lib/barking_iguana/unique_id/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2369ada8caf44cb56b0bd9a0a533ace82f56f2d6f50a064d2e4fd3152d4cfc71
|
4
|
+
data.tar.gz: 74de2b74d6f9cf0a56abeafba9251aee8e155ddd064f174ce8b08f99f3eea005
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a30072db66bd28fe10dffcd2f73ff81ba1b042e8ec0473af9af1ef5c9aa859043dbb181781f661752d171a22c63a916a51c11e61f238fac3dc8ff0945f991fbd
|
7
|
+
data.tar.gz: d39f257960ad0126bcf5011adf1eeab87ced18f0ab38881f76abefd6fb0b83899eadb5ec87ae4177ee287b9bee08e36542ceaaf9c7bd16e3c014530f948d7b66
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'barking_iguana/unique_id'
|
4
|
+
require 'barking_iguana/unique_id/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "barking_iguana-unique_id"
|
data/bin/unique_id
ADDED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'base_n'
|
2
|
+
require 'socket'
|
2
3
|
|
3
4
|
module BarkingIguana
|
4
5
|
module UniqueId
|
@@ -9,9 +10,9 @@ module BarkingIguana
|
|
9
10
|
end
|
10
11
|
|
11
12
|
def self.generate
|
12
|
-
t =
|
13
|
-
r = squash
|
14
|
-
[ prefix, t, r ].join '-'
|
13
|
+
t, n = Time.now.to_f.to_s.split('.', 2).map { |s| squash s }
|
14
|
+
r = squash(rand(9_999_999_999))
|
15
|
+
[ prefix, t, n, r ].join '-'
|
15
16
|
end
|
16
17
|
|
17
18
|
def self.hostname
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barking_iguana-unique_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Craig R Webster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -55,7 +55,8 @@ dependencies:
|
|
55
55
|
description:
|
56
56
|
email:
|
57
57
|
- craig@barkingiguana.com
|
58
|
-
executables:
|
58
|
+
executables:
|
59
|
+
- unique_id
|
59
60
|
extensions: []
|
60
61
|
extra_rdoc_files: []
|
61
62
|
files:
|
@@ -65,6 +66,7 @@ files:
|
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
67
68
|
- barking_iguana-unique_id.gemspec
|
69
|
+
- bin/unique_id
|
68
70
|
- lib/barking_iguana/unique_id.rb
|
69
71
|
- lib/barking_iguana/unique_id/version.rb
|
70
72
|
homepage: ''
|
@@ -86,8 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
88
|
- !ruby/object:Gem::Version
|
87
89
|
version: '0'
|
88
90
|
requirements: []
|
89
|
-
|
90
|
-
rubygems_version: 2.2.2
|
91
|
+
rubygems_version: 3.1.2
|
91
92
|
signing_key:
|
92
93
|
specification_version: 4
|
93
94
|
summary: Generate almost definitely unique IDs pretty easily.
|