mattetti-couchrest 0.20 → 0.21
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/lib/couchrest/core/database.rb +5 -2
- data/lib/couchrest.rb +1 -1
- metadata +1 -1
@@ -61,12 +61,15 @@ module CouchRest
|
|
61
61
|
# paramaters as described in http://wiki.apache.org/couchdb/HttpViewApi
|
62
62
|
def view(name, params = {}, &block)
|
63
63
|
keys = params.delete(:keys)
|
64
|
-
|
64
|
+
name = name.split('/') # I think this will always be length == 2, but maybe not...
|
65
|
+
dname = name.shift
|
66
|
+
vname = name.join('/')
|
67
|
+
url = CouchRest.paramify_url "#{@uri}/_design/#{dname}/_view/#{vname}", params
|
65
68
|
if keys
|
66
69
|
CouchRest.post(url, {:keys => keys})
|
67
70
|
else
|
68
71
|
if block_given?
|
69
|
-
@streamer.view(
|
72
|
+
@streamer.view("_design/#{dname}/_view/#{vname}", params, &block)
|
70
73
|
else
|
71
74
|
CouchRest.get url
|
72
75
|
end
|
data/lib/couchrest.rb
CHANGED
@@ -28,7 +28,7 @@ require 'couchrest/monkeypatches'
|
|
28
28
|
|
29
29
|
# = CouchDB, close to the metal
|
30
30
|
module CouchRest
|
31
|
-
VERSION = '0.
|
31
|
+
VERSION = '0.21' unless self.const_defined?("VERSION")
|
32
32
|
|
33
33
|
autoload :Server, 'couchrest/core/server'
|
34
34
|
autoload :Database, 'couchrest/core/database'
|