cassandra-cql 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Cassandra [![Build Status](https://secure.travis-ci.org/kreynolds/cassandra-cql.png)](http://travis-ci.org/kreynolds/cassandra-cql)
1
+ # Cassandra [![Build Status](https://secure.travis-ci.org/kreynolds/cassandra-cql.png)](http://travis-ci.org/kreynolds/cassandra-cql) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/kreynolds/cassandra-cql)
2
2
  The Apache Cassandra Project (http://cassandra.apache.org) develops a highly scalable second-generation distributed database, bringing together Dynamo's fully distributed design and Bigtable's ColumnFamily-based data model.
3
3
 
4
4
  # CQL
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency "rake", ">= 0.9.2"
26
26
  s.add_development_dependency "yard", ">= 0.7.2"
27
27
  s.add_dependency "simple_uuid", ">= 0.2.0"
28
- s.add_dependency "thrift_client", ">= 0.7.1"
28
+ s.add_dependency "thrift_client", ">= 0.7.1", "< 0.9"
29
29
 
30
30
  s.files = `git ls-files`.split("\n")
31
31
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
@@ -22,12 +22,12 @@ module CassandraCQL
22
22
  @row, @schema = row, schema
23
23
  @value_cache = Hash.new { |h, key|
24
24
  # If it's a number and not one of our columns, assume it's an index
25
- if key.kind_of?(Fixnum) and !column_names.include?(key)
25
+ if key.kind_of?(Fixnum) and !column_indices.key?(key)
26
26
  column_name = column_names[key]
27
27
  column_index = key
28
28
  else
29
29
  column_name = key
30
- column_index = column_names.index(key)
30
+ column_index = column_indices[key]
31
31
  end
32
32
 
33
33
  if column_index.nil?
@@ -48,7 +48,11 @@ module CassandraCQL
48
48
  ColumnFamily.cast(column.name, @schema.names[column.name])
49
49
  end
50
50
  end
51
-
51
+
52
+ def column_indices
53
+ @column_indices ||= Hash[column_names.each_with_index.to_a]
54
+ end
55
+
52
56
  def column_values
53
57
  column_names.map do |name|
54
58
  @value_cache[name]
@@ -15,5 +15,5 @@ limitations under the License.
15
15
  =end
16
16
 
17
17
  module CassandraCQL
18
- VERSION = "1.1.4"
18
+ VERSION = "1.1.5"
19
19
  end
@@ -18,8 +18,12 @@ describe "ColumnFamily class" do
18
18
  it "should have some common attributes" do
19
19
  [@standard_column_family, @super_column_family].each do |column|
20
20
  column.name.should_not be_nil
21
- column.id.should_not be_nil
22
21
  column.column_type.should_not be_nil
22
+
23
+ # Only true for cassandra < 1.2
24
+ if CassandraCQL.CASSANDRA_VERSION < "1.2"
25
+ column.id.should_not be_nil
26
+ end
23
27
  end
24
28
  end
25
29
 
data/spec/spec_helper.rb CHANGED
@@ -4,12 +4,14 @@ if RUBY_VERSION >= "1.9"
4
4
  end
5
5
 
6
6
  require 'rubygems'
7
+ require 'bundler'
8
+ Bundler.setup(:default, :test)
9
+
7
10
  require 'yaml'
8
11
  require 'rspec'
9
12
 
10
13
  CASSANDRA_VERSION = ENV['CASSANDRA_VERSION'] || '1.1' unless defined?(CASSANDRA_VERSION)
11
14
 
12
- $LOAD_PATH << "#{File.expand_path(File.dirname(__FILE__))}/../lib"
13
15
  require "cassandra-cql/#{CASSANDRA_VERSION}"
14
16
 
15
17
  def yaml_fixture(file)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassandra-cql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.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: 2012-11-14 00:00:00.000000000 Z
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -115,6 +115,9 @@ dependencies:
115
115
  - - ! '>='
116
116
  - !ruby/object:Gem::Version
117
117
  version: 0.7.1
118
+ - - <
119
+ - !ruby/object:Gem::Version
120
+ version: '0.9'
118
121
  type: :runtime
119
122
  prerelease: false
120
123
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,6 +126,9 @@ dependencies:
123
126
  - - ! '>='
124
127
  - !ruby/object:Gem::Version
125
128
  version: 0.7.1
129
+ - - <
130
+ - !ruby/object:Gem::Version
131
+ version: '0.9'
126
132
  description: CQL Interface to Cassandra
127
133
  email:
128
134
  - kelley.reynolds@rubyscale.com
@@ -209,6 +215,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
215
  - - ! '>='
210
216
  - !ruby/object:Gem::Version
211
217
  version: '0'
218
+ segments:
219
+ - 0
220
+ hash: -2401837343533382328
212
221
  required_rubygems_version: !ruby/object:Gem::Requirement
213
222
  none: false
214
223
  requirements: