ciql 0.3.0 → 0.3.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: 5e9c50f26c2571d06b20a0af39bf3ab2ecccf4c2
4
- data.tar.gz: a5d0b7fa17071fb32f1149de13480c24386bb854
3
+ metadata.gz: b0c24dfc6f7e95361c405a08d552c4e88b296e79
4
+ data.tar.gz: b4f6eae5dc11907751b959994858cbd663ecdca4
5
5
  SHA512:
6
- metadata.gz: 989474129f432a99c90d264a14df177078bb071eb64acc496baee234b7553a9d2628bab218b31ecf50b87ac8fcc4b5c7f0793bd7bd8e64402f446988f37d9694
7
- data.tar.gz: c911ed72fcaeb9823d7907bd14813bb15224ac89aa3cddc3d44723222e2bab5b4ff34239590fc021f3d49b17a4f4ebe9aefd0d49154c455bfeda6d70f33777c6
6
+ metadata.gz: 371cc72b3bf7886fe99c124ab5a18be855c07e5a6867d2a5c27bea4de40de6cf13a96f0a8b51b79a8e29c760b6a0d803be6e2366c56fa0725233fcfefc9079d4
7
+ data.tar.gz: 2948ca1f3c9c7e8d812aade4f5436b2e56a01559dcfd8a3a11e462458a7602cc9dd220b78705992f4589484ff6ff3d6d1c3b0abd72c6bba9b006e702fd59f422
data/lib/ciql.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'logger'
2
+
1
3
  module Ciql
2
4
  Error = Class.new(StandardError)
3
5
 
@@ -7,16 +7,17 @@ module Ciql::Client
7
7
  class Binary
8
8
  include Log
9
9
 
10
- attr_reader :connection
11
-
12
10
  def initialize(options={})
13
- options = options.dup
14
- @log_format = options.delete(:log_format)
15
-
16
- options[:hosts] = options.delete(:host) { '127.0.0.1' }.split(',')
17
- options[:logger] = Ciql.logger
11
+ @options = {
12
+ logger: Ciql.logger,
13
+ connections_per_node: 2,
14
+ }.merge(options)
15
+ @log_format = @options.delete(:log_format)
16
+ @options[:hosts] = @options.delete(:host) { '127.0.0.1' }.split(',')
17
+ end
18
18
 
19
- @connection = Cql::Client.connect(options)
19
+ def connection
20
+ @connection ||= Cql::Client.connect(@options)
20
21
  end
21
22
 
22
23
  def execute(statement, *arguments)
@@ -26,7 +27,7 @@ module Ciql::Client
26
27
 
27
28
  result = nil
28
29
  times = Benchmark.measure do
29
- result = @connection.execute(
30
+ result = connection.execute(
30
31
  bound_statement,
31
32
  consistency: consistency_level
32
33
  )
@@ -42,7 +43,7 @@ module Ciql::Client
42
43
  end
43
44
 
44
45
  def disconnect!
45
- @connection.close
46
+ connection.close
46
47
  end
47
48
  end
48
49
  end
data/lib/ciql/rails.rb CHANGED
@@ -17,5 +17,5 @@ module Ciql
17
17
  end
18
18
  end
19
19
 
20
- Client::Thrift.send(:include, LogListener)
20
+ Client::Binary.send(:include, LogListener)
21
21
  end
data/lib/ciql/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ciql
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.3.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ciql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Bradford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-05 00:00:00.000000000 Z
11
+ date: 2013-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cql-rb