quandl_cassandra 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Quandl
2
- module Cassandra
3
- VERSION = File.read(File.expand_path(File.join(File.dirname(__FILE__), '../../../VERSION'))).strip.rstrip
4
- end
2
+ module Cassandra
3
+ VERSION = '1.4.0'
4
+ end
5
5
  end
@@ -5,9 +5,9 @@ require "quandl/cassandra/version"
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "quandl_cassandra"
7
7
  s.version = Quandl::Cassandra::VERSION
8
- s.authors = ["Blake Hilscher"]
9
- s.email = ["blake@hilscher.ca"]
10
- s.homepage = "http://blake.hilscher.ca/"
8
+ s.authors = ["Blake Hilscher", "Jason Byck"]
9
+ s.email = ["blake@hilscher.ca", "jbyck@quandl.com"]
10
+ s.homepage = "https://www.quandl.com/"
11
11
  s.license = "MIT"
12
12
  s.summary = "Quandl cassandra interface."
13
13
  s.description = "Quandl cassandra interface. CQL."
@@ -22,9 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "factory_girl_rails"
23
23
  s.add_development_dependency "fivemat", "~> 1.2"
24
24
  s.add_development_dependency "pry"
25
- s.add_development_dependency "guard"
26
- s.add_development_dependency "guard-rspec"
27
- s.add_development_dependency "quandl_utility"
25
+ s.add_development_dependency "berkshelf", ">= 3"
28
26
 
29
27
  s.add_runtime_dependency "quandl_data", "~> 1.4"
30
28
  s.add_runtime_dependency "activemodel", ">= 3.0.0"
@@ -1,14 +1,12 @@
1
1
  # set host
2
2
  Quandl::Cassandra.configure do |c|
3
- c.hosts = ['localhost','192.168.33.10']
3
+ c.hosts = ['192.168.50.4']
4
4
  c.consistency = :one
5
5
  end
6
6
 
7
- # check for keyspace
8
- keyspace_exists = Quandl::Cassandra::Base.execute("SELECT * FROM system.schema_keyspaces WHERE keyspace_name = 'quandl_cassandra_test';", 'one')
7
+ keyspace_missing = Quandl::Cassandra::Base.execute("SELECT * FROM system.schema_keyspaces WHERE keyspace_name = 'quandl_cassandra_test';", 'one').empty?
9
8
 
10
- # create keyspace if not exists
11
- Quandl::Cassandra::Base.execute("CREATE KEYSPACE quandl_cassandra_test WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};", 'one') unless keyspace_exists
9
+ Quandl::Cassandra::Base.execute("CREATE KEYSPACE quandl_cassandra_test WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};", 'one') if keyspace_missing
12
10
 
13
11
  # reconnect to keyspace
14
12
  Quandl::Cassandra.configuration.keyspace = 'quandl_cassandra_test'
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ describe Quandl::Cassandra::Base::Schema do
4
+
5
+ describe '#columns' do
6
+ it 'should be a Cql::Client::ResultMetadata' do
7
+ Post.columns.should be_kind_of(Cql::Client::ResultMetadata)
8
+ end
9
+
10
+ it 'should re-fetch columns if value not valid Cql::Client::ResultMetadata' do
11
+ Post.instance_variable_set('@columns', {})
12
+ Post.columns.should be_kind_of(Cql::Client::ResultMetadata)
13
+ end
14
+ end
15
+
16
+ describe '#column_names' do
17
+ it 'should be an non-empty Array' do
18
+ Post.column_names.should be_kind_of(Array)
19
+ Post.column_names.should_not be_empty
20
+ end
21
+
22
+ context 'Column names saved as invalid value' do
23
+ before { Post.instance_variable_set('@column_names', {}) }
24
+
25
+ it 'should re-calculate column names' do
26
+ Post.column_names.should be_kind_of(Array)
27
+ Post.column_names.should_not be_empty
28
+ end
29
+ end
30
+ end
31
+
32
+ describe '#column_types' do
33
+ it 'should be a non-empty Hash' do
34
+ Post.column_types.should be_kind_of(Hash)
35
+ Post.column_types.should_not be_empty
36
+ end
37
+
38
+ context 'Column types saved as invalid value' do
39
+ before { Post.instance_variable_set('@column_types', Object.new) }
40
+
41
+ it 'should re-calculate the column type values' do
42
+ Post.column_types.should be_kind_of(Hash)
43
+ Post.column_types.should_not be_empty
44
+ end
45
+ end
46
+ end
47
+ end
metadata CHANGED
@@ -1,18 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quandl_cassandra
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Blake Hilscher
9
+ - Jason Byck
8
10
  autorequire:
9
11
  bindir: bin
10
12
  cert_chain: []
11
- date: 2014-04-01 00:00:00.000000000 Z
13
+ date: 2014-10-06 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: rake
15
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
16
19
  requirements:
17
20
  - - ~>
18
21
  - !ruby/object:Gem::Version
