couchbase-id 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/couchbase-id/generator.rb +4 -4
- data/lib/couchbase-id/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da8dd917b2d0ff2d42d3ccf99e8f112d2d9a43bf
|
4
|
+
data.tar.gz: bc094f14054dae652b3ed2163f6fa4c090920ada
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54b5827c8bee2ce22312c1d741b09da0676a050c48a78d2a54407f5b74ed886ebac52a1c5cf646f710d420525af0a17f219ad54010db2c4f5cbc95dab8f5867
|
7
|
+
data.tar.gz: cd78f383ff212908387bacfcf4aba995c434723651a6f976d749ed5d3d85411901b25e942193de0a3c71a04e36449b3ff568888154124e78f0de57c65e50d7f2
|
@@ -26,11 +26,11 @@ module CouchbaseId
|
|
26
26
|
|
27
27
|
|
28
28
|
# Basic compression using UTF (more efficient for ID's stored as strings)
|
29
|
-
B65
|
30
|
-
B10
|
29
|
+
B65 ||= Radix::Base.new(Radix::BASE::B62 + ['-', '_', '~'])
|
30
|
+
B10 ||= Radix::Base.new(10)
|
31
31
|
|
32
32
|
# The cluster id this node belongs to (avoids XDCR clashes)
|
33
|
-
CLUSTER_ID ||= ENV['COUCHBASE_CLUSTER'] || 1 # Cluster ID number
|
33
|
+
CLUSTER_ID ||= Radix.convert((ENV['COUCHBASE_CLUSTER'] || 1), B10, B65) # Cluster ID number
|
34
34
|
|
35
35
|
# instance method
|
36
36
|
def generate_id
|
@@ -95,7 +95,7 @@ module CouchbaseId
|
|
95
95
|
|
96
96
|
def self.default_class_id_generator(overflow, count)
|
97
97
|
id = Radix.convert(overflow, B10, B65) + Radix.convert(count, B10, B65)
|
98
|
-
"#{self.design_document}
|
98
|
+
"#{self.design_document}_#{CLUSTER_ID}-#{id}"
|
99
99
|
end
|
100
100
|
|
101
101
|
#
|
data/lib/couchbase-id/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: couchbase-id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen von Takach
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: radix
|