cql-rb 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/cql/future.rb +1 -0
- data/lib/cql/protocol/type_converter.rb +1 -0
- data/lib/cql/uuid.rb +2 -2
- data/lib/cql/version.rb +1 -1
- data/spec/cql/future_spec.rb +11 -0
- data/spec/cql/protocol/type_converter_spec.rb +1 -1
- data/spec/cql/uuid_spec.rb +5 -1
- metadata +3 -3
data/lib/cql/future.rb
CHANGED
@@ -108,6 +108,7 @@ module Cql
|
|
108
108
|
:bigint => method(:bigint_to_bytes),
|
109
109
|
:blob => method(:blob_to_bytes),
|
110
110
|
:boolean => method(:boolean_to_bytes),
|
111
|
+
:counter => method(:bigint_to_bytes),
|
111
112
|
:decimal => method(:decimal_to_bytes),
|
112
113
|
:double => method(:double_to_bytes),
|
113
114
|
:float => method(:float_to_bytes),
|
data/lib/cql/uuid.rb
CHANGED
data/lib/cql/version.rb
CHANGED
data/spec/cql/future_spec.rb
CHANGED
@@ -78,6 +78,17 @@ module Cql
|
|
78
78
|
expect { future.value }.to raise_error('FAIL!')
|
79
79
|
end
|
80
80
|
|
81
|
+
it 'allows multiple thread to block on #value until completed' do
|
82
|
+
listeners = Array.new(10) do
|
83
|
+
Thread.start do
|
84
|
+
future.value
|
85
|
+
end
|
86
|
+
end
|
87
|
+
sleep 0.1
|
88
|
+
future.complete!(:hello)
|
89
|
+
listeners.map(&:value).should == Array.new(10, :hello)
|
90
|
+
end
|
91
|
+
|
81
92
|
it 'cannot be completed again' do
|
82
93
|
future.complete!('bar')
|
83
94
|
expect { future.complete!('foo') }.to raise_error(FutureError)
|
@@ -14,7 +14,7 @@ module Cql
|
|
14
14
|
''
|
15
15
|
end
|
16
16
|
|
17
|
-
TYPES = [:ascii, :bigint, :blob, :boolean, :decimal, :double, :float, :inet, :int, :text, :varchar, :timestamp, :timeuuid, :uuid, :varint].freeze
|
17
|
+
TYPES = [:ascii, :bigint, :blob, :boolean, :counter, :decimal, :double, :float, :inet, :int, :text, :varchar, :timestamp, :timeuuid, :uuid, :varint].freeze
|
18
18
|
|
19
19
|
describe '#to_bytes' do
|
20
20
|
context 'when encoding normal value' do
|
data/spec/cql/uuid_spec.rb
CHANGED
@@ -36,6 +36,10 @@ module Cql
|
|
36
36
|
Uuid.new(276263553384940695775376958868900023510).should eql(Uuid.new('cfd66ccc-d857-4e90-b1e5-df98a3d40cd6'))
|
37
37
|
end
|
38
38
|
|
39
|
+
it 'is not equal when anything other than a Uuid is passed' do
|
40
|
+
[nil, 123, 'test'].each { |v| Uuid.new(276263553384940695775376958868900023510).should_not eql(v) }
|
41
|
+
end
|
42
|
+
|
39
43
|
it 'aliases #== to #eql?' do
|
40
44
|
Uuid.new(276263553384940695775376958868900023510).should == Uuid.new('cfd66ccc-d857-4e90-b1e5-df98a3d40cd6')
|
41
45
|
end
|
@@ -73,4 +77,4 @@ module Cql
|
|
73
77
|
end
|
74
78
|
end
|
75
79
|
end
|
76
|
-
end
|
80
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cql-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-09-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A pure Ruby CQL3 driver for Cassandra
|
15
15
|
email:
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
segments:
|
115
115
|
- 0
|
116
|
-
hash:
|
116
|
+
hash: -3554416859720559091
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
119
|
rubygems_version: 1.8.23
|