superstore 1.1.1 → 1.1.2

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: b55da8bff8e33c782eadee982fd89de1bedb6034
4
- data.tar.gz: 2fd37acbc35ca272443648625d863d3a234027f9
3
+ metadata.gz: 0aaa4fd0c0350717dab4ba5efa5f43d8e7e7799e
4
+ data.tar.gz: 3c758d1dbc28252434ef29a7df84490b1fa1fe7f
5
5
  SHA512:
6
- metadata.gz: 69bba39bfbff615067e0ea35b799359c2632bb431826ab0f772f51dad1778d37582f09065f96a68c6013c957b336f2841a91116ccb3678d8e5d854cf6b327ada
7
- data.tar.gz: 5be815d4e7650c5c6e361184c5dc72b32d578fa577e3f922c5776f3f73ee657720a98e110e73f0268f3a6a7a5981c336463aa700049726cc891fa3c08981cf97
6
+ metadata.gz: d7fd816b474c34f3f86b1e69a6bb57d85abd77d8a839124c72a5d0b50923af81680acd67eb806a0e2d2ceb822d3afd21106a16f51a7412f850dedb04f3b25e41
7
+ data.tar.gz: c566b225cf435c521df390f93507ddc919b294657803fe75a78130f5fb04e88e14b347650bb83a1f087e9bf957f2128e8bcfca5d9748e4aad4a20f7255d23040
@@ -54,7 +54,10 @@ module Superstore
54
54
  def connection
55
55
  @connection ||= begin
56
56
  thrift_options = (config[:thrift] || {})
57
- CassandraCQL::Database.new(servers, {keyspace: config[:keyspace]}, thrift_options)
57
+ CassandraCQL::Database.new(
58
+ servers,
59
+ {keyspace: config[:keyspace], username: username, password: password, cql_version: '2.0.0'},
60
+ thrift_options)
58
61
  end
59
62
  end
60
63
 
@@ -129,10 +132,13 @@ module Superstore
129
132
  end
130
133
 
131
134
  def schema_execute(cql, keyspace)
132
- schema_db = CassandraCQL::Database.new(Superstore::Base.adapter.servers, {keyspace: keyspace}, {connect_timeout: 30, timeout: 30})
135
+ schema_db = CassandraCQL::Database.new(
136
+ servers,
137
+ {keyspace: keyspace, username: username, password: password, cql_version: '2.0.0'},
138
+ {connect_timeout: 30, timeout: 30}
139
+ )
133
140
  schema_db.execute cql
134
141
  end
135
- # /SCHEMA
136
142
 
137
143
  def consistency
138
144
  @consistency ||= config[:consistency]
@@ -168,6 +174,14 @@ module Superstore
168
174
 
169
175
  private
170
176
 
177
+ def username
178
+ config[:username].presence
179
+ end
180
+
181
+ def password
182
+ config[:password].presence
183
+ end
184
+
171
185
  def sanitize(statement, *bind_vars)
172
186
  CassandraCQL::Statement.sanitize(statement, bind_vars).force_encoding(Encoding::UTF_8)
173
187
  end
@@ -8,7 +8,8 @@ module Superstore
8
8
  ActiveSupport.on_load :superstore do
9
9
  pathnames = [Rails.root.join('config', 'superstore.yml'), Rails.root.join('config', 'cassandra.yml')]
10
10
  if pathname = pathnames.detect(&:exist?)
11
- config = YAML.load(pathname.read)
11
+ config = ERB.new(pathname.read).result
12
+ config = YAML.load(config)
12
13
 
13
14
  if config = config[Rails.env]
14
15
  self.config = config.symbolize_keys!
data/superstore.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'superstore'
5
- s.version = '1.1.1'
5
+ s.version = '1.1.2'
6
6
  s.description = 'ActiveModel for many attributes'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
  s.authors = ["Michael Koziarski", "gotime"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-16 00:00:00.000000000 Z
12
+ date: 2014-10-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel