You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/07/17 18:14:22 UTC

[01/14] examples commit: updated refs/heads/master to 8a630c5

Repository: couchdb-examples
Updated Branches:
  refs/heads/master [created] 8a630c5b9


add my-first-couchdb-plugin skeleton plugin & guide


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/92fb4805
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/92fb4805
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/92fb4805

Branch: refs/heads/master
Commit: 92fb48052fb56c29071cd6c2095f2ef9814a152f
Parents: 
Author: Jan Lehnardt <ja...@apache.org>
Authored: Thu Oct 3 21:50:34 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Thu Oct 3 22:14:07 2013 +0200

----------------------------------------------------------------------
 README.md                                  | 196 ++++++++++++++++++++++++
 priv/default.d/my_first_couchdb_plugin.ini |   0
 src/my_first_couchdb_plugin.app.src        |   9 ++
 src/my_first_couchdb_plugin.erl            |   6 +
 test/my_first_couchdb_plugin_tests.erl     |  15 ++
 5 files changed, 226 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/92fb4805/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..814ef3b
--- /dev/null
+++ b/README.md
@@ -0,0 +1,196 @@
+# My First CouchDB Plugin
+
+A practical guide to developing CouchDB plugins.
+
+*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn someting already :)*
+
+
+## Preparation
+
+To get started, you need to install CouchDB from source, grab the CouchDB sources:
+
+    git clone https://git-wip-us.apache.org/repos/asf/couchdb.git
+    cd couchdb
+    git checkout -b 1867-feature-plugin origin/1867-feature-plugins
+
+Follow the instructions in `couchdb/INSTALL.Unix` and `couchdb/DEVELOPERS` to get a development environment going.
+
+Be sure to install CouchDB into your system. If you want to install CouchDB into a development directory, make sure that the `bin/` folder of that directory is in your `PATH`.
+
+Next, install *rebar* from <https://github.com/rebar/rebar>. Rebar is a build tool for Erlang projects and it makes our lives a lot easier.
+
+
+## Quick Start
+
+
+`my_first_couchdb_plugin` includes two directories `src` and `test` with an `.erl` file in them each. `src/my_first_couchdb_plugin.erl` is where our module code will live and `test/my_first_couchdb_plugin_tests.erl` will contain any tests for that code.
+
+`src/my_first_couchdb_plugin.erl` now should look like this:
+
+    -module(my_first_couchdb_plugin).
+
+    -export([my_func/0]).
+
+    my_func() ->
+        ok.
+
+It doesn’t do much, but you get your first module going. Let’s try to compile it.
+
+`my_first_couchdb_plugin` comes with a `Makefile` that helps you with common tasks.
+
+To compile your code, simply run:
+
+    make
+
+The output should be something like this:
+
+    rebar compile
+    ==> my_first_couchdb_plugin (compile)
+    Compiled src/my_first_couchdb_plugin.erl
+
+The compiled results are stored in a directory called `ebin/`. Poke around in there if you are interested on how this all looks.
+
+To run CouchDB with your new plugin make sure CouchDB isn’t already running elsewhere and then do this:
+
+    make dev
+
+The output should look something like this:
+
+
+    Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:4] [hipe] [kernel-poll:true] [dtrace]
+
+    Eshell V5.9.3.1  (abort with ^G)
+    1> Apache CouchDB 1.3.0 (LogLevel=info) is starting.
+    Apache CouchDB has started. Time to relax.
+    [info] [<0.36.0>] Apache CouchDB has started on http://127.0.0.1:5984/
+
+That means, CouchDB is now running normally, in the foreground as opposed to in the background like you would normally, so you get status and error messages in the terminal. And one more thing, this drops you into an interactive Erlang shell that runs inside your CouchDB instance. To see it, just hit enter and you will get:
+
+    1>
+
+This is the Erlang command prompt and you can enter arbitrary commands. To call our module function, type this:
+
+    my_first_couchdb_plugin:my_func().
+
+And then enter. The full stop at the end is essential. The output should look like this:
+
+    1> my_first_couchdb_plugin:my_func().
+    ok
+    2>
+
+`ok` is the return value of your function, if you remember the code of `my_first_couchdb_plugin,erl`, you see `ok` is the last statement before the final full stop in the function definition of `my_func()` and thus, it is the return value of that function and we see it in the command prompt. Then the command prompt waits for your next line of input with `2>` (the number increases with each entered command). To get out of the command prompt and to stop CouchDB, just hit `ctrl-c` twice.
+
+Note: from now on you can just type `make dev`, it will run `make` for you internally and compile all changes you may have made in the meantime.
+
+* * *
+
+That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, once that handle HTTP requests, others that operate on database changes, and yet others that provide a deamon that does useful things for us.
+
+* * *
+
+
+## Publishing a Plugin
+
+Publishing a plugin is both simple and not so simple. The mechanics are trivial, just type:
+
+    make plugin
+
+and you will see something like this:
+
+    > make plugin
+    rebar compile
+    ==> my_first_couchdb_plugin (compile)
+    my_first_couchdb_plugin-1.0.0-R15B03-1.4.0.tar.gz: 1/MeXYfxeBK7DQyk10/6ucIRusc=
+
+That’s the easy part. The hard part is publishing the plugin. And since this is subject to change a lot in the near future, we will punt on explaining this in detail here, but to see how it works, look into this file in the CouchDB source distribution: `share/www/plugins.html`
+
+* * *
+
+
+## Creating an HTTP Handler
+
+Our module above is not very useful on its own. You can call it when you are in the Erlang command prompt for your local CouchDB, but CouchDB itself doesn’t know what to do with it and you can’t do anything with it from CouchDB’s HTTP API. Let’s fix that!
+
+CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straigtforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
+
+Before ge get goint, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
+
+    -module(my_first_couchdb_plugin_httpd).
+
+    -export([handle_req/1]).
+
+    -include_lib("couch/include/couch_db.hrl").
+
+    handle_req(#httpd{method='GET'}=Req) ->
+        couch_httpd:send_json(Req, {[{<<"hello">>, <<"world">>}]});
+    handle_req(Req) ->
+        couch_httpd:send_method_not_allowed(Req, "GET").
+
+Let’s go through this line by line:
+
+1. We define the module name, nothing to see here, move along.
+3. We export the function `handle_req`, e.g. we make it available to other modules.
+5. We include the standard CouchDB header. That gives us access to the internal data structures.
+7. We define the function `handle_req`. In particular, we define a clause of that function in a way that it gets invoked whenever CouchDB receives an HTTP `GET` request. It takes one argument, `Req` and it it includes all HTTP request information. `Req` is an instance of the record type `#httpd{}` that we will learn a lot more about in the future.
+8. We return a bit of JSON, the Erlang, or ejson, equivalent of `{"hello":"world"}`.
+9. We define the final, or default clause for the `handle_req` function. This is a default for all `handle_req` functions and handles the case when an API endpoint was called with an unsupported HTTP method, or path or other request parameters. In our case it will say that our `handle_req` only ever will handle `GET` requests and if it ever sees anything else, a standard “method not allowed” response will be generated for us.
+
+
+### Registering an HTTP Handler
+
+Now we have a function that can handle HTTP requests, but we haven’t told CouchDB yet, for what API endpoint this should be called.
+
+To do this, we need to take a little detour into the CouchDB configuration system, as CouchDB’s HTTP routing is fully dynamic and configurable at runtime.
+
+To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentialy an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
+
+    _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
+
+This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additinal argument that is the document root for Futon.
+
+Another example:
+
+    _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
+
+This means that `/_all_dbs`, the API endpoint that allows you to list all databases in CouchDB is handled by, again, `couch_httpd_misc_handlers` but this time its function `handle_all_dbs_req`, which does not take an additional argument.
+
+Say we want to make our `handle_req` function answer under the enpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
+
+    _my_plugin = {my_first_couchdb_plugin, handle_req}
+
+But don’t add that to `etc/couchdb/default.ini.tpl.in`! Instead, craete a new `.ini` file in your plugin at `priv/default.d/my_first_couchdb_plugin.ini` with these contents:
+
+    [httpd_global_handlers]
+    _my_plugin = {my_first_couchdb_plugin_httpd, handle_req}
+    
+
+Don’t miss the new line at the end.
+
+Now run `make dev` again, and then open a second terminal:
+
+    curl http://127.0.0.1:5984/_my_plugin
+    {"hello":"world"}
+
+It worked, yay!
+
+When we do a `POST` request, that should fail:
+
+    curl -X POST http://127.0.0.1:5984/_my_plugin
+
+
+
+TODO:
+- show that POST fails as expected
+- exploring #httpd{} and how to react to different kinds of HTTP requests
+- hook up `handle_req` with `my_func`
+...
+* * *
+
+
+## Creating a Daemon
+
+TBD
+
+
+TODO:
+-  add “what can go wrong at this step”

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/92fb4805/priv/default.d/my_first_couchdb_plugin.ini
----------------------------------------------------------------------
diff --git a/priv/default.d/my_first_couchdb_plugin.ini b/priv/default.d/my_first_couchdb_plugin.ini
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/92fb4805/src/my_first_couchdb_plugin.app.src
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.app.src b/src/my_first_couchdb_plugin.app.src
new file mode 100644
index 0000000..01ce897
--- /dev/null
+++ b/src/my_first_couchdb_plugin.app.src
@@ -0,0 +1,9 @@
+%% -*- mode: erlang -*-
+{application, my_first_couchdb_plugin, [
+    {description, "My First CouchDB Plugin"},
+    {vsn, "0.0.0"},
+    {modules, []},
+    {registered, []},
+    {applications, [kernel, stdlib]},
+    {env, []}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/92fb4805/src/my_first_couchdb_plugin.erl
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.erl b/src/my_first_couchdb_plugin.erl
new file mode 100644
index 0000000..b1bdd04
--- /dev/null
+++ b/src/my_first_couchdb_plugin.erl
@@ -0,0 +1,6 @@
+-module(my_first_couchdb_plugin).
+
+-export([my_func/0]).
+
+my_func() ->
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/92fb4805/test/my_first_couchdb_plugin_tests.erl
----------------------------------------------------------------------
diff --git a/test/my_first_couchdb_plugin_tests.erl b/test/my_first_couchdb_plugin_tests.erl
new file mode 100644
index 0000000..53d75df
--- /dev/null
+++ b/test/my_first_couchdb_plugin_tests.erl
@@ -0,0 +1,15 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(my_first_couchdb_plugin_tests).
+-include_lib("eunit/include/eunit.hrl").
+


[09/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
[my-first-couchdb-plugin] remove note about ex-Makefile.dist


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/c584dc63
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/c584dc63
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/c584dc63

Branch: refs/heads/master
Commit: c584dc636d445ae0d7ad14540cf55a963770d955
Parents: 4820044
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Oct 7 17:36:01 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Oct 7 17:36:01 2013 +0200

----------------------------------------------------------------------
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/c584dc63/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index bce2124..814ef3b 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Next, install *rebar* from <https://github.com/rebar/rebar>. Rebar is a build to
 
 It doesn’t do much, but you get your first module going. Let’s try to compile it.
 
-`my_first_couchdb_plugin` comes with a `Makefile.dist` that helps you with common tasks. To make your life easier, rename it from `Makefile.dist` to `Makefile`.
+`my_first_couchdb_plugin` comes with a `Makefile` that helps you with common tasks.
 
 To compile your code, simply run:
 


[13/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
update clone command to clone from github repo

since this already works on main couchdb.


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/4d04cc26
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/4d04cc26
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/4d04cc26

Branch: refs/heads/master
Commit: 4d04cc2688be297489aebdd0722787bcded51a1b
Parents: 41b7f95
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:52:14 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:52:14 2014 +0100

----------------------------------------------------------------------
 README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/4d04cc26/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8bef13c..3c25eec 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,8 @@ A practical guide to developing CouchDB plugins.
 
 To get started, you need to install CouchDB from source, grab the CouchDB sources:
 
-    git clone https://git-wip-us.apache.org/repos/asf/couchdb.git
+    git clone https://github.com/apache/couchdb.git
     cd couchdb
-    git checkout -b 1867-feature-plugin origin/1867-feature-plugins
 
 Follow the instructions in `couchdb/INSTALL.Unix` and `couchdb/DEVELOPERS` to get a development environment going.
 


[05/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
add my-first-couchdb-plugin .gitignore


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/c63b97cc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/c63b97cc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/c63b97cc

Branch: refs/heads/master
Commit: c63b97cc2275ee573570e269f817eceaa5b980ba
Parents: 115a410
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:11:36 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:11:36 2013 +0200

----------------------------------------------------------------------
 .gitignore | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/c63b97cc/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..cfb2329
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+ebin


[12/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
update opening note


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/41b7f95d
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/41b7f95d
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/41b7f95d

Branch: refs/heads/master
Commit: 41b7f95da677ceff5de77d9c7f788b75583104bf
Parents: 4e03ed5
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:51:15 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:51:15 2014 +0100

----------------------------------------------------------------------
 README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/41b7f95d/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 37c0a75..8bef13c 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,7 @@
 
 A practical guide to developing CouchDB plugins.
 
-*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn something already :)*
-
+*NOTE: this feature is considered beta, possibly subject to change and expects that you understand some Erlang.
 
 ## Preparation
 


[14/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
Move my-first-couchdb-plugin to a subdirectory


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/8a630c5b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/8a630c5b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/8a630c5b

Branch: refs/heads/master
Commit: 8a630c5b92bd8b6924d6a6e9191a81ec517b9036
Parents: 4d04cc2
Author: Robert Newson <rn...@apache.org>
Authored: Thu Jul 17 17:13:55 2014 +0100
Committer: Robert Newson <rn...@apache.org>
Committed: Thu Jul 17 17:13:55 2014 +0100

----------------------------------------------------------------------
 Makefile                                        |  38 ----
 README.md                                       | 194 -------------------
 my-first-couchdb-plugin/Makefile                |  38 ++++
 my-first-couchdb-plugin/README.md               | 194 +++++++++++++++++++
 .../priv/default.d/my_first_couchdb_plugin.ini  |   3 +
 .../src/my_first_couchdb_plugin.app.src         |  21 ++
 .../src/my_first_couchdb_plugin.erl             |  18 ++
 .../test/my_first_couchdb_plugin_tests.erl      |  15 ++
 priv/default.d/my_first_couchdb_plugin.ini      |   3 -
 src/my_first_couchdb_plugin.app.src             |  21 --
 src/my_first_couchdb_plugin.erl                 |  18 --
 test/my_first_couchdb_plugin_tests.erl          |  15 --
 12 files changed, 289 insertions(+), 289 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 7806bd7..0000000
--- a/Makefile
+++ /dev/null
@@ -1,38 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-# Customize here
-NAME=my_first_couchdb_plugin
-VERSION=1.0.0
-# Stop customizing here
-
-ERL=$(shell couch-config --erl-bin)
-ERLANG_VERSION=$(shell couch-config --erlang-version)
-COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
-PLUGIN_DIRS=ebin priv
-PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
-PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
-
-all: compile
-
-compile:
-	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
-
-dev:
-	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
-
-plugin: compile
-	@mkdir -p $(PLUGIN_DIRS)
-	@mkdir -p $(PLUGIN_DIST)
-	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
-	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
-	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
deleted file mode 100644
index 3c25eec..0000000
--- a/README.md
+++ /dev/null
@@ -1,194 +0,0 @@
-# My First CouchDB Plugin
-
-A practical guide to developing CouchDB plugins.
-
-*NOTE: this feature is considered beta, possibly subject to change and expects that you understand some Erlang.
-
-## Preparation
-
-To get started, you need to install CouchDB from source, grab the CouchDB sources:
-
-    git clone https://github.com/apache/couchdb.git
-    cd couchdb
-
-Follow the instructions in `couchdb/INSTALL.Unix` and `couchdb/DEVELOPERS` to get a development environment going.
-
-Be sure to install CouchDB into your system. If you want to install CouchDB into a development directory, make sure that the `bin/` folder of that directory is in your `PATH`.
-
-Next, install *rebar* from <https://github.com/rebar/rebar>. Rebar is a build tool for Erlang projects and it makes our lives a lot easier.
-
-
-## Quick Start
-
-
-`my_first_couchdb_plugin` includes two directories `src` and `test` with an `.erl` file in them each. `src/my_first_couchdb_plugin.erl` is where our module code will live and `test/my_first_couchdb_plugin_tests.erl` will contain any tests for that code.
-
-`src/my_first_couchdb_plugin.erl` now should look like this:
-
-    -module(my_first_couchdb_plugin).
-
-    -export([my_func/0]).
-
-    my_func() ->
-        ok.
-
-It doesn’t do much, but you get your first module going. Let’s try to compile it.
-
-`my_first_couchdb_plugin` comes with a `Makefile` that helps you with common tasks.
-
-To compile your code, simply run:
-
-    make
-
-The output should be something like this:
-
-    rebar compile
-    ==> my_first_couchdb_plugin (compile)
-    Compiled src/my_first_couchdb_plugin.erl
-
-The compiled results are stored in a directory called `ebin/`. Poke around in there if you are interested on how this all looks.
-
-To run CouchDB with your new plugin make sure CouchDB isn’t already running elsewhere and then do this:
-
-    make dev
-
-The output should look something like this:
-
-
-    Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:4] [hipe] [kernel-poll:true] [dtrace]
-
-    Eshell V5.9.3.1  (abort with ^G)
-    1> Apache CouchDB 1.3.0 (LogLevel=info) is starting.
-    Apache CouchDB has started. Time to relax.
-    [info] [<0.36.0>] Apache CouchDB has started on http://127.0.0.1:5984/
-
-That means, CouchDB is now running normally, in the foreground as opposed to in the background like you would normally, so you get status and error messages in the terminal. And one more thing, this drops you into an interactive Erlang shell that runs inside your CouchDB instance. To see it, just hit enter and you will get:
-
-    1>
-
-This is the Erlang command prompt and you can enter arbitrary commands. To call our module function, type this:
-
-    my_first_couchdb_plugin:my_func().
-
-And then enter. The full stop at the end is essential. The output should look like this:
-
-    1> my_first_couchdb_plugin:my_func().
-    ok
-    2>
-
-`ok` is the return value of your function, if you remember the code of `my_first_couchdb_plugin,erl`, you see `ok` is the last statement before the final full stop in the function definition of `my_func()` and thus, it is the return value of that function and we see it in the command prompt. Then the command prompt waits for your next line of input with `2>` (the number increases with each entered command). To get out of the command prompt and to stop CouchDB, just hit `ctrl-c` twice.
-
-Note: from now on you can just type `make dev`, it will run `make` for you internally and compile all changes you may have made in the meantime.
-
-* * *
-
-That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, ones that handle HTTP requests, others that operate on database changes, and yet others that provide a daemon that does useful things for us.
-
-* * *
-
-
-## Publishing a Plugin
-
-Publishing a plugin is both simple and not so simple. The mechanics are trivial, just type:
-
-    make plugin
-
-and you will see something like this:
-
-    > make plugin
-    rebar compile
-    ==> my_first_couchdb_plugin (compile)
-    my_first_couchdb_plugin-1.0.0-R15B03-1.4.0.tar.gz: 1/MeXYfxeBK7DQyk10/6ucIRusc=
-
-That’s the easy part. The hard part is publishing the plugin. And since this is subject to change a lot in the near future, we will punt on explaining this in detail here, but to see how it works, look into this file in the CouchDB source distribution: `share/www/plugins.html`
-
-* * *
-
-
-## Creating an HTTP Handler
-
-Our module above is not very useful on its own. You can call it when you are in the Erlang command prompt for your local CouchDB, but CouchDB itself doesn’t know what to do with it and you can’t do anything with it from CouchDB’s HTTP API. Let’s fix that!
-
-CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straightforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
-
-Before we get going, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
-
-    -module(my_first_couchdb_plugin_httpd).
-
-    -export([handle_req/1]).
-
-    -include_lib("couch/include/couch_db.hrl").
-
-    handle_req(#httpd{method='GET'}=Req) ->
-        couch_httpd:send_json(Req, {[{<<"hello">>, <<"world">>}]});
-    handle_req(Req) ->
-        couch_httpd:send_method_not_allowed(Req, "GET").
-
-Let’s go through this line by line:
-
-1. We define the module name, nothing to see here, move along.
-3. We export the function `handle_req`, e.g. we make it available to other modules.
-5. We include the standard CouchDB header. That gives us access to the internal data structures.
-7. We define the function `handle_req`. In particular, we define a clause of that function in a way that it gets invoked whenever CouchDB receives an HTTP `GET` request. It takes one argument, `Req` and it it includes all HTTP request information. `Req` is an instance of the record type `#httpd{}` that we will learn a lot more about in the future.
-8. We return a bit of JSON, the Erlang, or ejson, equivalent of `{"hello":"world"}`.
-9. We define the final, or default clause for the `handle_req` function. This is a default for all `handle_req` functions and handles the case when an API endpoint was called with an unsupported HTTP method, or path or other request parameters. In our case it will say that our `handle_req` only ever will handle `GET` requests and if it ever sees anything else, a standard “method not allowed” response will be generated for us.
-
-
-### Registering an HTTP Handler
-
-Now we have a function that can handle HTTP requests, but we haven’t told CouchDB yet, for what API endpoint this should be called.
-
-To do this, we need to take a little detour into the CouchDB configuration system, as CouchDB’s HTTP routing is fully dynamic and configurable at runtime.
-
-To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentially an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
-
-    _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
-
-This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additional argument that is the document root for Futon.
-
-Another example:
-
-    _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
-
-This means that `/_all_dbs`, the API endpoint that allows you to list all databases in CouchDB is handled by, again, `couch_httpd_misc_handlers` but this time its function `handle_all_dbs_req`, which does not take an additional argument.
-
-Say we want to make our `handle_req` function answer under the endpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
-
-    _my_plugin = {my_first_couchdb_plugin, handle_req}
-
-But don’t add that to `etc/couchdb/default.ini.tpl.in`! Instead, craete a new `.ini` file in your plugin at `priv/default.d/my_first_couchdb_plugin.ini` with these contents:
-
-    [httpd_global_handlers]
-    _my_plugin = {my_first_couchdb_plugin_httpd, handle_req}
-    
-
-Don’t miss the new line at the end.
-
-Now run `make dev` again, and then open a second terminal:
-
-    curl http://127.0.0.1:5984/_my_plugin
-    {"hello":"world"}
-
-It worked, yay!
-
-When we do a `POST` request, that should fail:
-
-    curl -X POST http://127.0.0.1:5984/_my_plugin
-
-
-
-TODO:
-- show that POST fails as expected
-- exploring #httpd{} and how to react to different kinds of HTTP requests
-- hook up `handle_req` with `my_func`
-...
-* * *
-
-
-## Creating a Daemon
-
-TBD
-
-
-TODO:
--  add “what can go wrong at this step”

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/Makefile
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/Makefile b/my-first-couchdb-plugin/Makefile
new file mode 100644
index 0000000..7806bd7
--- /dev/null
+++ b/my-first-couchdb-plugin/Makefile
@@ -0,0 +1,38 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+# Customize here
+NAME=my_first_couchdb_plugin
+VERSION=1.0.0
+# Stop customizing here
+
+ERL=$(shell couch-config --erl-bin)
+ERLANG_VERSION=$(shell couch-config --erlang-version)
+COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
+PLUGIN_DIRS=ebin priv
+PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
+PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
+
+all: compile
+
+compile:
+	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
+
+dev:
+	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
+
+plugin: compile
+	@mkdir -p $(PLUGIN_DIRS)
+	@mkdir -p $(PLUGIN_DIST)
+	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
+	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
+	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/README.md
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/README.md b/my-first-couchdb-plugin/README.md
new file mode 100644
index 0000000..3c25eec
--- /dev/null
+++ b/my-first-couchdb-plugin/README.md
@@ -0,0 +1,194 @@
+# My First CouchDB Plugin
+
+A practical guide to developing CouchDB plugins.
+
+*NOTE: this feature is considered beta, possibly subject to change and expects that you understand some Erlang.
+
+## Preparation
+
+To get started, you need to install CouchDB from source, grab the CouchDB sources:
+
+    git clone https://github.com/apache/couchdb.git
+    cd couchdb
+
+Follow the instructions in `couchdb/INSTALL.Unix` and `couchdb/DEVELOPERS` to get a development environment going.
+
+Be sure to install CouchDB into your system. If you want to install CouchDB into a development directory, make sure that the `bin/` folder of that directory is in your `PATH`.
+
+Next, install *rebar* from <https://github.com/rebar/rebar>. Rebar is a build tool for Erlang projects and it makes our lives a lot easier.
+
+
+## Quick Start
+
+
+`my_first_couchdb_plugin` includes two directories `src` and `test` with an `.erl` file in them each. `src/my_first_couchdb_plugin.erl` is where our module code will live and `test/my_first_couchdb_plugin_tests.erl` will contain any tests for that code.
+
+`src/my_first_couchdb_plugin.erl` now should look like this:
+
+    -module(my_first_couchdb_plugin).
+
+    -export([my_func/0]).
+
+    my_func() ->
+        ok.
+
+It doesn’t do much, but you get your first module going. Let’s try to compile it.
+
+`my_first_couchdb_plugin` comes with a `Makefile` that helps you with common tasks.
+
+To compile your code, simply run:
+
+    make
+
+The output should be something like this:
+
+    rebar compile
+    ==> my_first_couchdb_plugin (compile)
+    Compiled src/my_first_couchdb_plugin.erl
+
+The compiled results are stored in a directory called `ebin/`. Poke around in there if you are interested on how this all looks.
+
+To run CouchDB with your new plugin make sure CouchDB isn’t already running elsewhere and then do this:
+
+    make dev
+
+The output should look something like this:
+
+
+    Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:4] [hipe] [kernel-poll:true] [dtrace]
+
+    Eshell V5.9.3.1  (abort with ^G)
+    1> Apache CouchDB 1.3.0 (LogLevel=info) is starting.
+    Apache CouchDB has started. Time to relax.
+    [info] [<0.36.0>] Apache CouchDB has started on http://127.0.0.1:5984/
+
+That means, CouchDB is now running normally, in the foreground as opposed to in the background like you would normally, so you get status and error messages in the terminal. And one more thing, this drops you into an interactive Erlang shell that runs inside your CouchDB instance. To see it, just hit enter and you will get:
+
+    1>
+
+This is the Erlang command prompt and you can enter arbitrary commands. To call our module function, type this:
+
+    my_first_couchdb_plugin:my_func().
+
+And then enter. The full stop at the end is essential. The output should look like this:
+
+    1> my_first_couchdb_plugin:my_func().
+    ok
+    2>
+
+`ok` is the return value of your function, if you remember the code of `my_first_couchdb_plugin,erl`, you see `ok` is the last statement before the final full stop in the function definition of `my_func()` and thus, it is the return value of that function and we see it in the command prompt. Then the command prompt waits for your next line of input with `2>` (the number increases with each entered command). To get out of the command prompt and to stop CouchDB, just hit `ctrl-c` twice.
+
+Note: from now on you can just type `make dev`, it will run `make` for you internally and compile all changes you may have made in the meantime.
+
+* * *
+
+That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, ones that handle HTTP requests, others that operate on database changes, and yet others that provide a daemon that does useful things for us.
+
+* * *
+
+
+## Publishing a Plugin
+
+Publishing a plugin is both simple and not so simple. The mechanics are trivial, just type:
+
+    make plugin
+
+and you will see something like this:
+
+    > make plugin
+    rebar compile
+    ==> my_first_couchdb_plugin (compile)
+    my_first_couchdb_plugin-1.0.0-R15B03-1.4.0.tar.gz: 1/MeXYfxeBK7DQyk10/6ucIRusc=
+
+That’s the easy part. The hard part is publishing the plugin. And since this is subject to change a lot in the near future, we will punt on explaining this in detail here, but to see how it works, look into this file in the CouchDB source distribution: `share/www/plugins.html`
+
+* * *
+
+
+## Creating an HTTP Handler
+
+Our module above is not very useful on its own. You can call it when you are in the Erlang command prompt for your local CouchDB, but CouchDB itself doesn’t know what to do with it and you can’t do anything with it from CouchDB’s HTTP API. Let’s fix that!
+
+CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straightforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
+
+Before we get going, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
+
+    -module(my_first_couchdb_plugin_httpd).
+
+    -export([handle_req/1]).
+
+    -include_lib("couch/include/couch_db.hrl").
+
+    handle_req(#httpd{method='GET'}=Req) ->
+        couch_httpd:send_json(Req, {[{<<"hello">>, <<"world">>}]});
+    handle_req(Req) ->
+        couch_httpd:send_method_not_allowed(Req, "GET").
+
+Let’s go through this line by line:
+
+1. We define the module name, nothing to see here, move along.
+3. We export the function `handle_req`, e.g. we make it available to other modules.
+5. We include the standard CouchDB header. That gives us access to the internal data structures.
+7. We define the function `handle_req`. In particular, we define a clause of that function in a way that it gets invoked whenever CouchDB receives an HTTP `GET` request. It takes one argument, `Req` and it it includes all HTTP request information. `Req` is an instance of the record type `#httpd{}` that we will learn a lot more about in the future.
+8. We return a bit of JSON, the Erlang, or ejson, equivalent of `{"hello":"world"}`.
+9. We define the final, or default clause for the `handle_req` function. This is a default for all `handle_req` functions and handles the case when an API endpoint was called with an unsupported HTTP method, or path or other request parameters. In our case it will say that our `handle_req` only ever will handle `GET` requests and if it ever sees anything else, a standard “method not allowed” response will be generated for us.
+
+
+### Registering an HTTP Handler
+
+Now we have a function that can handle HTTP requests, but we haven’t told CouchDB yet, for what API endpoint this should be called.
+
+To do this, we need to take a little detour into the CouchDB configuration system, as CouchDB’s HTTP routing is fully dynamic and configurable at runtime.
+
+To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentially an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
+
+    _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
+
+This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additional argument that is the document root for Futon.
+
+Another example:
+
+    _all_dbs = {couch_httpd_misc_handlers, handle_all_dbs_req}
+
+This means that `/_all_dbs`, the API endpoint that allows you to list all databases in CouchDB is handled by, again, `couch_httpd_misc_handlers` but this time its function `handle_all_dbs_req`, which does not take an additional argument.
+
+Say we want to make our `handle_req` function answer under the endpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
+
+    _my_plugin = {my_first_couchdb_plugin, handle_req}
+
+But don’t add that to `etc/couchdb/default.ini.tpl.in`! Instead, craete a new `.ini` file in your plugin at `priv/default.d/my_first_couchdb_plugin.ini` with these contents:
+
+    [httpd_global_handlers]
+    _my_plugin = {my_first_couchdb_plugin_httpd, handle_req}
+    
+
+Don’t miss the new line at the end.
+
+Now run `make dev` again, and then open a second terminal:
+
+    curl http://127.0.0.1:5984/_my_plugin
+    {"hello":"world"}
+
+It worked, yay!
+
+When we do a `POST` request, that should fail:
+
+    curl -X POST http://127.0.0.1:5984/_my_plugin
+
+
+
+TODO:
+- show that POST fails as expected
+- exploring #httpd{} and how to react to different kinds of HTTP requests
+- hook up `handle_req` with `my_func`
+...
+* * *
+
+
+## Creating a Daemon
+
+TBD
+
+
+TODO:
+-  add “what can go wrong at this step”

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/priv/default.d/my_first_couchdb_plugin.ini
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/priv/default.d/my_first_couchdb_plugin.ini b/my-first-couchdb-plugin/priv/default.d/my_first_couchdb_plugin.ini
new file mode 100644
index 0000000..fbc2d98
--- /dev/null
+++ b/my-first-couchdb-plugin/priv/default.d/my_first_couchdb_plugin.ini
@@ -0,0 +1,3 @@
+;per-plugin configuration goes here
+;[plugin-name]
+;config=value

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.app.src
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/src/my_first_couchdb_plugin.app.src b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.app.src
new file mode 100644
index 0000000..9a24bf8
--- /dev/null
+++ b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.app.src
@@ -0,0 +1,21 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+%% -*- mode: erlang -*-
+{application, my_first_couchdb_plugin, [
+    {description, "My First CouchDB Plugin"},
+    {vsn, "0.0.0"},
+    {modules, []},
+    {registered, []},
+    {applications, [kernel, stdlib]},
+    {env, []}
+]}.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.erl
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/src/my_first_couchdb_plugin.erl b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.erl
new file mode 100644
index 0000000..64d728c
--- /dev/null
+++ b/my-first-couchdb-plugin/src/my_first_couchdb_plugin.erl
@@ -0,0 +1,18 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(my_first_couchdb_plugin).
+
+-export([my_func/0]).
+
+my_func() ->
+    ok.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/my-first-couchdb-plugin/test/my_first_couchdb_plugin_tests.erl
----------------------------------------------------------------------
diff --git a/my-first-couchdb-plugin/test/my_first_couchdb_plugin_tests.erl b/my-first-couchdb-plugin/test/my_first_couchdb_plugin_tests.erl
new file mode 100644
index 0000000..53d75df
--- /dev/null
+++ b/my-first-couchdb-plugin/test/my_first_couchdb_plugin_tests.erl
@@ -0,0 +1,15 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
+-module(my_first_couchdb_plugin_tests).
+-include_lib("eunit/include/eunit.hrl").
+

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/priv/default.d/my_first_couchdb_plugin.ini
----------------------------------------------------------------------
diff --git a/priv/default.d/my_first_couchdb_plugin.ini b/priv/default.d/my_first_couchdb_plugin.ini
deleted file mode 100644
index fbc2d98..0000000
--- a/priv/default.d/my_first_couchdb_plugin.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-;per-plugin configuration goes here
-;[plugin-name]
-;config=value

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/src/my_first_couchdb_plugin.app.src
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.app.src b/src/my_first_couchdb_plugin.app.src
deleted file mode 100644
index 9a24bf8..0000000
--- a/src/my_first_couchdb_plugin.app.src
+++ /dev/null
@@ -1,21 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-%   http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
-%% -*- mode: erlang -*-
-{application, my_first_couchdb_plugin, [
-    {description, "My First CouchDB Plugin"},
-    {vsn, "0.0.0"},
-    {modules, []},
-    {registered, []},
-    {applications, [kernel, stdlib]},
-    {env, []}
-]}.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/src/my_first_couchdb_plugin.erl
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.erl b/src/my_first_couchdb_plugin.erl
deleted file mode 100644
index 64d728c..0000000
--- a/src/my_first_couchdb_plugin.erl
+++ /dev/null
@@ -1,18 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-%   http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(my_first_couchdb_plugin).
-
--export([my_func/0]).
-
-my_func() ->
-    ok.

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/8a630c5b/test/my_first_couchdb_plugin_tests.erl
----------------------------------------------------------------------
diff --git a/test/my_first_couchdb_plugin_tests.erl b/test/my_first_couchdb_plugin_tests.erl
deleted file mode 100644
index 53d75df..0000000
--- a/test/my_first_couchdb_plugin_tests.erl
+++ /dev/null
@@ -1,15 +0,0 @@
-% Licensed under the Apache License, Version 2.0 (the "License"); you may not
-% use this file except in compliance with the License. You may obtain a copy of
-% the License at
-%
-%   http://www.apache.org/licenses/LICENSE-2.0
-%
-% Unless required by applicable law or agreed to in writing, software
-% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-% License for the specific language governing permissions and limitations under
-% the License.
-
--module(my_first_couchdb_plugin_tests).
--include_lib("eunit/include/eunit.hrl").
-


[04/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
remove accidental edit


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/115a4100
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/115a4100
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/115a4100

Branch: refs/heads/master
Commit: 115a4100930c2a59e7c915b0075e1d82f2e51a21
Parents: 27c3c8c
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:04:19 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:04:19 2013 +0200

----------------------------------------------------------------------
 Makefile.am | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/115a4100/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index cb3b70f..d15897f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,6 @@
 EXTRA_DIST =
   .gitignore \
   Makefile.dist \
-  Makefile.am \
   priv/default.d/my_first_couchdb_plugin.ini \
   README.md \
   src/my_first_couchdb_plugin.app.src \


[08/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
move build system edits for my-first-couchdb-plugin to src/


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/48200443
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/48200443
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/48200443

Branch: refs/heads/master
Commit: 48200443dda766b28ac3b38266f6365a2a8febe9
Parents: c324b5d
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Oct 7 17:28:06 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Oct 7 17:28:06 2013 +0200

----------------------------------------------------------------------
 Makefile      | 38 ++++++++++++++++++++++++++++++++++++++
 Makefile.am   | 20 --------------------
 Makefile.dist | 38 --------------------------------------
 3 files changed, 38 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/48200443/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7806bd7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,38 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+# Customize here
+NAME=my_first_couchdb_plugin
+VERSION=1.0.0
+# Stop customizing here
+
+ERL=$(shell couch-config --erl-bin)
+ERLANG_VERSION=$(shell couch-config --erlang-version)
+COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
+PLUGIN_DIRS=ebin priv
+PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
+PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
+
+all: compile
+
+compile:
+	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
+
+dev:
+	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
+
+plugin: compile
+	@mkdir -p $(PLUGIN_DIRS)
+	@mkdir -p $(PLUGIN_DIST)
+	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
+	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
+	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/48200443/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
deleted file mode 100644
index d8021de..0000000
--- a/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-EXTRA_DIST = \
-  .gitignore \
-  Makefile.dist \
-  priv/default.d/my_first_couchdb_plugin.ini \
-  README.md \
-  src/my_first_couchdb_plugin.app.src \
-  src/my_first_couchdb_plugin.erl \
-  test/my_first_couchdb_plugin_tests.erl

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/48200443/Makefile.dist
----------------------------------------------------------------------
diff --git a/Makefile.dist b/Makefile.dist
deleted file mode 100644
index 7806bd7..0000000
--- a/Makefile.dist
+++ /dev/null
@@ -1,38 +0,0 @@
-## Licensed under the Apache License, Version 2.0 (the "License"); you may not
-## use this file except in compliance with the License. You may obtain a copy of
-## the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-## License for the specific language governing permissions and limitations under
-## the License.
-
-# Customize here
-NAME=my_first_couchdb_plugin
-VERSION=1.0.0
-# Stop customizing here
-
-ERL=$(shell couch-config --erl-bin)
-ERLANG_VERSION=$(shell couch-config --erlang-version)
-COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
-PLUGIN_DIRS=ebin priv
-PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
-PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
-
-all: compile
-
-compile:
-	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
-
-dev:
-	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
-
-plugin: compile
-	@mkdir -p $(PLUGIN_DIRS)
-	@mkdir -p $(PLUGIN_DIST)
-	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
-	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
-	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell


[10/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
blank files might sink ships


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/5d6bc083
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/5d6bc083
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/5d6bc083

Branch: refs/heads/master
Commit: 5d6bc0832888f71aa7a534ece00c20a9e044ce7a
Parents: c584dc6
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Jan 13 20:25:45 2014 +0100
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Jan 13 20:26:05 2014 +0100

----------------------------------------------------------------------
 priv/default.d/my_first_couchdb_plugin.ini | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/5d6bc083/priv/default.d/my_first_couchdb_plugin.ini
----------------------------------------------------------------------
diff --git a/priv/default.d/my_first_couchdb_plugin.ini b/priv/default.d/my_first_couchdb_plugin.ini
index e69de29..fbc2d98 100644
--- a/priv/default.d/my_first_couchdb_plugin.ini
+++ b/priv/default.d/my_first_couchdb_plugin.ini
@@ -0,0 +1,3 @@
+;per-plugin configuration goes here
+;[plugin-name]
+;config=value


[02/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
custom Makefile for my-first-couchdb-plugin


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/1d8d0511
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/1d8d0511
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/1d8d0511

Branch: refs/heads/master
Commit: 1d8d051155a265a7f230df386890a5a8e84d9a73
Parents: 92fb480
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:02:04 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:02:04 2013 +0200

----------------------------------------------------------------------
 Makefile.am   | 21 +++++++++++++++++++++
 Makefile.dist | 38 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/1d8d0511/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..cb3b70f
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,21 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+EXTRA_DIST =
+  .gitignore \
+  Makefile.dist \
+  Makefile.am \
+  priv/default.d/my_first_couchdb_plugin.ini \
+  README.md \
+  src/my_first_couchdb_plugin.app.src \
+  src/my_first_couchdb_plugin.erl \
+  test/my_first_couchdb_plugin_tests.erl

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/1d8d0511/Makefile.dist
----------------------------------------------------------------------
diff --git a/Makefile.dist b/Makefile.dist
new file mode 100644
index 0000000..7806bd7
--- /dev/null
+++ b/Makefile.dist
@@ -0,0 +1,38 @@
+## Licensed under the Apache License, Version 2.0 (the "License"); you may not
+## use this file except in compliance with the License. You may obtain a copy of
+## the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+## WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+## License for the specific language governing permissions and limitations under
+## the License.
+
+# Customize here
+NAME=my_first_couchdb_plugin
+VERSION=1.0.0
+# Stop customizing here
+
+ERL=$(shell couch-config --erl-bin)
+ERLANG_VERSION=$(shell couch-config --erlang-version)
+COUCHDB_VERSION=$(shell couch-config --couch-version | sed 's/\+.*//')
+PLUGIN_DIRS=ebin priv
+PLUGIN_VERSION_SLUG=$(NAME)-$(VERSION)-$(ERLANG_VERSION)-$(COUCHDB_VERSION)
+PLUGIN_DIST=$(PLUGIN_VERSION_SLUG)
+
+all: compile
+
+compile:
+	ERL_LIBS=$(shell couch-config --erl-libs-dir):$(ERL_LIBS) rebar compile
+
+dev:
+	@ERL_LIBS=$(shell pwd) couchdb -i -a priv/default.d/*.ini
+
+plugin: compile
+	@mkdir -p $(PLUGIN_DIRS)
+	@mkdir -p $(PLUGIN_DIST)
+	@cp -r $(PLUGIN_DIRS) $(PLUGIN_DIST)
+	@tar czf $(PLUGIN_VERSION_SLUG).tar.gz $(PLUGIN_DIST)
+	@$(ERL) -eval 'File = "$(PLUGIN_VERSION_SLUG).tar.gz", {ok, Data} = file:read_file(File),io:format("~s: ~s~n", [File, base64:encode(crypto:sha(Data))]),halt()' -noshell


[07/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
[my-first-couchdb-plugin] use Apache 2 License


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/c324b5d3
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/c324b5d3
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/c324b5d3

Branch: refs/heads/master
Commit: c324b5d3f4b132f5d733f6ad9958e0fbc68c6c98
Parents: 3e50ff4
Author: Jan Lehnardt <ja...@apache.org>
Authored: Mon Oct 7 17:18:52 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Mon Oct 7 17:18:52 2013 +0200

----------------------------------------------------------------------
 src/my_first_couchdb_plugin.app.src | 12 ++++++++++++
 src/my_first_couchdb_plugin.erl     | 12 ++++++++++++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/c324b5d3/src/my_first_couchdb_plugin.app.src
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.app.src b/src/my_first_couchdb_plugin.app.src
index 01ce897..9a24bf8 100644
--- a/src/my_first_couchdb_plugin.app.src
+++ b/src/my_first_couchdb_plugin.app.src
@@ -1,3 +1,15 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
 %% -*- mode: erlang -*-
 {application, my_first_couchdb_plugin, [
     {description, "My First CouchDB Plugin"},

http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/c324b5d3/src/my_first_couchdb_plugin.erl
----------------------------------------------------------------------
diff --git a/src/my_first_couchdb_plugin.erl b/src/my_first_couchdb_plugin.erl
index b1bdd04..64d728c 100644
--- a/src/my_first_couchdb_plugin.erl
+++ b/src/my_first_couchdb_plugin.erl
@@ -1,3 +1,15 @@
+% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+% use this file except in compliance with the License. You may obtain a copy of
+% the License at
+%
+%   http://www.apache.org/licenses/LICENSE-2.0
+%
+% Unless required by applicable law or agreed to in writing, software
+% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+% License for the specific language governing permissions and limitations under
+% the License.
+
 -module(my_first_couchdb_plugin).
 
 -export([my_func/0]).


[11/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
spell checking my-first-couchdb-plugin's README


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/4e03ed5c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/4e03ed5c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/4e03ed5c

Branch: refs/heads/master
Commit: 4e03ed5cce74335ec96efbcaf478f31a2763e174
Parents: 5d6bc08
Author: Mariano Guerra <lu...@gmail.com>
Authored: Mon Mar 17 13:43:20 2014 +0100
Committer: Mariano Guerra <lu...@gmail.com>
Committed: Mon Mar 17 13:43:20 2014 +0100

----------------------------------------------------------------------
 README.md | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/4e03ed5c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 814ef3b..37c0a75 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
 
 A practical guide to developing CouchDB plugins.
 
-*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn someting already :)*
+*NOTE: This is incomplete, barely tested, works only with the 1867-feature-plugin branch of Apache CouchDB and expects that you understand some Erlang. This is mostly for early review, but if you are daring, you can learn something already :)*
 
 
 ## Preparation
@@ -84,7 +84,7 @@ Note: from now on you can just type `make dev`, it will run `make` for you inter
 
 * * *
 
-That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, once that handle HTTP requests, others that operate on database changes, and yet others that provide a deamon that does useful things for us.
+That is all that is needed to get started building a CouchDB plugin. The rest of this guide will explain how to hook into the various parts of CouchDB that allow you to do all sorts of fun things. That means you can write different types of plugins, ones that handle HTTP requests, others that operate on database changes, and yet others that provide a daemon that does useful things for us.
 
 * * *
 
@@ -111,9 +111,9 @@ That’s the easy part. The hard part is publishing the plugin. And since this i
 
 Our module above is not very useful on its own. You can call it when you are in the Erlang command prompt for your local CouchDB, but CouchDB itself doesn’t know what to do with it and you can’t do anything with it from CouchDB’s HTTP API. Let’s fix that!
 
-CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straigtforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
+CouchDB’s main API is HTTP and thus we can expect to have a lot of infrastructure to work with. Luckily, it is mostly straightforward to get into and we don’t need to learn a whole lot before can get started, and learn more as we go along.
 
-Before ge get goint, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
+Before we get going, let’s create another file that handles all our HTTP handler code. Create `src/my_first_couchdb_plugin_httpd.erl` and put in the following contents:
 
     -module(my_first_couchdb_plugin_httpd).
 
@@ -142,11 +142,11 @@ Now we have a function that can handle HTTP requests, but we haven’t told Couc
 
 To do this, we need to take a little detour into the CouchDB configuration system, as CouchDB’s HTTP routing is fully dynamic and configurable at runtime.
 
-To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentialy an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
+To get an idea, open this file in CouchDB source directory: `etc/couchdb/default.ini.tpl.in`, don’t mind the triple file extensions, this is essentially an `.ini` file. Now scroll down to the section `[httpd_global_handlers]`. You will find a list of API endpoints with mapping to the code in CouchDB that handles it. for example:
 
     _utils = {couch_httpd_misc_handlers, handle_utils_dir_req, "%localdatadir%/www"}
 
-This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additinal argument that is the document root for Futon.
+This means that `/_utils` is handled by the erlang module `couch_httpd_misc_handlers` and its function `handle_utils_dir_req` and it takes one additional argument that is the document root for Futon.
 
 Another example:
 
@@ -154,7 +154,7 @@ Another example:
 
 This means that `/_all_dbs`, the API endpoint that allows you to list all databases in CouchDB is handled by, again, `couch_httpd_misc_handlers` but this time its function `handle_all_dbs_req`, which does not take an additional argument.
 
-Say we want to make our `handle_req` function answer under the enpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
+Say we want to make our `handle_req` function answer under the endpoint `/_my_plugin` (you want to start with an underscore here, as CouchDB will consider all other characters as real database names), we would add something like this:
 
     _my_plugin = {my_first_couchdb_plugin, handle_req}
 


[03/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
advise renaming the Makefile


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/27c3c8cc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/27c3c8cc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/27c3c8cc

Branch: refs/heads/master
Commit: 27c3c8cc47012051af759a4625c6b8364c1556f2
Parents: 1d8d051
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:02:50 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:02:50 2013 +0200

----------------------------------------------------------------------
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/27c3c8cc/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 814ef3b..bce2124 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ Next, install *rebar* from <https://github.com/rebar/rebar>. Rebar is a build to
 
 It doesn’t do much, but you get your first module going. Let’s try to compile it.
 
-`my_first_couchdb_plugin` comes with a `Makefile` that helps you with common tasks.
+`my_first_couchdb_plugin` comes with a `Makefile.dist` that helps you with common tasks. To make your life easier, rename it from `Makefile.dist` to `Makefile`.
 
 To compile your code, simply run:
 


[06/14] examples commit: updated refs/heads/master to 8a630c5

Posted by rn...@apache.org.
fix typo


Project: http://git-wip-us.apache.org/repos/asf/couchdb-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-examples/commit/3e50ff44
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-examples/tree/3e50ff44
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-examples/diff/3e50ff44

Branch: refs/heads/master
Commit: 3e50ff44c3e4d069adb78739e5fc30355ec249df
Parents: c63b97c
Author: Jan Lehnardt <ja...@apache.org>
Authored: Fri Oct 4 15:11:43 2013 +0200
Committer: Jan Lehnardt <ja...@apache.org>
Committed: Fri Oct 4 15:11:43 2013 +0200

----------------------------------------------------------------------
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-examples/blob/3e50ff44/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index d15897f..d8021de 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,7 @@
 ## License for the specific language governing permissions and limitations under
 ## the License.
 
-EXTRA_DIST =
+EXTRA_DIST = \
   .gitignore \
   Makefile.dist \
   priv/default.d/my_first_couchdb_plugin.ini \