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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ba091ef13ef2cab543c828bdf01b2cb0da717ab
4
- data.tar.gz: 3d5e394d0a632eb19a85f5e2a66862f61efc1ce7
3
+ metadata.gz: da8dd917b2d0ff2d42d3ccf99e8f112d2d9a43bf
4
+ data.tar.gz: bc094f14054dae652b3ed2163f6fa4c090920ada
5
5
  SHA512:
6
- metadata.gz: 17030462061d2bc1951bbcfa7383b360fa5f2eb4afaed8a944f67e6b83559428de6ff31a6b51b282198e43239fff54b72c007db164da16f0bbef1bdf23d48ed0
7
- data.tar.gz: 03d3c2fae7bd286ea4ae44ffc0ba1d2a5a090a804c2b3145afb2c5cd0aaad4620c6e23a91b70fd862cfc027a5aeec4a7454d2fe2d0378c334e46910ee6aaef59
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 = Radix::Base.new(Radix::BASE::B62 + ['-', '_', '~'])
30
- B10 = Radix::Base.new(10)
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}-#{Radix.convert(CLUSTER_ID, B10, B65)}-#{id}"
98
+ "#{self.design_document}_#{CLUSTER_ID}-#{id}"
99
99
  end
100
100
 
101
101
  #
@@ -1,3 +1,3 @@
1
1
  module CouchbaseId
2
- VERSION = '1.0.10'
2
+ VERSION = '1.0.11'
3
3
  end
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.10
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-18 00:00:00.000000000 Z
11
+ date: 2014-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: radix