Commits

Benoit Chesneau committed 3ad4305

typo

  • Participants
  • Parent commits 2c87d02
  • Tags 0.2

Comments (0)

Files changed (11)

File include/couchbeam.hrl

 -record(server_state, {
     couchdb = #couchdb_params{},
     prefix,
+    name,
     dbs_by_name = undefined,
     dbs_by_pid = undefined,
     uuids_pid = undefined

File src/couchbeam.erl

 
 
 -module(couchbeam).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(application).
 

File src/couchbeam_db.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_db).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(gen_server).
 
 info(Db) ->
     gen_server:call(Db, info, infinity).
     
+    
+    
 open(ConnectionPid, DbName) ->
     couchbeam_server:open_db(ConnectionPid, DbName).
-    
+
 close(ConnectionPid, Db) ->
     couchbeam_server:close_db(ConnectionPid, Db).
     

File src/couchbeam_doc.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_doc).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 -include("couchbeam.hrl").
 
 -export([set_value/3, get_value/2,  extend/2, extend/3,

File src/couchbeam_manager.erl

 %% This gen_server is responsible of maintaining registration of server connections.
 
 -module(couchbeam_manager).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(gen_server).
 

File src/couchbeam_resource.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_resource).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -include("couchbeam.hrl").
 
     after Timeout ->
             lhttpc:kill_client(Pid)
     end.
-  
-
-insert_default_headers([], H) ->
-    H;
-insert_default_headers([{K, V}|Rest], H) ->
-    H1 = default_header(K, V, H),
-    insert_default_headers(Rest, H1).
-
 
 make_auth(#couchdb_params{username=nil, password=nil}, Headers) ->
     Headers;

File src/couchbeam_server.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_server).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(gen_server).
 
     end,
     CouchdbParams1 = CouchdbParams#couchdb_params{prefix=Prefix1},
     InitialState = #server_state{couchdb = CouchdbParams1,
-                                 prefix  = Prefix1},
+                                 prefix  = Prefix1,
+                                 name=Name},
     {ok, Pid} = start_internal(InitialState, ProcLink),
     {ok, _} = couchbeam_manager:register_connection(Name, Pid),
     Pid.
     end,
     {reply, Pid, State};
     
-handle_call({create_db, DbName}, _From, #server_state{prefix=Base, 
+handle_call({create_db, DbName}, _From, #server_state{prefix=Base,
                                                 couchdb=C,
                                                 dbs_by_name=DbsNameTid,
                                                 dbs_by_pid=DbsPidTid}=State) ->

File src/couchbeam_sup.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_sup).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 -behaviour(supervisor).
 
 -export([start_link/0, init/1]).

File src/couchbeam_uuids.erl

 %% @copyright 2009 Benoît Chesneau.
 
 -module(couchbeam_uuids).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(gen_server).
 

File src/couchbeam_view.erl

 
 
 -module(couchbeam_view).
--author('Benoît Chesneau <benoitc@e-engura.org').
+-author('Benoît Chesneau <benoitc@e-engura.org>').
 
 -behaviour(gen_server).
 

File t/003-database.t

     etap:is(couchbeam_server:delete_db(default, "couchbeam_testdb2"), ok, "delete couchbeam_testdb2 ok"),
     AllDbs1 = couchbeam_server:all_dbs(default),
     etap:not_ok(lists:member(<<"couchbeam_testdb2">>, AllDbs1), "couchbeam_testdb2 don't exists ok"),
+    couchbeam_db:close(default, Db),
     ok.