cequel 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cequel.rb +1 -0
- data/lib/cequel/errors.rb +1 -0
- data/lib/cequel/metal.rb +1 -0
- data/lib/cequel/metal/batch.rb +1 -0
- data/lib/cequel/metal/batch_manager.rb +1 -0
- data/lib/cequel/metal/cql_row_specification.rb +1 -0
- data/lib/cequel/metal/data_set.rb +1 -0
- data/lib/cequel/metal/deleter.rb +1 -0
- data/lib/cequel/metal/incrementer.rb +1 -0
- data/lib/cequel/metal/inserter.rb +1 -0
- data/lib/cequel/metal/keyspace.rb +1 -0
- data/lib/cequel/metal/logger.rb +1 -0
- data/lib/cequel/metal/logging.rb +1 -0
- data/lib/cequel/metal/new_relic_instrumentation.rb +1 -0
- data/lib/cequel/metal/row.rb +1 -0
- data/lib/cequel/metal/row_specification.rb +1 -0
- data/lib/cequel/metal/statement.rb +1 -0
- data/lib/cequel/metal/updater.rb +1 -0
- data/lib/cequel/metal/writer.rb +1 -0
- data/lib/cequel/record.rb +1 -0
- data/lib/cequel/record/association_collection.rb +1 -0
- data/lib/cequel/record/associations.rb +1 -0
- data/lib/cequel/record/belongs_to_association.rb +1 -0
- data/lib/cequel/record/bound.rb +1 -0
- data/lib/cequel/record/bulk_writes.rb +1 -0
- data/lib/cequel/record/callbacks.rb +1 -0
- data/lib/cequel/record/collection.rb +1 -0
- data/lib/cequel/record/configuration_generator.rb +1 -0
- data/lib/cequel/record/conversion.rb +1 -0
- data/lib/cequel/record/data_set_builder.rb +1 -0
- data/lib/cequel/record/dirty.rb +1 -0
- data/lib/cequel/record/errors.rb +1 -0
- data/lib/cequel/record/has_many_association.rb +1 -0
- data/lib/cequel/record/lazy_record_collection.rb +1 -0
- data/lib/cequel/record/mass_assignment.rb +1 -0
- data/lib/cequel/record/persistence.rb +1 -0
- data/lib/cequel/record/properties.rb +1 -0
- data/lib/cequel/record/railtie.rb +1 -0
- data/lib/cequel/record/record_generator.rb +1 -0
- data/lib/cequel/record/record_set.rb +1 -0
- data/lib/cequel/record/schema.rb +1 -0
- data/lib/cequel/record/scoped.rb +1 -0
- data/lib/cequel/record/secondary_indexes.rb +1 -0
- data/lib/cequel/record/tasks.rb +1 -0
- data/lib/cequel/record/validations.rb +1 -0
- data/lib/cequel/schema.rb +1 -0
- data/lib/cequel/schema/column.rb +1 -0
- data/lib/cequel/schema/create_table_dsl.rb +1 -0
- data/lib/cequel/schema/keyspace.rb +1 -0
- data/lib/cequel/schema/migration_validator.rb +1 -0
- data/lib/cequel/schema/table.rb +1 -0
- data/lib/cequel/schema/table_property.rb +1 -0
- data/lib/cequel/schema/table_reader.rb +1 -0
- data/lib/cequel/schema/table_synchronizer.rb +1 -0
- data/lib/cequel/schema/table_updater.rb +1 -0
- data/lib/cequel/schema/table_writer.rb +1 -0
- data/lib/cequel/schema/update_table_dsl.rb +1 -0
- data/lib/cequel/type.rb +3 -2
- data/lib/cequel/util.rb +1 -0
- data/lib/cequel/version.rb +2 -1
- data/spec/environment.rb +3 -2
- data/spec/examples/metal/data_set_spec.rb +1 -0
- data/spec/examples/record/associations_spec.rb +1 -0
- data/spec/examples/record/callbacks_spec.rb +1 -0
- data/spec/examples/record/dirty_spec.rb +1 -0
- data/spec/examples/record/list_spec.rb +28 -27
- data/spec/examples/record/map_spec.rb +29 -28
- data/spec/examples/record/mass_assignment_spec.rb +1 -0
- data/spec/examples/record/naming_spec.rb +1 -0
- data/spec/examples/record/persistence_spec.rb +1 -0
- data/spec/examples/record/properties_spec.rb +24 -23
- data/spec/examples/record/record_set_spec.rb +1 -0
- data/spec/examples/record/schema_spec.rb +1 -0
- data/spec/examples/record/scoped_spec.rb +1 -0
- data/spec/examples/record/secondary_index_spec.rb +1 -0
- data/spec/examples/record/serialization_spec.rb +1 -0
- data/spec/examples/record/set_spec.rb +12 -11
- data/spec/examples/record/spec_helper.rb +1 -0
- data/spec/examples/record/validations_spec.rb +1 -0
- data/spec/examples/schema/table_reader_spec.rb +1 -0
- data/spec/examples/schema/table_synchronizer_spec.rb +1 -0
- data/spec/examples/schema/table_updater_spec.rb +1 -0
- data/spec/examples/schema/table_writer_spec.rb +1 -0
- data/spec/examples/spec_helper.rb +1 -0
- data/spec/examples/type_spec.rb +1 -0
- data/spec/shared/readable_dictionary.rb +1 -0
- data/spec/support/helpers.rb +1 -0
- data/spec/support/result_stub.rb +1 -0
- data/templates/record.rb +1 -0
- metadata +42 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8fa70fd005e6853b4352c88da285f64f877442d
|
4
|
+
data.tar.gz: 619ef21e2ce06aeae7353d083e51c5b2a60f98cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8992a767740b4fd03a2b6ea32d3431a7595cd43115d5173003de4608095ff5ceba7ef3db6d74ddc5294c68f8fb5052b19e9496da5f299b8d861d971d6287b856
|
7
|
+
data.tar.gz: abc8506ec213817ff386646dd96a6e7fd487028e65c397a7c3b5784eb57950b7e374c59dd234d0dab02654f925371bca30ab2cdb531503a370b856aed7e3c022
|
data/lib/cequel.rb
CHANGED
data/lib/cequel/errors.rb
CHANGED
data/lib/cequel/metal.rb
CHANGED
data/lib/cequel/metal/batch.rb
CHANGED
data/lib/cequel/metal/deleter.rb
CHANGED
data/lib/cequel/metal/logger.rb
CHANGED
data/lib/cequel/metal/logging.rb
CHANGED
data/lib/cequel/metal/row.rb
CHANGED
data/lib/cequel/metal/updater.rb
CHANGED
data/lib/cequel/metal/writer.rb
CHANGED
data/lib/cequel/record.rb
CHANGED
data/lib/cequel/record/bound.rb
CHANGED
data/lib/cequel/record/dirty.rb
CHANGED
data/lib/cequel/record/errors.rb
CHANGED
data/lib/cequel/record/schema.rb
CHANGED
data/lib/cequel/record/scoped.rb
CHANGED
data/lib/cequel/record/tasks.rb
CHANGED
data/lib/cequel/schema.rb
CHANGED
data/lib/cequel/schema/column.rb
CHANGED
data/lib/cequel/schema/table.rb
CHANGED
data/lib/cequel/type.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
require 'singleton'
|
2
3
|
|
3
4
|
module Cequel
|
@@ -413,8 +414,8 @@ module Cequel
|
|
413
414
|
# CQL3 data type documentation
|
414
415
|
#
|
415
416
|
class Varint < Int
|
416
|
-
def
|
417
|
-
'org.apache.cassandra.db.marshal.IntegerType'
|
417
|
+
def internal_names
|
418
|
+
['org.apache.cassandra.db.marshal.IntegerType']
|
418
419
|
end
|
419
420
|
end
|
420
421
|
register Varint.instance
|
data/lib/cequel/util.rb
CHANGED
data/lib/cequel/version.rb
CHANGED
data/spec/environment.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
require File.expand_path('../spec_helper', __FILE__)
|
2
3
|
|
3
4
|
describe Cequel::Record::List do
|
@@ -66,12 +67,12 @@ describe Cequel::Record::List do
|
|
66
67
|
|
67
68
|
it 'should add new items in memory when loaded' do
|
68
69
|
unloaded_post.tags << 'four' << 'five'
|
69
|
-
unloaded_post.tags.
|
70
|
+
expect(unloaded_post.tags).to eq(%w(one two four five))
|
70
71
|
end
|
71
72
|
|
72
73
|
it 'should cast to defined value' do
|
73
74
|
post.contributor_ids << '3' << 4.0
|
74
|
-
post.contributor_ids.
|
75
|
+
expect(post.contributor_ids).to eq([1, 2, 3, 4])
|
75
76
|
end
|
76
77
|
end
|
77
78
|
|
@@ -82,12 +83,12 @@ describe Cequel::Record::List do
|
|
82
83
|
post.tags[1] = 'TWO'
|
83
84
|
post.save
|
84
85
|
subject[:tags].should == %w(one TWO three)
|
85
|
-
post.tags.
|
86
|
+
expect(post.tags).to eq(%w(one TWO))
|
86
87
|
end
|
87
88
|
|
88
89
|
it 'should cast element before replacing' do
|
89
90
|
post.contributor_ids[1] = '5'
|
90
|
-
post.contributor_ids.
|
91
|
+
expect(post.contributor_ids).to eq([1, 5])
|
91
92
|
end
|
92
93
|
|
93
94
|
it 'should replace an element without reading' do
|
@@ -103,19 +104,19 @@ describe Cequel::Record::List do
|
|
103
104
|
|
104
105
|
it 'should apply local modifications when loaded later' do
|
105
106
|
unloaded_post.tags[1] = 'TWO'
|
106
|
-
unloaded_post.tags.
|
107
|
+
expect(unloaded_post.tags).to eq(%w(one TWO three))
|
107
108
|
end
|
108
109
|
|
109
110
|
it 'should atomically replace a given number of arguments' do
|
110
111
|
post.tags[0, 2] = 'One', 'Two'
|
111
112
|
post.save
|
112
113
|
subject[:tags].should == %w(One Two three)
|
113
|
-
post.tags.
|
114
|
+
expect(post.tags).to eq(%w(One Two))
|
114
115
|
end
|
115
116
|
|
116
117
|
it 'should cast multiple elements before replacing them' do
|
117
118
|
post.contributor_ids[0, 2] = %w(4 5)
|
118
|
-
post.contributor_ids.
|
119
|
+
expect(post.contributor_ids).to eq([4, 5])
|
119
120
|
end
|
120
121
|
|
121
122
|
it 'should remove elements beyond positional arguments' do
|
@@ -123,14 +124,14 @@ describe Cequel::Record::List do
|
|
123
124
|
post.tags[0, 3] = 'ONE'
|
124
125
|
post.save
|
125
126
|
subject[:tags].should == %w(ONE four)
|
126
|
-
post.tags.
|
127
|
+
expect(post.tags).to eq(%w(ONE))
|
127
128
|
end
|
128
129
|
|
129
130
|
it 'should atomically replace a given range of elements' do
|
130
131
|
post.tags[0..1] = ['One', 'Two']
|
131
132
|
post.save
|
132
133
|
subject[:tags].should == %w(One Two three)
|
133
|
-
post.tags.
|
134
|
+
expect(post.tags).to eq(%w(One Two))
|
134
135
|
end
|
135
136
|
|
136
137
|
it 'should remove elements beyond positional arguments' do
|
@@ -138,7 +139,7 @@ describe Cequel::Record::List do
|
|
138
139
|
post.tags[0..2] = 'ONE'
|
139
140
|
post.save
|
140
141
|
subject[:tags].should == %w(ONE four)
|
141
|
-
post.tags.
|
142
|
+
expect(post.tags).to eq(%w(ONE))
|
142
143
|
end
|
143
144
|
end
|
144
145
|
|
@@ -147,7 +148,7 @@ describe Cequel::Record::List do
|
|
147
148
|
post.tags.clear
|
148
149
|
post.save
|
149
150
|
subject[:tags].should be_blank
|
150
|
-
post.tags.
|
151
|
+
expect(post.tags).to eq([])
|
151
152
|
end
|
152
153
|
|
153
154
|
it 'should clear elements without loading' do
|
@@ -163,7 +164,7 @@ describe Cequel::Record::List do
|
|
163
164
|
|
164
165
|
it 'should apply local modifications post-hoc' do
|
165
166
|
unloaded_post.tags.clear
|
166
|
-
unloaded_post.tags.
|
167
|
+
expect(unloaded_post.tags).to eq([])
|
167
168
|
end
|
168
169
|
end
|
169
170
|
|
@@ -179,12 +180,12 @@ describe Cequel::Record::List do
|
|
179
180
|
post.tags.concat(['four', 'five'])
|
180
181
|
post.save
|
181
182
|
subject[:tags].should == %w(one two three four five)
|
182
|
-
post.tags.
|
183
|
+
expect(post.tags).to eq(%w(one two four five))
|
183
184
|
end
|
184
185
|
|
185
186
|
it 'should cast elements before concatentating' do
|
186
187
|
post.contributor_ids.concat(%w(3 4))
|
187
|
-
post.contributor_ids.
|
188
|
+
expect(post.contributor_ids).to eq([1, 2, 3, 4])
|
188
189
|
end
|
189
190
|
|
190
191
|
it 'should concat elements without loading' do
|
@@ -200,7 +201,7 @@ describe Cequel::Record::List do
|
|
200
201
|
|
201
202
|
it 'should apply local modifications when loaded later' do
|
202
203
|
unloaded_post.tags.concat(['four', 'five'])
|
203
|
-
unloaded_post.tags.
|
204
|
+
expect(unloaded_post.tags).to eq(%w(one two four five))
|
204
205
|
end
|
205
206
|
end
|
206
207
|
|
@@ -211,12 +212,12 @@ describe Cequel::Record::List do
|
|
211
212
|
post.tags.delete('two')
|
212
213
|
post.save
|
213
214
|
subject[:tags].should == %w(one three)
|
214
|
-
post.tags.
|
215
|
+
expect(post.tags).to eq(%w(one))
|
215
216
|
end
|
216
217
|
|
217
218
|
it 'should cast argument' do
|
218
219
|
post.contributor_ids.delete('2')
|
219
|
-
post.contributor_ids.
|
220
|
+
expect(post.contributor_ids).to eq([1])
|
220
221
|
end
|
221
222
|
|
222
223
|
it 'should delete without loading' do
|
@@ -232,7 +233,7 @@ describe Cequel::Record::List do
|
|
232
233
|
|
233
234
|
it 'should modify local copy after the fact' do
|
234
235
|
unloaded_post.tags.delete('two')
|
235
|
-
unloaded_post.tags.
|
236
|
+
expect(unloaded_post.tags).to eq(%w(one))
|
236
237
|
end
|
237
238
|
end
|
238
239
|
|
@@ -242,7 +243,7 @@ describe Cequel::Record::List do
|
|
242
243
|
post.tags.delete_at(1)
|
243
244
|
post.save
|
244
245
|
subject[:tags].should == %w(one three four)
|
245
|
-
post.tags.
|
246
|
+
expect(post.tags).to eq(%w(one))
|
246
247
|
end
|
247
248
|
|
248
249
|
it 'should delete from a given index without reading' do
|
@@ -258,7 +259,7 @@ describe Cequel::Record::List do
|
|
258
259
|
|
259
260
|
it 'should apply deletion after the fact' do
|
260
261
|
unloaded_post.tags.delete_at(1)
|
261
|
-
unloaded_post.tags.
|
262
|
+
expect(unloaded_post.tags).to eq(%w(one))
|
262
263
|
end
|
263
264
|
end
|
264
265
|
|
@@ -313,7 +314,7 @@ describe Cequel::Record::List do
|
|
313
314
|
post.tags.push('four').push('five')
|
314
315
|
post.save
|
315
316
|
subject[:tags].should == %w(one two three four five)
|
316
|
-
post.tags.
|
317
|
+
expect(post.tags).to eq(%w(one two four five))
|
317
318
|
end
|
318
319
|
end
|
319
320
|
|
@@ -330,12 +331,12 @@ describe Cequel::Record::List do
|
|
330
331
|
post.tags.replace(%w(four five))
|
331
332
|
post.save
|
332
333
|
subject[:tags].should == %w(four five)
|
333
|
-
post.tags.
|
334
|
+
expect(post.tags).to eq(%w(four five))
|
334
335
|
end
|
335
336
|
|
336
337
|
it 'should cast before overwriting' do
|
337
338
|
post.contributor_ids.replace(%w(3 4 5))
|
338
|
-
post.contributor_ids.
|
339
|
+
expect(post.contributor_ids).to eq([3, 4, 5])
|
339
340
|
end
|
340
341
|
|
341
342
|
it 'should overwrite without reading' do
|
@@ -351,7 +352,7 @@ describe Cequel::Record::List do
|
|
351
352
|
|
352
353
|
it 'should apply replace post-hoc' do
|
353
354
|
unloaded_post.tags.replace(%w(four five))
|
354
|
-
unloaded_post.tags.
|
355
|
+
expect(unloaded_post.tags).to eq(%w(four five))
|
355
356
|
end
|
356
357
|
end
|
357
358
|
|
@@ -417,12 +418,12 @@ describe Cequel::Record::List do
|
|
417
418
|
post.tags.unshift('minustwo', 'minusone')
|
418
419
|
post.save
|
419
420
|
subject[:tags].should == %w(minustwo minusone zero one two)
|
420
|
-
post.tags.
|
421
|
+
expect(post.tags).to eq(%w(minustwo minusone one two))
|
421
422
|
end
|
422
423
|
|
423
424
|
it 'should cast element before unshifting' do
|
424
425
|
post.contributor_ids.unshift('0')
|
425
|
-
post.contributor_ids.
|
426
|
+
expect(post.contributor_ids).to eq([0, 1, 2])
|
426
427
|
end
|
427
428
|
|
428
429
|
it 'should unshift without reading' do
|
@@ -438,7 +439,7 @@ describe Cequel::Record::List do
|
|
438
439
|
|
439
440
|
it 'should apply unshift after the fact' do
|
440
441
|
unloaded_post.tags.unshift('minustwo', 'minusone')
|
441
|
-
unloaded_post.tags.
|
442
|
+
expect(unloaded_post.tags).to eq(%w(minustwo minusone one two))
|
442
443
|
end
|
443
444
|
end
|
444
445
|
end
|