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 +4 -4
- data/lib/superstore/adapters/cassandra_adapter.rb +17 -3
- data/lib/superstore/railtie.rb +2 -1
- data/superstore.gemspec +1 -1
- 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: 0aaa4fd0c0350717dab4ba5efa5f43d8e7e7799e
|
4
|
+
data.tar.gz: 3c758d1dbc28252434ef29a7df84490b1fa1fe7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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(
|
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(
|
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
|
data/lib/superstore/railtie.rb
CHANGED
@@ -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 =
|
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
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.
|
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
|
12
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|