@@ -20,6 +23,7 @@ dependencies:
20
23
  type: :development
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
23
27
  requirements:
24
28
  - - ~>
25
29
  - !ruby/object:Gem::Version
@@ -27,6 +31,7 @@ dependencies:
27
31
  - !ruby/object:Gem::Dependency
28
32
  name: rspec
29
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
30
35
  requirements:
31
36
  - - ~>
32
37
  - !ruby/object:Gem::Version
@@ -34,6 +39,7 @@ dependencies:
34
39
  type: :development
35
40
  prerelease: false
36
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
37
43
  requirements:
38
44
  - - ~>
39
45
  - !ruby/object:Gem::Version
@@ -41,20 +47,23 @@ dependencies:
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: factory_girl_rails
43
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
44
51
  requirements:
45
- - - '>='
52
+ - - ! '>='
46
53
  - !ruby/object:Gem::Version
47
54
  version: '0'
48
55
  type: :development
49
56
  prerelease: false
50
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
51
59
  requirements:
52
- - - '>='
60
+ - - ! '>='
53
61
  - !ruby/object:Gem::Version
54
62
  version: '0'
55
63
  - !ruby/object:Gem::Dependency
56
64
  name: fivemat
57
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
58
67
  requirements:
59
68
  - - ~>
60
69
  - !ruby/object:Gem::Version
@@ -62,6 +71,7 @@ dependencies:
62
71
  type: :development
63
72
  prerelease: false
64
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
65
75
  requirements:
66
76
  - - ~>
67
77
  - !ruby/object:Gem::Version
@@ -69,62 +79,39 @@ dependencies:
69
79
  - !ruby/object:Gem::Dependency
70
80
  name: pry
71
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
72
83
  requirements:
73
- - - '>='
84
+ - - ! '>='
74
85
  - !ruby/object:Gem::Version
75
86
  version: '0'
76
87
  type: :development
77
88
  prerelease: false
78
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
79
91
  requirements:
80
- - - '>='
92
+ - - ! '>='
81
93
  - !ruby/object:Gem::Version
82
94
  version: '0'
83
95
  - !ruby/object:Gem::Dependency
84
- name: guard
96
+ name: berkshelf
85
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
86
99
  requirements:
87
- - - '>='
100
+ - - ! '>='
88
101
  - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '>='
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: guard-rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - '>='
102
- - !ruby/object:Gem::Version
103
- version: '0'
102
+ version: '3'
104
103
  type: :development
105
104
  prerelease: false
106
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
107
  requirements:
108
- - - '>='
108
+ - - ! '>='
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: quandl_utility
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - '>='
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - '>='
123
- - !ruby/object:Gem::Version
124
- version: '0'
110
+ version: '3'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: quandl_data
127
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
128
115
  requirements:
129
116
  - - ~>
130
117
  - !ruby/object:Gem::Version
@@ -132,6 +119,7 @@ dependencies:
132
119
  type: :runtime
133
120
  prerelease: false
134
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
135
123
  requirements:
136
124
  - - ~>
137
125
  - !ruby/object:Gem::Version
@@ -139,20 +127,23 @@ dependencies:
139
127
  - !ruby/object:Gem::Dependency
140
128
  name: activemodel
141
129
  requirement: !ruby/object:Gem::Requirement
130
+ none: false
142
131
  requirements:
143
- - - '>='
132
+ - - ! '>='
144
133
  - !ruby/object:Gem::Version
145
134
  version: 3.0.0
146
135
  type: :runtime
147
136
  prerelease: false
148
137
  version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
149
139
  requirements:
150
- - - '>='
140
+ - - ! '>='
151
141
  - !ruby/object:Gem::Version
152
142
  version: 3.0.0
153
143
  - !ruby/object:Gem::Dependency
154
144
  name: colorize
155
145
  requirement: !ruby/object:Gem::Requirement
146
+ none: false
156
147
  requirements:
157
148
  - - ~>
158
149
  - !ruby/object:Gem::Version
@@ -160,6 +151,7 @@ dependencies:
160
151
  type: :runtime
161
152
  prerelease: false
162
153
  version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
163
155
  requirements:
164
156
  - - ~>
165
157
  - !ruby/object:Gem::Version
@@ -167,6 +159,7 @@ dependencies:
167
159
  - !ruby/object:Gem::Dependency
168
160
  name: facter
169
161
  requirement: !ruby/object:Gem::Requirement
162
+ none: false
170
163
  requirements:
171
164
  - - ~>
172
165
  - !ruby/object:Gem::Version
@@ -174,6 +167,7 @@ dependencies:
174
167
  type: :runtime
175
168
  prerelease: false
176
169
  version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
177
171
  requirements:
178
172
  - - ~>
179
173
  - !ruby/object:Gem::Version
@@ -181,6 +175,7 @@ dependencies:
181
175
  - !ruby/object:Gem::Dependency
182
176
  name: scope_composer
183
177
  requirement: !ruby/object:Gem::Requirement
178
+ none: false
184
179
  requirements:
185
180
  - - ~>
186
181
  - !ruby/object:Gem::Version
@@ -188,6 +183,7 @@ dependencies:
188
183
  type: :runtime
189
184
  prerelease: false
190
185
  version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
191
187
  requirements:
192
188
  - - ~>
193
189
  - !ruby/object:Gem::Version
@@ -195,6 +191,7 @@ dependencies:
195
191
  - !ruby/object:Gem::Dependency
196
192
  name: cql-rb
197
193
  requirement: !ruby/object:Gem::Requirement
194
+ none: false
198
195
  requirements:
199
196
  - - ~>
200
197
  - !ruby/object:Gem::Version
@@ -202,6 +199,7 @@ dependencies:
202
199
  type: :runtime
203
200
  prerelease: false
204
201
  version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
205
203
  requirements:
206
204
  - - ~>
207
205
  - !ruby/object:Gem::Version
@@ -209,18 +207,20 @@ dependencies:
209
207
  description: Quandl cassandra interface. CQL.
210
208
  email:
211
209
  - blake@hilscher.ca
210
+ - jbyck@quandl.com
212
211
  executables: []
213
212
  extensions: []
214
213
  extra_rdoc_files: []
215
214
  files:
216
215
  - .gitignore
216
+ - Berksfile
217
217
  - Gemfile
218
218
  - Guardfile
219
219
  - LICENSE
220
220
  - README.md
221
221
  - Rakefile
222
222
  - UPGRADE.md
223
- - VERSION
223
+ - Vagrantfile
224
224
  - examples/connect.rb
225
225
  - lib/quandl/cassandra.rb
226
226
  - lib/quandl/cassandra/base.rb
@@ -262,32 +262,40 @@ files:
262
262
  - spec/lib/quandl/cassandra/base/connection_spec.rb
263
263
  - spec/lib/quandl/cassandra/base/persistence_spec.rb
264
264
  - spec/lib/quandl/cassandra/base/sanitization_spec.rb
265
+ - spec/lib/quandl/cassandra/base/schema_spec.rb
265
266
  - spec/lib/quandl/cassandra/base/scoping_spec.rb
266
267
  - spec/lib/quandl/cassandra_spec.rb
267
268
  - spec/spec_helper.rb
268
- homepage: http://blake.hilscher.ca/
269
+ homepage: https://www.quandl.com/
269
270
  licenses:
270
271
  - MIT
271
- metadata: {}
272
272
  post_install_message:
273
273
  rdoc_options: []
274
274
  require_paths:
275
275
  - lib
276
276
  required_ruby_version: !ruby/object:Gem::Requirement
277
+ none: false
277
278
  requirements:
278
- - - '>='
279
+ - - ! '>='
279
280
  - !ruby/object:Gem::Version
280
281
  version: '0'
282
+ segments:
283
+ - 0
284
+ hash: -2020693023047569030
281
285
  required_rubygems_version: !ruby/object:Gem::Requirement
286
+ none: false
282
287
  requirements:
283
- - - '>='
288
+ - - ! '>='
284
289
  - !ruby/object:Gem::Version
285
290
  version: '0'
291
+ segments:
292
+ - 0
293
+ hash: -2020693023047569030
286
294
  requirements: []
287
295
  rubyforge_project:
288
- rubygems_version: 2.1.10
296
+ rubygems_version: 1.8.23
289
297
  signing_key:
290
- specification_version: 4
298
+ specification_version: 3
291
299
  summary: Quandl cassandra interface.
292
300
  test_files:
293
301
  - spec/config/cassandra.rb
@@ -299,6 +307,7 @@ test_files:
299
307
  - spec/lib/quandl/cassandra/base/connection_spec.rb
300
308
  - spec/lib/quandl/cassandra/base/persistence_spec.rb
301
309
  - spec/lib/quandl/cassandra/base/sanitization_spec.rb
310
+ - spec/lib/quandl/cassandra/base/schema_spec.rb
302
311
  - spec/lib/quandl/cassandra/base/scoping_spec.rb
303
312
  - spec/lib/quandl/cassandra_spec.rb
304
313
  - spec/spec_helper.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 2dd6a558f3dc6ddc1ee7262b88b83593469cd951
4
- data.tar.gz: 4c81fb39da744e0515fac16950cb5fa6411d45f5
5
- SHA512:
6
- metadata.gz: ff6e14326f938ba7d69cdde784467ea48af02d245aba51a02fa2f176818138d67def93a23efcccccfbc8f20aa3d5c750e43ad0c6c82c1b257c8029d08518f340
7
- data.tar.gz: 0fa35d79bf3401eedbb9d96ff26c3be7aa5f571e5c3d25be4b858d98d6cf6ed5e3a0f279f4cf7d60ba90292d80bf00fe2bb15a908cd574e8acf2968d6534c257
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 1.3.1