packages feed

couchdb-conduit 0.7.2 → 0.7.3

raw patch · 5 files changed

+10/−6 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

couchdb-conduit.cabal view
@@ -1,5 +1,5 @@ name:           couchdb-conduit-version:        0.7.2
+version:        0.7.3
 cabal-version:  >= 1.8 build-type:     Simple stability:      Stable
src/Database/CouchDB/Conduit/Internal/Connection.hs view
@@ -71,7 +71,7 @@ -- | Make correct path and escape fragments. Filter empty fragments.
 --
 -- > mkPath ["db", "", "doc/with/slashes"]
--- > db/doc%2Fwith%2Fslashes
+-- > /db/doc%2Fwith%2Fslashes
 mkPath :: [Path]    -- ^ Path fragments be escaped.  
        -> Path
 mkPath = BLB.toByteString . HT.encodePathSegments . 
src/Database/CouchDB/Conduit/LowLevel.hs view
@@ -33,6 +33,8 @@ 
 import              Database.CouchDB.Conduit.Internal.Connection
 
+import Control.Monad.IO.Class (liftIO)
+
 -- | CouchDB response
 type CouchResponse m = H.Response (Source m B.ByteString)
 
@@ -60,6 +62,7 @@             , H.queryString     = HT.renderQuery False qs
             , H.requestBody     = reqBody
             , H.checkStatus = const . const $ Nothing }
+    liftIO $ print $ withPrefix $ couchPrefix conn
     -- Apply auth if needed
     let req' = if couchLogin conn == B.empty then req else H.applyBasicAuth 
             (couchLogin conn) (couchPass conn) req
@@ -68,7 +71,7 @@   where
     withPrefix prx 
         | B.null prx = path
-        | otherwise = prx `B.append` path 
+        | otherwise = "/" `B.append` prx `B.append` B.tail path 
 
 -- | Protect 'H.Response' from bad status codes. If status code in list 
 --   of status codes - just return response. Otherwise - throw 'CouchError'.
test/CouchDBAuth.hs view
@@ -8,6 +8,6 @@ 
 login, pass :: ByteString
 -- | Set your login
-login = ""
+login = "root"
 -- | Set your pass
-pass = ""
+pass = "sumatra"
test/Database/CouchDB/Conduit/Test/Util.hs view
@@ -19,4 +19,5 @@ conn :: CouchConnection
 conn = def {
     couchLogin = login,
-    couchPass = pass}
+    couchPass = pass,
+    couchPrefix = "cct__"}