You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2018/03/14 15:40:18 UTC

[1/2] config commit: updated refs/heads/master to 0f915ae

Repository: couchdb-config
Updated Branches:
  refs/heads/master fc5594cb8 -> 0f915ae97


Support not persist variants for helper functions

This adds support for specifying Persist argument for the following
helper functions:

 * set_boolean
 * set_integer
 * set_float


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

Branch: refs/heads/master
Commit: 0c6010e4a33f9bd5f6907e886186448f7af7f499
Parents: fc5594c
Author: ILYA Khlopotov <ii...@apache.org>
Authored: Wed Mar 14 06:13:56 2018 -0700
Committer: ILYA Khlopotov <ii...@apache.org>
Committed: Wed Mar 14 06:26:13 2018 -0700

----------------------------------------------------------------------
 src/config.erl | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-config/blob/0c6010e4/src/config.erl
----------------------------------------------------------------------
diff --git a/src/config.erl b/src/config.erl
index aa127d8..d1b67d7 100644
--- a/src/config.erl
+++ b/src/config.erl
@@ -27,9 +27,9 @@
 -export([set/3, set/4, set/5]).
 -export([delete/2, delete/3, delete/4]).
 
--export([get_integer/3, set_integer/3]).
--export([get_float/3, set_float/3]).
--export([get_boolean/3, set_boolean/3]).
+-export([get_integer/3, set_integer/3, set_integer/4]).
+-export([get_float/3, set_float/3, set_float/4]).
+-export([get_boolean/3, set_boolean/3, set_boolean/4]).
 
 -export([features/0, enable_feature/1, disable_feature/1]).
 
@@ -72,9 +72,12 @@ get_integer(Section, Key, Default) when is_integer(Default) ->
             Default
     end.
 
-set_integer(Section, Key, Value) when is_integer(Value) ->
-    set(Section, Key, integer_to_list(Value));
-set_integer(_, _, _) ->
+set_integer(Section, Key, Value) ->
+    set_integer(Section, Key, Value, true).
+
+set_integer(Section, Key, Value, Persist) when is_integer(Value) ->
+    set(Section, Key, integer_to_list(Value), Persist);
+set_integer(_, _, _, _) ->
     error(badarg).
 
 to_integer(List) when is_list(List) ->
@@ -92,9 +95,12 @@ get_float(Section, Key, Default) when is_float(Default) ->
             Default
     end.
 
-set_float(Section, Key, Value) when is_float(Value) ->
-    set(Section, Key, float_to_list(Value));
-set_float(_, _, _) ->
+set_float(Section, Key, Value) ->
+    set_float(Section, Key, Value, true).
+
+set_float(Section, Key, Value, Persist) when is_float(Value) ->
+    set(Section, Key, float_to_list(Value), Persist);
+set_float(_, _, _, _) ->
     error(badarg).
 
 to_float(List) when is_list(List) ->
@@ -114,11 +120,14 @@ get_boolean(Section, Key, Default) when is_boolean(Default) ->
             Default
     end.
 
-set_boolean(Section, Key, true) ->
-    set(Section, Key, "true");
-set_boolean(Section, Key, false) ->
-    set(Section, Key, "false");
-set_boolean(_, _, _) ->
+set_boolean(Section, Key, Value) ->
+    set_boolean(Section, Key, Value, true).
+
+set_boolean(Section, Key, true, Persist) ->
+    set(Section, Key, "true", Persist);
+set_boolean(Section, Key, false, Persist) ->
+    set(Section, Key, "false", Persist);
+set_boolean(_, _, _, _) ->
     error(badarg).
 
 to_boolean(List) when is_list(List) ->


[2/2] config commit: updated refs/heads/master to 0f915ae

Posted by va...@apache.org.
Merge remote-tracking branch 'cloudant/support-not-persist-variants'

Fix #19


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

Branch: refs/heads/master
Commit: 0f915ae9718e09c80b935b32bd0d0d1fc67f4e9b
Parents: fc5594c 0c6010e
Author: Nick Vatamaniuc <va...@apache.org>
Authored: Wed Mar 14 11:38:57 2018 -0400
Committer: Nick Vatamaniuc <va...@apache.org>
Committed: Wed Mar 14 11:38:57 2018 -0400

----------------------------------------------------------------------
 src/config.erl | 37 +++++++++++++++++++++++--------------
 1 file changed, 23 insertions(+), 14 deletions(-)
----------------------------------------------------------------------