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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 03bc2de0fb5ae2bc10bde722295e1c7f7c7a912b
4
- data.tar.gz: 887a82ec9829ac9990317e4701ffdaa717fddc26
2
+ SHA256:
3
+ metadata.gz: 2369ada8caf44cb56b0bd9a0a533ace82f56f2d6f50a064d2e4fd3152d4cfc71
4
+ data.tar.gz: 74de2b74d6f9cf0a56abeafba9251aee8e155ddd064f174ce8b08f99f3eea005
5
5
  SHA512:
6
- metadata.gz: 2dc8722e8eb98d7c0338b1f60d77fda05246f0c47f1a9b9d0334bfa36d5ad22ffc8b8a23be31526419675348bc9e650b5242446eeb560954abea34d3ce4e0839
7
- data.tar.gz: c183da4396e588eb76c17016a6cbbe7aa6e5a4bfb664b1246b4d2b8ba5f93ce4015bb20350c2daa5f3c05ae1a01c2dbf3be8dff3f9808e493b34d0ff18514d3b
6
+ metadata.gz: a30072db66bd28fe10dffcd2f73ff81ba1b042e8ec0473af9af1ef5c9aa859043dbb181781f661752d171a22c63a916a51c11e61f238fac3dc8ff0945f991fbd
7
+ data.tar.gz: d39f257960ad0126bcf5011adf1eeab87ced18f0ab38881f76abefd6fb0b83899eadb5ec87ae4177ee287b9bee08e36542ceaaf9c7bd16e3c014530f948d7b66
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ```ruby
22
22
  require 'barking_iguana/unique_id'
23
- BarkingIguana::UniqueId.generate # => "0.0.1-shiv-Kf9-1YGmYi-3C1TsC"
23
+ BarkingIguana::UniqueId.generate # => "0.0.2-vi-8N2-1jOXzk-NRl-4LX8YS"
24
24
  ```
25
25
 
26
26
  ## Contributing
@@ -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"
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'barking_iguana/unique_id'
4
+
5
+ number = ARGV[0].to_s.strip.empty? ? 1 : ARGV[0].to_i
6
+ number.times do
7
+ puts BarkingIguana::UniqueId.generate
8
+ end
@@ -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 = squash Time.now.to_i
13
- r = squash rand(9_999_999_999)
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
@@ -1,5 +1,5 @@
1
1
  module BarkingIguana
2
2
  module UniqueId
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
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.1
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: 2015-01-29 00:00:00.000000000 Z
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
- rubyforge_project:
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.