cassanity 0.6.0.beta1 → 0.6.0.beta2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7892f054f8690a99ae75b121cc43d873c917566a
4
- data.tar.gz: 19c266c25056ef75b019463cca2d9bb49133ea72
3
+ metadata.gz: aee509bb367d05f910d105796eeb15a6a9d3e3ec
4
+ data.tar.gz: f25ef46dc1e27af16144642fdf9e50e43a2a717e
5
5
  SHA512:
6
- metadata.gz: 76cbbe3e3afdf0e741325d8e48fd11b51ac08718ab60f423a6ebf6f31c067a48382598605652ab3cedc3e30cdc401f3f0c7860981f82d49749e6fe9d50755a2c
7
- data.tar.gz: 909558dee131c53a6c648f2f3148ac44d00f2065bbd33049a46923f793dcac6b36f1b3cd45385b1be96bafa452a927ec7c7467629b4a300b1427649bd83b8431
6
+ metadata.gz: b4a973ccb47b4a3e244ab33fcd4ca2bceffeada294ad865a92c6fb850065d5466de26a3067b01dd6328ca867c034040697d1f7c15bdf3af95b576c42a7c0b04c
7
+ data.tar.gz: 63750d81f4656e692606d9b81d4504341cccfa626d7a637a15446a1768327f52b2e8d846fedd35ef1bae81b5851b395b909e5905a7b443d818d7b1505199ad2c
@@ -35,18 +35,29 @@ module Cassanity
35
35
  @instrumenter = @options.delete(:instrumenter)
36
36
  @retry_strategy = @options.delete(:retry_strategy)
37
37
 
38
+ connect
39
+ end
40
+
41
+ # Connect or reconnect to cassandra
42
+ def connect
43
+ disconnect
44
+
38
45
  @driver = Cql::Client.connect(@options)
39
46
  @executor = Cassanity::Executors::CqlRb.new({
40
47
  driver: @driver,
41
48
  instrumenter: @instrumenter,
42
49
  retry_strategy: @retry_strategy,
43
50
  })
44
-
45
51
  @connection = Cassanity::Connection.new({
46
52
  executor: @executor,
47
53
  })
48
54
  end
49
55
 
56
+ # Disconnect from cassandra.
57
+ def disconnect
58
+ @driver.close if @driver
59
+ end
60
+
50
61
  # Methods on client that should be delegated to connection.
51
62
  DelegateToConnectionMethods = [
52
63
  :keyspaces,
@@ -1,3 +1,3 @@
1
1
  module Cassanity
2
- VERSION = "0.6.0.beta1"
2
+ VERSION = "0.6.0.beta2"
3
3
  end
@@ -116,6 +116,15 @@ describe Cassanity::Client do
116
116
  end
117
117
  end
118
118
 
119
+ describe "#disconnect" do
120
+ it "allows the connection to be terminated" do
121
+ driver.should_receive(:close)
122
+
123
+ client = described_class.new
124
+ client.disconnect
125
+ end
126
+ end
127
+
119
128
  describe "#inspect" do
120
129
  it "return representation" do
121
130
  result = subject.inspect
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cassanity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.beta1
4
+ version: 0.6.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cql-rb