ulid-ruby 1.0.0 → 1.0.2

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: 9b33ec732493540f7f7ccd651a3ca4e36a901423
4
- data.tar.gz: 3fb34fa672516f5bca5d2ba9a371244104ce22e3
2
+ SHA256:
3
+ metadata.gz: 15ca0a0b852ab53f6bcd65e8feb7ef5b42efcacab774307611a72edfb2034db5
4
+ data.tar.gz: 1c72579cc171eb3ae6aaeb6b033b04c7c822d1b8fed9bfd8da5b75a0081868e2
5
5
  SHA512:
6
- metadata.gz: ce0fea3b8a2db1694e3c5c7be1b912a661ac6d8e5cb8afd1951879f823bb339dd18e7dddb40a2c34b778b4770fdb69e29fc9c57d0e48e4ee2e1a546ada9f5c94
7
- data.tar.gz: 820f5d5804d4a8f364216ee75da1b8acc4eb26ec96ea90632aa053fa6cb5b435e0dee78803b80cfcec57c8c42d393d48c48ebd74f5fb9880044f551e1c022cbc
6
+ metadata.gz: f882a87eba0eaba107774bea7dcb073aab6ec50becb81cef983a0c179d14f6052338281a2988915fa8d1df2a2f442b7e5128202a8a7acd0ee6de5ccf007958c5
7
+ data.tar.gz: f0e3480c20262233d5a312d5e424b78ade85fc1f6f40d48d42121190607025e276804df87050a2c8fd59f9b1873af7e76fdbb24e007be0f41dbc5524bbda9318
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.4.0
1
+ 3.1.0
data/lib/ulid/generate.rb CHANGED
@@ -61,7 +61,7 @@ module ULID
61
61
  end
62
62
 
63
63
  def millisecond_time
64
- (@time.to_f * 1_000).to_i
64
+ (@time.to_r * 1_000).to_i
65
65
  end
66
66
 
67
67
  # THIS IS CORRECT (to the ULID spec)
data/lib/ulid/parse.rb CHANGED
@@ -51,7 +51,7 @@ module ULID
51
51
  (time_bytes[1].to_i << 32) |
52
52
  (time_bytes[0].to_i << 40)
53
53
 
54
- [ Time.at( time_int * 0.001 ).utc, seed ]
54
+ [ Time.at( time_int * 1/1000r ).utc, seed ]
55
55
  end
56
56
 
57
57
  end
data/lib/ulid/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module ULID
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
3
3
  end
4
4
 
data/lib/ulid.rb CHANGED
@@ -40,7 +40,7 @@ module ULID
40
40
  # @return [String] new ULID string encoding the given time
41
41
  #
42
42
  # @example Generate a ULID string for a given time
43
- # ULID.at(Time.at(1_000_000)) #=> 0009A0QS00SGEFTGMFFEAS6B9A
43
+ # ULID.at(Time.at(1_000_000)) #=> 0000XSNJG0H890HQE70THPQ3D3
44
44
  #
45
45
  def self.at(at_time)
46
46
  Identifier.new(at_time).ulid
@@ -52,7 +52,7 @@ module ULID
52
52
  # @return [Time] UTC time value encoded by the ULID
53
53
  #
54
54
  # @example Parse a ULID string and get a time value
55
- # ULID.time '0009A0QS00SGEFTGMFFEAS6B9A' #=> 1970-01-12 13:46:40 UTC
55
+ # ULID.time '0009A0QS00SGEFTGMFFEAS6B9A' #=> 1970-04-26 17:46:40 UTC
56
56
  #
57
57
  def self.time(ulid)
58
58
  Identifier.new(ulid).time.utc
@@ -64,7 +64,7 @@ module ULID
64
64
  # @return [String] the lexicographically minimum ULID value for the given time
65
65
  #
66
66
  # @example Get minimal ULID at time
67
- # ULID.min_ulid_at Time.at(1_000_000) #=> "0009A0QS000000000000000000"
67
+ # ULID.min_ulid_at Time.at(1_000_000) #=> "0000XSNJG00000000000000000"
68
68
  #
69
69
  def self.min_ulid_at(at_time)
70
70
  Identifier.new(at_time, MIN_ENTROPY).ulid
@@ -76,7 +76,7 @@ module ULID
76
76
  # @return [String] the lexicographically maximum ULID value for the given time
77
77
  #
78
78
  # @example Get minimal ULID at time
79
- # ULID.max_ulid_at Time.at(1_000_000) #=> "0009A0QS00ZZZZZZZZZZZZZZZZ"
79
+ # ULID.max_ulid_at Time.at(1_000_000) #=> "0000XSNJG0ZZZZZZZZZZZZZZZZ"
80
80
  #
81
81
  def self.max_ulid_at(at_time)
82
82
  Identifier.new(at_time, MAX_ENTROPY).ulid
data/ulid-ruby.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  regardless of where they were generated.
18
18
  }
19
19
  spec.homepage = "https://github.com/abachman/ulid-ruby"
20
- spec.license = "mit"
20
+ spec.license = "MIT"
21
21
 
22
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
23
  f.match(%r{^(test|spec|features)/})
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.executables = spec.files.grep(%r{^exe/}) { |f| file.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_development_dependency "bundler", "~> 1.14"
30
- spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "bundler", "~> 2"
30
+ spec.add_development_dependency "rake", ">= 12.3.3"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
32
  spec.add_development_dependency "yard", "~> 0.9"
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ulid-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Bachman
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-24 00:00:00.000000000 Z
11
+ date: 2022-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '2'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -98,9 +98,9 @@ files:
98
98
  - ulid-ruby.gemspec
99
99
  homepage: https://github.com/abachman/ulid-ruby
100
100
  licenses:
101
- - mit
101
+ - MIT
102
102
  metadata: {}
103
- post_install_message:
103
+ post_install_message:
104
104
  rdoc_options: []
105
105
  require_paths:
106
106
  - lib
@@ -115,9 +115,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
117
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.6.8
120
- signing_key:
118
+ rubygems_version: 3.3.3
119
+ signing_key:
121
120
  specification_version: 4
122
121
  summary: Ruby library providing support for Universally unique Lexicographically sortable
123
122
  IDentifiers