You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/08/17 20:33:19 UTC
couch-plugins commit: updated refs/heads/windsor-merge to 853957d
Repository: couchdb-couch-plugins
Updated Branches:
refs/heads/windsor-merge [created] 853957d72
Update to use the new config application
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/commit/853957d7
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/tree/853957d7
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/diff/853957d7
Branch: refs/heads/windsor-merge
Commit: 853957d72cf5b592bcc1535bb6c7bc5c65a101ad
Parents: ebfbd9d
Author: Paul J. Davis <pa...@gmail.com>
Authored: Sun Aug 17 13:33:00 2014 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Sun Aug 17 13:33:00 2014 -0500
----------------------------------------------------------------------
src/couch_plugins.erl | 12 ++++++------
src/couch_plugins_httpd.erl | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/blob/853957d7/src/couch_plugins.erl
----------------------------------------------------------------------
diff --git a/src/couch_plugins.erl b/src/couch_plugins.erl
index dcbd2d3..24e9a50 100644
--- a/src/couch_plugins.erl
+++ b/src/couch_plugins.erl
@@ -17,7 +17,7 @@
% couch_plugins:install({"geocouch", "http://people.apache.org/~jan/", "couchdb1.2.x_v0.3.0-11-gd83ba22", [{"R15B03", "ZetgdHj2bY2w37buulWVf3USOZs="}]}).
plugin_dir() ->
- couch_config:get("couchdb", "plugin_dir").
+ config:get("couchdb", "plugin_dir").
log(T) ->
?LOG_DEBUG("[couch_plugins] ~p ~n", [T]).
@@ -82,11 +82,11 @@ uninstall({Name, _BaseUrl, Version, _Checksums}) ->
-spec register_plugin(string(), string()) -> ok.
register_plugin(Name, Version) ->
- couch_config:set("plugins", Name, Version).
+ config:set("plugins", Name, Version).
-spec unregister_plugin(string()) -> ok.
unregister_plugin(Name) ->
- couch_config:delete("plugins", Name).
+ config:delete("plugins", Name).
%% * * *
@@ -110,16 +110,16 @@ loop_config(Name, Version, Fun) ->
-spec load_config_file(string(), function()) -> ok.
load_config_file(File, Fun) ->
- {ok, Config} = couch_config:parse_ini_file(File),
+ {ok, Config} = config:parse_ini_file(File),
lists:foreach(Fun, Config).
-spec set_config({{string(), string()}, string()}) -> ok.
set_config({{Section, Key}, Value}) ->
- ok = couch_config:set(Section, Key, Value).
+ ok = config:set(Section, Key, Value).
-spec delete_config({{string(), string()}, _Value}) -> ok.
delete_config({{Section, Key}, _Value}) ->
- ok = couch_config:delete(Section, Key).
+ ok = config:delete(Section, Key).
-spec file_names(string(), string()) -> string().
file_names(Name, Version) ->
http://git-wip-us.apache.org/repos/asf/couchdb-couch-plugins/blob/853957d7/src/couch_plugins_httpd.erl
----------------------------------------------------------------------
diff --git a/src/couch_plugins_httpd.erl b/src/couch_plugins_httpd.erl
index 4dabbb4..d4d455b 100644
--- a/src/couch_plugins_httpd.erl
+++ b/src/couch_plugins_httpd.erl
@@ -41,7 +41,7 @@ handle_req(#httpd{method='GET',path_parts=[_, Name0 | Path0]}=Req) ->
Name = ?b2l(Name0),
Path = lists:map(fun binary_to_list/1, Path0),
OTPRelease = erlang:system_info(otp_release),
- PluginVersion = couch_config:get("plugins", Name),
+ PluginVersion = config:get("plugins", Name),
CouchDBVersion = couch_server:get_version(short),
FullName = string:join([Name, PluginVersion, OTPRelease, CouchDBVersion], "-"),
FullPath = filename:join([FullName, "priv", "www", string:join(Path, "/")]) ++ "/",
@@ -51,7 +51,7 @@ handle_req(Req) ->
couch_httpd:send_method_not_allowed(Req, "POST").
plugin_dir() ->
- couch_config:get("couchdb", "plugin_dir").
+ config:get("couchdb", "plugin_dir").
do_install(false, Plugin) ->
couch_plugins:install(Plugin);
do_install(true, Plugin) ->