couchdb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +5 -0
- data/lib/couchdb/design.rb +5 -1
- data/spec/lib/couchdb/design_spec.rb +9 -0
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -45,3 +45,8 @@ server and the delivered document hashes will be returned as an array of documen
|
|
45
45
|
== Development
|
46
46
|
|
47
47
|
This project is still under development. Any bug report and contribution is welcome!
|
48
|
+
|
49
|
+
== Support
|
50
|
+
|
51
|
+
Apart from contribution, support via
|
52
|
+
Flattr[http://flattr.com/thing/108993/A-straight-forward-client-for-CouchDB-REST-API] is welcome.
|
data/lib/couchdb/design.rb
CHANGED
@@ -20,7 +20,7 @@ module CouchDB
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def id=(value)
|
23
|
-
super "_design/#{value}"
|
23
|
+
super (value =~ /^_design\//) ? value : "_design/#{value}"
|
24
24
|
end
|
25
25
|
|
26
26
|
def language
|
@@ -31,6 +31,10 @@ module CouchDB
|
|
31
31
|
self["language"] = value
|
32
32
|
end
|
33
33
|
|
34
|
+
def url
|
35
|
+
"#{self.database.url}/_design/#{self.id}"
|
36
|
+
end
|
37
|
+
|
34
38
|
private
|
35
39
|
|
36
40
|
# A proxy class for the views property.
|
@@ -60,6 +60,15 @@ describe CouchDB::Design do
|
|
60
60
|
|
61
61
|
end
|
62
62
|
|
63
|
+
describe "url" do
|
64
|
+
|
65
|
+
it "should return the database url combined with the _design prefix and the id" do
|
66
|
+
url = @design.url
|
67
|
+
url.should == "http://host:1234/test/_design/test_design"
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
63
72
|
describe "views" do
|
64
73
|
|
65
74
|
before :each do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Philipp Br\xC3\xBCll"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-02-21 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|