gom 0.4.0 → 0.4.1
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.
- data/README.rdoc +2 -0
- data/lib/gom/storage/configuration.rb +4 -4
- data/spec/lib/gom/storage/configuration_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -8,6 +8,8 @@ is plugged-in via an adapter interface. Currently, the following adapters are pr
|
|
8
8
|
* filesystem - http://github.com/phifty/gom-filesystem-adapter
|
9
9
|
* couchdb - http://github.com/phifty/gom-couchdb-adapter
|
10
10
|
|
11
|
+
http://travis-ci.org/phifty/gom.png
|
12
|
+
|
11
13
|
== Configuration
|
12
14
|
|
13
15
|
At the beginning of your program the storage configuration should be done with the <tt>GOM::Storage.configure</tt>
|
@@ -13,7 +13,7 @@ class GOM::Storage::Configuration
|
|
13
13
|
not_nil :name, :adapter
|
14
14
|
nested {
|
15
15
|
view {
|
16
|
-
not_nil :name, :
|
16
|
+
not_nil :name, :kind
|
17
17
|
}
|
18
18
|
}
|
19
19
|
}
|
@@ -83,9 +83,9 @@ class GOM::Storage::Configuration
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.view(hash)
|
86
|
-
|
87
|
-
method_name = :"#{
|
88
|
-
raise NotImplementedError, "the view
|
86
|
+
kind = hash[:kind]
|
87
|
+
method_name = :"#{kind}_view"
|
88
|
+
raise NotImplementedError, "the view kind '#{kind}' doesn't exists" unless self.respond_to?(method_name)
|
89
89
|
self.send method_name, hash
|
90
90
|
end
|
91
91
|
|
@@ -13,12 +13,12 @@ describe GOM::Storage::Configuration do
|
|
13
13
|
adapter :test
|
14
14
|
view {
|
15
15
|
name :test_object_class_view
|
16
|
-
|
16
|
+
kind :class
|
17
17
|
model_class Object
|
18
18
|
}
|
19
19
|
view {
|
20
20
|
name :test_map_view
|
21
|
-
|
21
|
+
kind :map_reduce
|
22
22
|
map_function "function(document) { }"
|
23
23
|
reduce_function "function(key, values) { }"
|
24
24
|
}
|
@@ -113,7 +113,7 @@ describe GOM::Storage::Configuration do
|
|
113
113
|
end
|
114
114
|
|
115
115
|
it "should raise a #{NotImplementedError} if the view type is invalid" do
|
116
|
-
@configuration["view"] << { :name => "test", :
|
116
|
+
@configuration["view"] << { :name => "test", :kind => "invalid" }
|
117
117
|
lambda do
|
118
118
|
@configuration.views[:test_invalid_view]
|
119
119
|
end.should raise_error(NotImplementedError)
|
data/spec/spec_helper.rb
CHANGED
@@ -12,12 +12,12 @@ GOM::Storage.configure {
|
|
12
12
|
adapter :fake_adapter
|
13
13
|
view {
|
14
14
|
name :test_object_class_view
|
15
|
-
|
15
|
+
kind :class
|
16
16
|
model_class Object
|
17
17
|
}
|
18
18
|
view {
|
19
19
|
name :test_map_view
|
20
|
-
|
20
|
+
kind :map_reduce
|
21
21
|
map_function "function(document) { }"
|
22
22
|
reduce_function "function(key, values) { }"
|
23
23
|
}
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.4.
|
5
|
+
version: 0.4.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- "Philipp Br\xC3\xBCll"
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-30 00:00:00 +02:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|