Giter Site home page Giter Site logo

couch_docs's Issues

Better attachment handling

Rather than mime-encoding attachments inline in JSON, it would be nice to dump/load them directly on the filesystem.

Support for JSON in Design Docs

Some design doc keys have more complex JSON values than simply a string of Javascript for e.g. map / reduce functions. For example, it's nice to have couch_docs manage keeping your rewrite definitions up-to-date, which are defined in an array.

So e.g. it would be nice to have (on the filesystem):

db/_design/myapp/rewrites.json

.. and get a design doc like:

{
  "_id": "_design/myapp",
  "rewrites": [
  {
    "from": "/this",
    "to": "that"
  }
]
}

Typo in the doc for load

Hello,

In the README file, you're saying :

couch-docs load "http://localhost:5984/db" path/to/dump_dir/

However the appropriate command is the following :

couch-docs load path/to/dump_dir/ "http://localhost:5984/db"

Cannot be installed with ruby 2.0.0

Hi, I see that it's trying to compile json-1.4.6 but when I do gem install json the newest is 1.8.something

~/.rvm$ gem install couch_docs --no-rdoc --no-ri
Fetching: json-1.4.6.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing couch_docs:
        ERROR: Failed to build gem native extension.

    /home/hosiplan/.rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
checking for re.h... no
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling parser.c
In file included from /home/hosiplan/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby.h:33:0,
                 from parser.h:4,
                 from parser.rl:1:
parser.rl: In function ‘JSON_parse_object’:
/home/hosiplan/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:445:18: error: expected ‘(’ before ‘!’ token
 #define RTEST(v) !(((VALUE)(v) & ~Qnil) == 0)
                  ^
parser.rl:165:20: note: in expansion of macro ‘RTEST’
                 VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
                    ^
/home/hosiplan/.rvm/rubies/ruby-2.0.0-p451/include/ruby-2.0.0/ruby/ruby.h:445:18: warning: value computed is not used [-Wunused-value]
 #define RTEST(v) !(((VALUE)(v) & ~Qnil) == 0)
                  ^
parser.rl:165:20: note: in expansion of macro ‘RTEST’
                 VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
                    ^
parser.rl:165:68: error: expected ‘;’ before ‘{’ token
                 VALUE klass = rb_funcall(mJSON, i_deep_const_get, 1, klassname);
                                                                    ^
make: *** [parser.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/hosiplan/.rvm/gems/ruby-2.0.0-p451/gems/json-1.4.6 for inspection.
Results logged to /home/hosiplan/.rvm/gems/ruby-2.0.0-p451/extensions/x86_64-linux/2.0.0/json-1.4.6/gem_make.out

Sends "?rev=" on DB Delete on -R

When using the -R switch to couch-docs, it sends a DELETE with a "rev" param to the DB being written to. This results in an HTTP 400 / bad request, causing the update to fail.

Coffeescript

When writing design documents, it might be nice to use coffeescript.

deep_merge hash patch breaking rails 3

Added the gem to a rails 3 project, immediately started getting errors like:

undefined method deep_merge' for "%Y-%m-%d":String undefined methoddeep_merge' for ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]:Array

I haven't look into this too much, but the deep_merge patch in design_directory.rb is creating conflicts.

push -R is broken

$ ./bin/couch-docs push -R localhost:5984/test3 /tmp/test2
/home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:209:in process_result': HTTP status code 400 (RestClient::RequestFailed) from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:139:intransmit'
from /home/cstrom/.rvm/rubies/ruby-1.8.7-p302/lib/ruby/1.8/net/http.rb:543:in start' from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:137:intransmit'
from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:60:in execute_inner' from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:50:inexecute'
from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient/request.rb:28:in execute' from /home/cstrom/.rvm/gems/ruby-1.8.7-p302@couch_docs/gems/rest-client-1.1.0/lib/restclient.rb:79:indelete'
from /home/cstrom/repos/couch_docs/lib/couch_docs/store.rb:58:in delete' from /home/cstrom/repos/couch_docs/lib/couch_docs/store.rb:39:indelete_and_put'
from /home/cstrom/repos/couch_docs/lib/couch_docs/store.rb:35:in put!' from /home/cstrom/repos/couch_docs/lib/couch_docs.rb:80:indestructive_database_create'
from /home/cstrom/repos/couch_docs/lib/couch_docs/command_line.rb:30:in run' from /home/cstrom/repos/couch_docs/lib/couch_docs/command_line.rb:13:inrun'
from ./bin/couch-docs:10

Trouble using couch-docs to dump design docs

Hi,

I am testing out couch-docs, and want to try to dump the design and standard docs from a DB with about 90mm records in it.

I first tried to dump just the design docs and hit a brick wall.

root:/tmp/couch_dump# couch-docs dump -d "http://localhost:5984/searchlight_production"
/usr/local/lib/ruby/gems/1.8/gems/json-1.2.3/lib/json/common.rb:128:in `initialize': can't convert RestClient::Response into String (TypeError)
    from /usr/local/lib/ruby/gems/1.8/gems/json-1.2.3/lib/json/common.rb:128:in `new'
    from /usr/local/lib/ruby/gems/1.8/gems/json-1.2.3/lib/json/common.rb:128:in `parse'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs/store.rb:62:in `get'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs/store.rb:68:in `each'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs.rb:63:in `map'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs.rb:63:in `dump'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs/command_line.rb:23:in `run'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/lib/couch_docs/command_line.rb:11:in `run'
    from /usr/local/lib/ruby/gems/1.8/gems/couch_docs-1.1.0/bin/couch-docs:10
    from /usr/local/bin/couch-docs:19:in `load'
    from /usr/local/bin/couch-docs:19

Here is my Ruby info (Running Ruby Enterprise Edition):

root:/tmp/couch_dump# ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 20090928

And here is a link to the gems installed and my 'gem env' if thats helpful.

http://pastie.org/871132

If I run dump with '-D' to dump all docs, it does nothing visible. But I killed it before it had a chance perhaps to really do any work on such a large DB?

Thoughts? Thank you.

Implicit Dependency on Bones 2

Apparently "Bones.setup" disappeared in v3:

{dan@ledog ~/src/couch_docs}$ rake
(in /Users/dan/src/couch_docs)
rake aborted!
undefined method `setup' for Bones:Module
/Users/dan/src/couch_docs/Rakefile:7
(See full trace by running task with --trace)

{dan@ledog ~/src/couch_docs}$ gem list | grep bones
bones (3.4.1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.