gom-couchdb-adapter 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +8 -6
- data/spec/acceptance/adapter_spec.rb +0 -2
- data/spec/acceptance/map_reduce_spec.rb +0 -2
- data/spec/spec_helper.rb +42 -0
- metadata +5 -27
- data/spec/storage.configuration +0 -30
data/README.rdoc
CHANGED
@@ -18,12 +18,14 @@ If the couchdb adapter is chosen in the storage configuration, the following con
|
|
18
18
|
|
19
19
|
=== Example
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
21
|
+
GOM::Storage.configure {
|
22
|
+
name :storage_name
|
23
|
+
adapter :couchdb
|
24
|
+
host "another_host"
|
25
|
+
database "production_db"
|
26
|
+
delete_database_if_exists false
|
27
|
+
create_database_if_missing true
|
28
|
+
}
|
27
29
|
|
28
30
|
== Documents
|
29
31
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper"))
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "gom", "couchdb-adapter"))
|
3
3
|
|
4
|
-
GOM::Storage::Configuration.read File.join(File.dirname(__FILE__), "..", "storage.configuration")
|
5
|
-
|
6
4
|
describe "couchdb adapter" do
|
7
5
|
|
8
6
|
it_should_behave_like "an adapter connected to a stateful storage"
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper"))
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "lib", "gom", "couchdb-adapter"))
|
3
3
|
|
4
|
-
GOM::Storage::Configuration.read File.join(File.dirname(__FILE__), "..", "storage.configuration")
|
5
|
-
|
6
4
|
describe "couchdb adapter map reduce collection" do
|
7
5
|
|
8
6
|
before :all do
|
data/spec/spec_helper.rb
CHANGED
@@ -5,3 +5,45 @@ require 'rspec'
|
|
5
5
|
require 'gom/spec'
|
6
6
|
|
7
7
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "gom", "couchdb-adapter"))
|
8
|
+
|
9
|
+
GOM::Storage.configure {
|
10
|
+
storage {
|
11
|
+
name :test_storage
|
12
|
+
adapter :couchdb
|
13
|
+
database "test"
|
14
|
+
delete_database_if_exists true
|
15
|
+
create_database_if_missing true
|
16
|
+
view {
|
17
|
+
name :test_object_class_view
|
18
|
+
type :class
|
19
|
+
model_class GOM::Spec::Object
|
20
|
+
}
|
21
|
+
view {
|
22
|
+
name :test_map_view
|
23
|
+
type :map_reduce
|
24
|
+
map_function """
|
25
|
+
function(document) {
|
26
|
+
if (document['number'] == 11) {
|
27
|
+
emit(document['_id'], null);
|
28
|
+
}
|
29
|
+
}
|
30
|
+
"""
|
31
|
+
}
|
32
|
+
view {
|
33
|
+
name :test_map_reduce_view
|
34
|
+
type :map_reduce
|
35
|
+
map_function """
|
36
|
+
function(document) {
|
37
|
+
if (document['number']) {
|
38
|
+
emit(document['_id'], document['number']);
|
39
|
+
}
|
40
|
+
}
|
41
|
+
"""
|
42
|
+
reduce_function """
|
43
|
+
function(keys, values, rereduce) {
|
44
|
+
return sum(values);
|
45
|
+
}
|
46
|
+
"""
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gom-couchdb-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 3
|
8
|
-
- 1
|
9
|
-
version: 0.3.1
|
4
|
+
prerelease:
|
5
|
+
version: 0.4.0
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- "Philipp Br\xC3\xBCll"
|
@@ -14,7 +10,7 @@ autorequire:
|
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
12
|
|
17
|
-
date: 2011-
|
13
|
+
date: 2011-05-10 00:00:00 +02:00
|
18
14
|
default_executable:
|
19
15
|
dependencies:
|
20
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,11 +21,7 @@ dependencies:
|
|
25
21
|
requirements:
|
26
22
|
- - ">="
|
27
23
|
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
- 3
|
31
|
-
- 1
|
32
|
-
version: 0.3.1
|
24
|
+
version: 0.4.0
|
33
25
|
type: :runtime
|
34
26
|
version_requirements: *id001
|
35
27
|
- !ruby/object:Gem::Dependency
|
@@ -40,10 +32,6 @@ dependencies:
|
|
40
32
|
requirements:
|
41
33
|
- - ">="
|
42
34
|
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 0
|
45
|
-
- 1
|
46
|
-
- 2
|
47
35
|
version: 0.1.2
|
48
36
|
type: :runtime
|
49
37
|
version_requirements: *id002
|
@@ -55,8 +43,6 @@ dependencies:
|
|
55
43
|
requirements:
|
56
44
|
- - ">="
|
57
45
|
- !ruby/object:Gem::Version
|
58
|
-
segments:
|
59
|
-
- 2
|
60
46
|
version: "2"
|
61
47
|
type: :development
|
62
48
|
version_requirements: *id003
|
@@ -68,9 +54,6 @@ dependencies:
|
|
68
54
|
requirements:
|
69
55
|
- - ">="
|
70
56
|
- !ruby/object:Gem::Version
|
71
|
-
segments:
|
72
|
-
- 1
|
73
|
-
- 2
|
74
57
|
version: "1.2"
|
75
58
|
type: :development
|
76
59
|
version_requirements: *id004
|
@@ -110,7 +93,6 @@ files:
|
|
110
93
|
- spec/lib/gom/storage/couchdb/remover_spec.rb
|
111
94
|
- spec/lib/gom/storage/couchdb/saver_spec.rb
|
112
95
|
- spec/lib/gom/storage/couchdb/adapter_spec.rb
|
113
|
-
- spec/storage.configuration
|
114
96
|
- spec/spec_helper.rb
|
115
97
|
- spec/acceptance/map_reduce_spec.rb
|
116
98
|
- spec/acceptance/adapter_spec.rb
|
@@ -128,21 +110,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
128
110
|
requirements:
|
129
111
|
- - ">="
|
130
112
|
- !ruby/object:Gem::Version
|
131
|
-
segments:
|
132
|
-
- 0
|
133
113
|
version: "0"
|
134
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
115
|
none: false
|
136
116
|
requirements:
|
137
117
|
- - ">="
|
138
118
|
- !ruby/object:Gem::Version
|
139
|
-
segments:
|
140
|
-
- 0
|
141
119
|
version: "0"
|
142
120
|
requirements: []
|
143
121
|
|
144
122
|
rubyforge_project: gom-couchdb-adapter
|
145
|
-
rubygems_version: 1.
|
123
|
+
rubygems_version: 1.6.1
|
146
124
|
signing_key:
|
147
125
|
specification_version: 3
|
148
126
|
summary: CouchDB storage adapter for the General Object Mapper.
|
data/spec/storage.configuration
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
|
2
|
-
test_storage:
|
3
|
-
adapter: couchdb
|
4
|
-
database: test
|
5
|
-
delete_database_if_exists: true
|
6
|
-
create_database_if_missing: true
|
7
|
-
views:
|
8
|
-
test_object_class_view:
|
9
|
-
type: class
|
10
|
-
class: GOM::Spec::Object
|
11
|
-
test_map_view:
|
12
|
-
type: map_reduce
|
13
|
-
map:
|
14
|
-
function(document) {
|
15
|
-
if (document['number'] == 11) {
|
16
|
-
emit(document['_id'], null);
|
17
|
-
}
|
18
|
-
}
|
19
|
-
test_map_reduce_view:
|
20
|
-
type: map_reduce
|
21
|
-
map:
|
22
|
-
function(document) {
|
23
|
-
if (document['number']) {
|
24
|
-
emit(document['_id'], document['number']);
|
25
|
-
}
|
26
|
-
}
|
27
|
-
reduce:
|
28
|
-
function(keys, values, rereduce) {
|
29
|
-
return sum(values);
|
30
|
-
}
|