cequel 1.6.0 → 1.6.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +7 -7
- data/README.md +8 -1
- data/lib/cequel/record/properties.rb +3 -2
- data/lib/cequel/record/tasks.rb +3 -1
- data/lib/cequel/version.rb +1 -1
- data/spec/examples/record/properties_spec.rb +6 -0
- data/spec/examples/record/serialization_spec.rb +13 -3
- 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: 02ce6a58ba37d6d660bab77d19bbb1a5058f2272
|
4
|
+
data.tar.gz: 5c48b614b57a353caff4330013398549ed7dde7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4eca1a7b499d4e75ce7cdd26af7fcc62b5cda4505e7c260abe1ca8518054f2f7d5a06ce79e43d75c3106b9ddcaa898d3d6c0824a3ab67a70d639a4d574725bd2
|
7
|
+
data.tar.gz: 14727e13ee05fca86ec0cd4297a8d7ef6601722cdea5b6601a5dc34fe52c9da17a63e7c18253a255d6618e7ee2d01f9a49be5c1d37125b96eae3f4bb057bde30
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cequel (1.6.
|
4
|
+
cequel (1.6.1)
|
5
5
|
activemodel (>= 3.1, < 5.0)
|
6
6
|
cassandra-driver (~> 1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (4.2.
|
12
|
-
activesupport (= 4.2.
|
11
|
+
activemodel (4.2.1)
|
12
|
+
activesupport (= 4.2.1)
|
13
13
|
builder (~> 3.1)
|
14
|
-
activesupport (4.2.
|
14
|
+
activesupport (4.2.1)
|
15
15
|
i18n (~> 0.7)
|
16
16
|
json (~> 1.7, >= 1.7.7)
|
17
17
|
minitest (~> 5.1)
|
@@ -70,7 +70,7 @@ GEM
|
|
70
70
|
addressable (~> 2.3)
|
71
71
|
spoon (~> 0.0.1)
|
72
72
|
method_source (0.8.2)
|
73
|
-
minitest (5.
|
73
|
+
minitest (5.6.0)
|
74
74
|
multi_json (1.10.1)
|
75
75
|
multipart-post (2.0.0)
|
76
76
|
net-http-persistent (2.9.4)
|
@@ -320,8 +320,8 @@ GEM
|
|
320
320
|
spoon (0.0.4)
|
321
321
|
ffi
|
322
322
|
thor (0.19.1)
|
323
|
-
thread_safe (0.3.
|
324
|
-
thread_safe (0.3.
|
323
|
+
thread_safe (0.3.5)
|
324
|
+
thread_safe (0.3.5-java)
|
325
325
|
timecop (0.7.1)
|
326
326
|
travis (1.7.5)
|
327
327
|
addressable (~> 2.3)
|
data/README.md
CHANGED
@@ -520,7 +520,7 @@ the columns that are given.
|
|
520
520
|
|
521
521
|
### Ruby ###
|
522
522
|
|
523
|
-
* Ruby 2.2, 2.1, 2.0
|
523
|
+
* Ruby 2.2, 2.1, 2.0
|
524
524
|
* JRuby 1.7
|
525
525
|
* Rubinius 2.5
|
526
526
|
|
@@ -578,6 +578,13 @@ Cequel was written by:
|
|
578
578
|
Special thanks to [Brewster](https://www.brewster.com), which supported the 0.x
|
579
579
|
releases of Cequel.
|
580
580
|
|
581
|
+
## Shameless Self-Promotion ##
|
582
|
+
|
583
|
+
If you're new to Cassandra, check out [Learning Apache
|
584
|
+
Cassandra](http://www.amazon.com/gp/product/1783989203/ref=s9_simh_co_p14_d4_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=left-1&pf_rd_r=1TX356WHGF06W32ZHD8S&pf_rd_t=3201&pf_rd_p=1953562742&pf_rd_i=typ01),
|
585
|
+
a hands-on guide to Cassandra application development by example, written by
|
586
|
+
the maintainer of Cequel.
|
587
|
+
|
581
588
|
## License ##
|
582
589
|
|
583
590
|
Cequel is distributed under the MIT license. See the attached LICENSE for all
|
@@ -256,11 +256,12 @@ module Cequel
|
|
256
256
|
end
|
257
257
|
|
258
258
|
#
|
259
|
-
# @return [Hash<
|
259
|
+
# @return [Hash<String,Object>] map of column names to values currently
|
260
260
|
# set on this record
|
261
261
|
#
|
262
262
|
def attributes
|
263
|
-
attribute_names
|
263
|
+
attribute_names
|
264
|
+
.each_with_object(HashWithIndifferentAccess.new) do |name, attributes|
|
264
265
|
attributes[name] = read_attribute(name)
|
265
266
|
end
|
266
267
|
end
|
data/lib/cequel/record/tasks.rb
CHANGED
@@ -40,9 +40,10 @@ namespace :cequel do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
new_constants.each do |class_name|
|
43
|
+
# rubocop:disable HandleExceptions
|
43
44
|
begin
|
44
45
|
clazz = class_name.constantize
|
45
|
-
rescue NameError, RuntimeError
|
46
|
+
rescue LoadError, NameError, RuntimeError
|
46
47
|
else
|
47
48
|
if clazz.is_a?(Class)
|
48
49
|
if clazz.ancestors.include?(Cequel::Record) &&
|
@@ -53,6 +54,7 @@ namespace :cequel do
|
|
53
54
|
end
|
54
55
|
end
|
55
56
|
end
|
57
|
+
# rubocop:enable HandleExceptions
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
data/lib/cequel/version.rb
CHANGED
@@ -53,6 +53,12 @@ describe Cequel::Record::Properties do
|
|
53
53
|
title).to eq('Big Data')
|
54
54
|
end
|
55
55
|
|
56
|
+
it 'should get attributes with indifferent access' do
|
57
|
+
post = Post.new.tap { |post| post.attributes = {:downcased_title => 'big data' }}
|
58
|
+
expect(post.attributes[:title]).to eq 'Big Data'
|
59
|
+
expect(post.attributes["title"]).to eq 'Big Data'
|
60
|
+
end
|
61
|
+
|
56
62
|
it 'should take attribute arguments to ::new' do
|
57
63
|
expect(Post.new(:downcased_title => 'big data').title).to eq('Big Data')
|
58
64
|
end
|
@@ -19,9 +19,19 @@ describe 'serialization' do
|
|
19
19
|
}
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
let(:post){ Post.new(attributes) }
|
23
|
+
|
24
|
+
before :each do
|
23
25
|
Post.include_root_in_json = false
|
24
|
-
|
25
|
-
|
26
|
+
end
|
27
|
+
|
28
|
+
it 'should provide JSON serialization' do
|
29
|
+
json = post.as_json.symbolize_keys
|
30
|
+
expect(json).to eq(attributes.merge(body: nil))
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'should be able to serialize restricting to some attributes' do
|
34
|
+
json = post.as_json(only: [:id]).symbolize_keys
|
35
|
+
expect(json).to eq(id: attributes[:id])
|
26
36
|
end
|
27
37
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cequel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Brown
|
@@ -29,7 +29,7 @@ authors:
|
|
29
29
|
autorequire:
|
30
30
|
bindir: bin
|
31
31
|
cert_chain: []
|
32
|
-
date: 2015-
|
32
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: activemodel
|