ahmedyha/LightCouch — pull request #19 by cipriancraciun (2012-11-18 20:28:25+00:00)
Title: Add support for temporary views

There are two batches of changes split in two patches:
* the first one makes `MapReduce` a static inner class of `DesignDocument`, as there is absolutely no reason for it being tied with an instance of the design document;
* add a new method to the client `tempView` with two strings being the functions, and the needed support inside `View`; (this is minimal;)

I've tested it against the latest CouchDB.

In order to apply it on the current `master` (my patch is based on `v0.0.4`), you'll get a conflict, but it's a minor problem:
```
++<<<<<<< HEAD
+ for (String viewDirName : viewsRootDir.list()) { // views sub-dirs
+ MapReduce mr = dd.new MapReduce();
++=======
+ for (String viewDirName : viewsRootDir.list()) { // view dirs
+ MapReduce mr = new MapReduce();
++>>>>>>> patches/temporary-views
```

Just replace `dd.new MapReduce();` with `new MapReduce();`. The conflict is because the line before was changed by updating it's trailing comment.

(If this conflict is bothersome I could provide a rebased patch.)