sessionm-cassandra_object 2.2.31 → 2.2.32
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,8 +10,14 @@ namespace :ks do
|
|
10
10
|
|
11
11
|
desc 'Create the keyspace in config/cassandra.yml for the current environment'
|
12
12
|
task :create => :configure do
|
13
|
-
CassandraObject::Tasks::Keyspace.new.
|
14
|
-
|
13
|
+
CassandraObject::Tasks::Keyspace.new.tap do |keyspace|
|
14
|
+
if keyspace.exists? @config['keyspace']
|
15
|
+
$stderr.puts "keyspace #{@config['keyspace']} already exists"
|
16
|
+
else
|
17
|
+
keyspace.create @config['keyspace'], @config
|
18
|
+
puts "Created keyspace: #{@config['keyspace']}"
|
19
|
+
end
|
20
|
+
end
|
15
21
|
end
|
16
22
|
|
17
23
|
namespace :create do
|
@@ -28,8 +34,14 @@ namespace :ks do
|
|
28
34
|
|
29
35
|
desc 'Drop keyspace in config/cassandra.yml for the current environment'
|
30
36
|
task :drop => :configure do
|
31
|
-
CassandraObject::Tasks::Keyspace.new.
|
32
|
-
|
37
|
+
CassandraObject::Tasks::Keyspace.new.tap do |keyspace|
|
38
|
+
if keyspace.exists?(@config['keyspace'])
|
39
|
+
keyspace.drop @config['keyspace']
|
40
|
+
puts "Dropped keyspace: #{@config['keyspace']}"
|
41
|
+
else
|
42
|
+
$stderr.puts "keyspace #{@config['keyspace']} does not exist"
|
43
|
+
end
|
44
|
+
end
|
33
45
|
end
|
34
46
|
|
35
47
|
namespace :drop do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 2.2.
|
8
|
+
- 32
|
9
|
+
version: 2.2.32
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Michael Koziarski
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-11-
|
19
|
+
date: 2011-11-22 00:00:00 -05:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|