couchview: command not found

21 views
Skip to first unread message

adam

unread,
Feb 2, 2009, 10:48:36 PM2/2/09
to CouchRest
I've noticed it was used in the peepcode screencast and a jchris blog
entry from 6 months ago. But I cant seem to locate the utility on my
system.

http://jchris.mfdz.com/posts/115

I'm running v0.12.6 of the jchris-couchrest gem. Is there another step
for installing the utility which i missed?

cheers,
Adam

Jai-Gouk Kim

unread,
Feb 2, 2009, 10:52:22 PM2/2/09
to CouchRest
Hi. I was in the same situation 2 days before. So I asked jchris via
twitter.
couchview has been replaced by couchapp. :)
But the example app made by topfunky still works.

Thanks,
-- Jai-Gouk Kim
Message has been deleted

adam

unread,
Feb 3, 2009, 1:09:45 AM2/3/09
to CouchRest
thanks for very the reply and heads up on couchapp.

I've installed this as a gem and have tested out the generate and push
commands.

This new couchapp gem is for making standalone couchdb apps with
jquery and HTML. Where as the old couchview was handy utility for
generating and pushing views.


An example generate below. Generates views along with a lot of extras.

couchapp generate db/views posts
Generating a new CouchApp in /application/db/views
/application/db/views/app-template
/application/db/views/app-template/_attachments
/application/db/views/app-template/_attachments/index.html
/application/db/views/app-template/_attachments/style
/application/db/views/app-template/_attachments/style/main.css
/application/db/views/app-template/foo
/application/db/views/app-template/foo/bar.txt
/application/db/views/app-template/lib
/application/db/views/app-template/lib/helpers
/application/db/views/app-template/lib/helpers/math.js
/application/db/views/app-template/lib/helpers/template.js
/application/db/views/app-template/lib/templates
/application/db/views/app-template/lib/templates/example.html
/application/db/views/app-template/lists
/application/db/views/app-template/lists/feed.js
/application/db/views/app-template/shows
/application/db/views/app-template/shows/example-show.js
/application/db/views/app-template/views
/application/db/views/app-template/views/example
/application/db/views/app-template/views/example/map.js
/application/db/views/app-template/views/example/reduce.js
/application/db/views/by_tag-map.js
/application/db/views/by_tag-reduce.js
/application/db/views/by_title-map.js
/application/db/views/by_updated_at-map.js
/application/db/views/by_visited_on-map.js
/application/db/views/lib.js


The push seems to behave different also:

With the topfunky couchdb app:

couchapp push db/views notes_topfunky_development
> This returns nothing but does push the views to the DB as _design/views. To get the correct view names i went deeper into the directory.

couchapp push db/views/notes notes_topfunky_development
> This resulted in a document with view names (by_tag-reduce etc)
being listed as attributes with the associated js content as the
value.


Would it be better to use the view structure from the peepcode instead
of this new couchapp generate and use the couchdb api to push?


thanks,
Adam

Chris Anderson

unread,
Feb 3, 2009, 11:49:16 AM2/3/09
to couc...@googlegroups.com
On Mon, Feb 2, 2009 at 10:09 PM, adam <adam....@redcoded.com> wrote:
>
>
> Would it be better to use the view structure from the peepcode instead
> of this new couchapp generate and use the couchdb api to push?
>

Couchapp is equivalent to couchview, except for a few details about
how it expects to see documents stored on the filesystem.

If I recall correctly, couchview takes something like this

views/test-map.js
views/test-reduce.js

and pushes it to the views member of a design doc, which you'd specify
on the command line, with a default of falling back to a directory
name. Couchview does that job just fine, but it is no generalized to
handle the other functions that can be stored in a design doc.

the CouchApp script takes a filesystem and pushes it transparently to
a design doc, so the on-disk layout it expects is a little different:

views/test/map.js
views/test/reduce.js
validate_doc_update.js
shows/post.js
lists/index.js
_attachments/images/example.png
_attachments/foo/bar.html

you are free to leave any of that out (so if you only care about views
then you should be able to use it just fine.)

currently the python version of couchapp also has the ability to
"clone" from a url. I'm working on getting the ruby version back up to
speed, but for now you might be happiest installing the python
version.

http://github.com/jchris/couchapp/tree/master

Chris


--
Chris Anderson
http://jchris.mfdz.com

adam

unread,
Feb 3, 2009, 5:26:08 PM2/3/09
to CouchRest
Thanks for your reply Chris. Using this folder format I was able to
push views to the db.

I've written a quick post on couchapp replacing couchview for future
googlers.
http://blog.redcoded.com/post/75223790/couchapp-replaces-couchview


cheers,
Adam

On Feb 3, 8:49 am, Chris Anderson <jch...@apache.org> wrote:

candlerb

unread,
Feb 4, 2009, 4:47:35 AM2/4/09
to CouchRest
However, I see that lib/couchrest/commands/{generate,push}.rb still
exist in the couchrest gems

(couchrest-0.12.4 and jchris-couchrest-0.12.6)

Just an oversight?

Chris Anderson

unread,
Feb 4, 2009, 2:41:10 PM2/4/09
to couc...@googlegroups.com

Yep

Reply all
Reply to author
Forward
0 new messages