ulid 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.circleci/config.yml +50 -0
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -3
- data/lib/ulid/generator.rb +6 -2
- data/lib/ulid/version.rb +1 -1
- data/spec/lib/ulid_spec.rb +1 -1
- data/ulid.gemspec +1 -1
- metadata +5 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1edaa0327ef87c3e253bba262945fd44ca79e5b75592da8730650a85c6bdc400
|
4
|
+
data.tar.gz: 4aea0c8c2a93341410d9da2880390d06a9723effd283079b61b44c6b99b5ff3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03a78283cfb641590e7c5eda7054afe9ea63efffb7d268f6ce93289d66db56b6d67c83784792ffb715bb49c48ebd81a520cbbe2e5e225dd81364e52fbe98ed88
|
7
|
+
data.tar.gz: a84b4d06796ccd2a9e9e27bb366b331bf0eaa3244e998b222d51917a89890730199cacd39ceece9ca2998c8280cd2abe6ae3cc64b77447d04b5707bae387404f
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/2.5.3-stretch
|
11
|
+
|
12
|
+
working_directory: ~/repo
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- checkout
|
16
|
+
|
17
|
+
# Download and cache dependencies
|
18
|
+
- restore_cache:
|
19
|
+
keys:
|
20
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
21
|
+
# fallback to using the latest cache if no exact match is found
|
22
|
+
- v1-dependencies-
|
23
|
+
|
24
|
+
- run:
|
25
|
+
name: install dependencies
|
26
|
+
command: |
|
27
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
28
|
+
|
29
|
+
- save_cache:
|
30
|
+
paths:
|
31
|
+
- ./vendor/bundle
|
32
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
33
|
+
|
34
|
+
# run tests!
|
35
|
+
- run:
|
36
|
+
name: run tests
|
37
|
+
command: |
|
38
|
+
mkdir /tmp/test-results
|
39
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
|
40
|
+
circleci tests split --split-by=timings)"
|
41
|
+
|
42
|
+
bundle exec test
|
43
|
+
$TEST_FILES
|
44
|
+
|
45
|
+
# collect reports
|
46
|
+
- store_test_results:
|
47
|
+
path: /tmp/test-results
|
48
|
+
- store_artifacts:
|
49
|
+
path: /tmp/test-results
|
50
|
+
destination: test-results
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,7 +2,6 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
ulid (1.0.0)
|
5
|
-
sysrandom (>= 1.0.0, < 2.0)
|
6
5
|
|
7
6
|
GEM
|
8
7
|
remote: https://rubygems.org/
|
@@ -37,7 +36,6 @@ GEM
|
|
37
36
|
ruby-progressbar (~> 1.7)
|
38
37
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
39
38
|
ruby-progressbar (1.8.3)
|
40
|
-
sysrandom (1.0.5)
|
41
39
|
timecop (0.9.1)
|
42
40
|
unicode-display_width (1.3.0)
|
43
41
|
|
@@ -55,4 +53,4 @@ DEPENDENCIES
|
|
55
53
|
ulid!
|
56
54
|
|
57
55
|
BUNDLED WITH
|
58
|
-
1.
|
56
|
+
1.17.3
|
data/lib/ulid/generator.rb
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
|
1
|
+
if RUBY_VERSION >= '2.5'
|
2
|
+
require 'securerandom'
|
3
|
+
else
|
4
|
+
require 'sysrandom/securerandom'
|
5
|
+
end
|
2
6
|
|
3
7
|
module ULID
|
4
8
|
module Generator
|
@@ -46,7 +50,7 @@ module ULID
|
|
46
50
|
end
|
47
51
|
|
48
52
|
def random_bytes
|
49
|
-
|
53
|
+
SecureRandom.random_bytes(RANDOM_BYTES)
|
50
54
|
end
|
51
55
|
end
|
52
56
|
end
|
data/lib/ulid/version.rb
CHANGED
data/spec/lib/ulid_spec.rb
CHANGED
@@ -49,7 +49,7 @@ describe ULID do
|
|
49
49
|
end
|
50
50
|
|
51
51
|
it 'encodes the remaining 80 bits as random' do
|
52
|
-
random_bytes =
|
52
|
+
random_bytes = SecureRandom.random_bytes(ULID::Generator::RANDOM_BYTES)
|
53
53
|
ULID.stubs(:random_bytes).returns(random_bytes)
|
54
54
|
bytes = ULID.generate_bytes
|
55
55
|
assert bytes[6..-1] == random_bytes
|
data/ulid.gemspec
CHANGED
@@ -17,5 +17,5 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_dependency 'sysrandom', '>= 1.0.0', '< 2.0'
|
20
|
+
spec.add_dependency 'sysrandom', '>= 1.0.0', '< 2.0' if RUBY_VERSION < '2.5'
|
21
21
|
end
|
metadata
CHANGED
@@ -1,35 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ulid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafael Sales
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: sysrandom
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ">="
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.0.0
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '2.0'
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 1.0.0
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '2.0'
|
11
|
+
date: 2019-04-02 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
33
13
|
description:
|
34
14
|
email:
|
35
15
|
- rafaelcds@gmail.com
|
@@ -37,6 +17,7 @@ executables: []
|
|
37
17
|
extensions: []
|
38
18
|
extra_rdoc_files: []
|
39
19
|
files:
|
20
|
+
- ".circleci/config.yml"
|
40
21
|
- ".gitignore"
|
41
22
|
- ".rubocop.yml"
|
42
23
|
- CHANGELOG.md
|
@@ -72,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
53
|
version: '0'
|
73
54
|
requirements: []
|
74
55
|
rubyforge_project:
|
75
|
-
rubygems_version: 2.6
|
56
|
+
rubygems_version: 2.7.6
|
76
57
|
signing_key:
|
77
58
|
specification_version: 4
|
78
59
|
summary: Universally Unique Lexicographically Sortable Identifier implementation for
|