cequel 1.6.0 → 1.6.1

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: f8b4cf39dc447c80169330a707b43b5086d550b7
4
- data.tar.gz: 06d0a4ee8090a9578ab5f6092ff24b4c81c535b3
3
+ metadata.gz: 02ce6a58ba37d6d660bab77d19bbb1a5058f2272
4
+ data.tar.gz: 5c48b614b57a353caff4330013398549ed7dde7c
5
5
  SHA512:
6
- metadata.gz: 66fc988c9a4a54f45db1872bd12b073220161c5f1a1cdc6359001b6b2058528ba7184b3b158187c5f12190dd3c9534bf0c5202cef90ec411d652eaebb83736c1
7
- data.tar.gz: 99e197f7a3bee6c40bba033032d13d910e928f8fc162b3e3bd268559515d391d3a116f6d8063858acee30bd9d4c38473f9b6d1c10170a85e1cb6ce34be74e98d
6
+ metadata.gz: 4eca1a7b499d4e75ce7cdd26af7fcc62b5cda4505e7c260abe1ca8518054f2f7d5a06ce79e43d75c3106b9ddcaa898d3d6c0824a3ab67a70d639a4d574725bd2
7
+ data.tar.gz: 14727e13ee05fca86ec0cd4297a8d7ef6601722cdea5b6601a5dc34fe52c9da17a63e7c18253a255d6618e7ee2d01f9a49be5c1d37125b96eae3f4bb057bde30
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.6.1
2
+
3
+ * Ruby 1.9 no longer supported (EOL)
4
+ * Fix exception class changed in Rails 4.2
5
+ * Fix integration with ActiveModel::Serialization
6
+
1
7
  ## 1.6.0
2
8
 
3
9
  * Replace cql-rb with cassandra-driver
data/Gemfile.lock CHANGED
@@ -1,17 +1,17 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cequel (1.6.0)
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.0)
12
- activesupport (= 4.2.0)
11
+ activemodel (4.2.1)
12
+ activesupport (= 4.2.1)
13
13
  builder (~> 3.1)
14
- activesupport (4.2.0)
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.5.1)
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.4)
324
- thread_safe (0.3.4-java)
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, 1.9.3
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<Symbol,Object>] map of column names to values currently
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.each_with_object({}) do |name, attributes|
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
@@ -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 # rubocop:disable HandleExceptions
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
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Cequel
3
3
  # The current version of the library
4
- VERSION = '1.6.0'
4
+ VERSION = '1.6.1'
5
5
  end
@@ -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
- it 'should provide JSON serialization' do
22
+ let(:post){ Post.new(attributes) }
23
+
24
+ before :each do
23
25
  Post.include_root_in_json = false
24
- expect(Post.new(attributes).as_json.symbolize_keys).
25
- to eq(attributes.merge(body: nil))
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.0
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-02-17 00:00:00.000000000 Z
32
+ date: 2015-05-07 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activemodel