clusterid 1.0.0 → 1.0.1

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
2
  SHA256:
3
- metadata.gz: 0b662076bc46a6188f0d587292d36cae6fb54b179d4b5e9077b114c8c36b6c1a
4
- data.tar.gz: 9135abab52b8494ee37f0958d34dbceb9122e3b1babe6e5aa0113d76addb0d80
3
+ metadata.gz: ed2451fa08500d8ba5e920f5f90663dbbc1e3ad2c23847286ad3ea6d6b64f1eb
4
+ data.tar.gz: f548685c834b0025631d569865efb510d23555f028dca67b091a638c1652637e
5
5
  SHA512:
6
- metadata.gz: 262e9dfefed1d936a8f5d406dc2d3d1cd0df8bf3508a4d72ba9cc085adc897035f5e93717594cffabf47289eaeff9d90d0923b195d4a1aa7961affad5ba54867
7
- data.tar.gz: eed23a12338f989ca94729a64179a6965bb7b3fc8cfa4db6608a766b77ace168bfe6b2d6bced72e68eee86d4669e6e68071a0f96b4420768854b047d0d102043
6
+ metadata.gz: a3e69fc747ebf7721ea669ae753e73d0399d8228e627312962eeab0404bdf7c09cee0be90cc088d626f85e17dfb9df09cc57250fdf1fd7b9581fde565353deb9
7
+ data.tar.gz: d504bf0f8a1e9d7bc90d3d70b0ff9b3e3b967d6277ace20f1167c8865ed856249c39c4a1504561f04ae025301bc3abb11e50d3d11444e92394c7f3317936ca58
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.1 - 2022-03-07
4
+ ### Changed
5
+ - The `ClusterId::V1::Value#<=>` method now returns `nil` for uncomparable types.
6
+ - The `ClusterId::V1::Value#<=>` method has been updated to compare against all properties except version.
7
+
3
8
  ## v1.0.0 - 2022-02-26
4
9
  - Initial release
@@ -112,7 +112,21 @@ module ClusterId
112
112
  # @param other [Value] the object to compare against
113
113
  # @return [-1, 0, 1] -1 when less than +other+, 0 when equal to +other+, 1 when greater than +other+
114
114
  def <=>(other)
115
- datetime <=> other.datetime
115
+ return nil if self.class != other.class
116
+
117
+ cmp = datetime <=> other.datetime
118
+ return cmp unless cmp.zero?
119
+
120
+ cmp = data_centre <=> other.data_centre
121
+ return cmp unless cmp.zero?
122
+
123
+ cmp = environment <=> other.environment
124
+ return cmp unless cmp.zero?
125
+
126
+ cmp = type_id <=> other.type_id
127
+ return cmp unless cmp.zero?
128
+
129
+ nonce <=> other.nonce
116
130
  end
117
131
  end
118
132
  end
@@ -4,5 +4,5 @@
4
4
  # @since 1.0.0
5
5
  module ClusterId
6
6
  # The gem version.
7
- VERSION = "1.0.0"
7
+ VERSION = "1.0.1"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clusterid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Tarulli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-27 00:00:00.000000000 Z
11
+ date: 2022-03-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create unique identifiers for entities in distributed systems
14
14
  email:
@@ -38,7 +38,7 @@ metadata:
38
38
  source_code_uri: https://github.com/tinychameleon/clusterid
39
39
  changelog_uri: https://github.com/tinychameleon/clusterid/blob/main/CHANGELOG.md
40
40
  bug_tracker_uri: https://github.com/tinychameleon/clusterid/issues
41
- documentation_uri: https://tinychameleon.github.com/clusterid/
41
+ documentation_uri: https://tinychameleon.github.io/clusterid/
42
42
  post_install_message:
43
43
  rdoc_options: []
44
44
  require_paths: