rom-cassandra 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/rom/cassandra/commands.rb +3 -3
- data/lib/rom/cassandra/version.rb +1 -1
- data/spec/integration/batch_spec.rb +2 -4
- data/spec/integration/create_spec.rb +1 -1
- data/spec/integration/delete_spec.rb +1 -1
- data/spec/integration/update_spec.rb +1 -1
- data/spec/unit/commands/batch_spec.rb +5 -6
- data/spec/unit/commands/create_spec.rb +5 -6
- data/spec/unit/commands/delete_spec.rb +5 -6
- data/spec/unit/commands/update_spec.rb +5 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee07ac6ff927d08e9285e0dc8eadb408cb4bf59d
|
4
|
+
data.tar.gz: faee7575a2d2a67546107b202aef9664123227f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 958319a22bf37c41d1ed6f4ec94a46223ae94d01757d1f3b2726348bdb17e9dfc6241f808df77b6b91655b72ba00ebd030fafd491afe4083717c0d80af7d0db7
|
7
|
+
data.tar.gz: 42e3eed1ec49ad63bdc34e7825e1f25e6460ffa7292a69a8c0f986d5a20f470353692d058c77e87f2275eb1692f5fddd5fb511cdb120e85598381649d879a448
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## v0.0.2 2015-09-08
|
2
|
+
|
3
|
+
### Changed
|
4
|
+
|
5
|
+
* Method `Commands#execute` takes argument instead of a block (nepalez)
|
6
|
+
|
7
|
+
[Compare v0.0.1...v0.0.2](https://github.com/rom-rb/rom-cassandra/compare/v0.0.1...v0.0.2)
|
8
|
+
|
1
9
|
## v0.0.1 2015-08-27
|
2
10
|
|
3
11
|
First public release
|
@@ -23,13 +23,13 @@ module ROM::Cassandra
|
|
23
23
|
|
24
24
|
# Implements the execute method of the `ROM::Command` abstract class
|
25
25
|
#
|
26
|
-
# @
|
26
|
+
# @param [ROM::Command] command The updated command
|
27
27
|
#
|
28
28
|
# @return [Array]
|
29
29
|
# The empty array (Cassandra doesn't select rows when writes data).
|
30
30
|
#
|
31
|
-
def execute(
|
32
|
-
|
31
|
+
def execute(command = self)
|
32
|
+
command.to_a
|
33
33
|
end
|
34
34
|
|
35
35
|
private
|
@@ -14,10 +14,8 @@ module ROM::Cassandra::Test # the namespace for newly created classes
|
|
14
14
|
register_as :batch
|
15
15
|
|
16
16
|
def execute
|
17
|
-
super
|
18
|
-
add(
|
19
|
-
.add(keyspace(:auth).table(:users).insert(id: 3, name: "frank"))
|
20
|
-
end
|
17
|
+
super add("DELETE FROM auth.users WHERE id = 1;")
|
18
|
+
.add(keyspace(:auth).table(:users).insert(id: 3, name: "frank"))
|
21
19
|
end
|
22
20
|
end
|
23
21
|
end
|
@@ -53,8 +53,8 @@ describe ROM::Cassandra::Commands::Batch do
|
|
53
53
|
let(:updated) { double :updated, to_a: result }
|
54
54
|
let(:result) { double :result }
|
55
55
|
|
56
|
-
context "without
|
57
|
-
subject { command.execute
|
56
|
+
context "without argument" do
|
57
|
+
subject { command.execute }
|
58
58
|
|
59
59
|
it "applies #to_a" do
|
60
60
|
allow(command).to receive(:to_a) { result }
|
@@ -63,12 +63,11 @@ describe ROM::Cassandra::Commands::Batch do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
context "with
|
67
|
-
subject { command.execute
|
66
|
+
context "with argument" do
|
67
|
+
subject { command.execute(updated) }
|
68
68
|
|
69
69
|
it "updates and finalizes the command" do
|
70
|
-
|
71
|
-
|
70
|
+
expect(updated).to receive(:to_a)
|
72
71
|
expect(subject).to eql(result)
|
73
72
|
end
|
74
73
|
end
|
@@ -53,8 +53,8 @@ describe ROM::Cassandra::Commands::Create do
|
|
53
53
|
let(:updated) { double :updated, to_a: result }
|
54
54
|
let(:result) { double :result }
|
55
55
|
|
56
|
-
context "without
|
57
|
-
subject { command.execute
|
56
|
+
context "without argument" do
|
57
|
+
subject { command.execute }
|
58
58
|
|
59
59
|
it "applies #to_a" do
|
60
60
|
allow(command).to receive(:to_a) { result }
|
@@ -63,12 +63,11 @@ describe ROM::Cassandra::Commands::Create do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
context "with
|
67
|
-
subject { command.execute
|
66
|
+
context "with argument" do
|
67
|
+
subject { command.execute(updated) }
|
68
68
|
|
69
69
|
it "updates and finalizes the command" do
|
70
|
-
|
71
|
-
|
70
|
+
expect(updated).to receive(:to_a)
|
72
71
|
expect(subject).to eql(result)
|
73
72
|
end
|
74
73
|
end
|
@@ -53,8 +53,8 @@ describe ROM::Cassandra::Commands::Delete do
|
|
53
53
|
let(:updated) { double :updated, to_a: result }
|
54
54
|
let(:result) { double :result }
|
55
55
|
|
56
|
-
context "without
|
57
|
-
subject { command.execute
|
56
|
+
context "without argument" do
|
57
|
+
subject { command.execute }
|
58
58
|
|
59
59
|
it "applies #to_a" do
|
60
60
|
allow(command).to receive(:to_a) { result }
|
@@ -63,12 +63,11 @@ describe ROM::Cassandra::Commands::Delete do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
context "with
|
67
|
-
subject { command.execute
|
66
|
+
context "with argument" do
|
67
|
+
subject { command.execute(updated) }
|
68
68
|
|
69
69
|
it "updates and finalizes the command" do
|
70
|
-
|
71
|
-
|
70
|
+
expect(updated).to receive(:to_a)
|
72
71
|
expect(subject).to eql(result)
|
73
72
|
end
|
74
73
|
end
|
@@ -53,8 +53,8 @@ describe ROM::Cassandra::Commands::Update do
|
|
53
53
|
let(:updated) { double :updated, to_a: result }
|
54
54
|
let(:result) { double :result }
|
55
55
|
|
56
|
-
context "without
|
57
|
-
subject { command.execute
|
56
|
+
context "without argument" do
|
57
|
+
subject { command.execute }
|
58
58
|
|
59
59
|
it "applies #to_a" do
|
60
60
|
allow(command).to receive(:to_a) { result }
|
@@ -63,12 +63,11 @@ describe ROM::Cassandra::Commands::Update do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
-
context "with
|
67
|
-
subject { command.execute
|
66
|
+
context "with argument" do
|
67
|
+
subject { command.execute(updated) }
|
68
68
|
|
69
69
|
it "updates and finalizes the command" do
|
70
|
-
|
71
|
-
|
70
|
+
expect(updated).to receive(:to_a)
|
72
71
|
expect(subject).to eql(result)
|
73
72
|
end
|
74
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rom-cassandra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08
|
11
|
+
date: 2015-09-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cassandra-driver
|
@@ -203,7 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
205
|
rubyforge_project:
|
206
|
-
rubygems_version: 2.4.
|
206
|
+
rubygems_version: 2.4.8
|
207
207
|
signing_key:
|
208
208
|
specification_version: 4
|
209
209
|
summary: Cassandra support for Ruby Object Mapper
|