Skip to content

Commit d947010

Browse files
committed
bump to 0.5.0
1 parent c62fb0e commit d947010

File tree

6 files changed

+295
-119
lines changed

6 files changed

+295
-119
lines changed

README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# econfig - simple Erlang config handler using INI files #
44

5-
Copyright (c) 2012-2014 Benoît Chesneau.
5+
Copyright (c) 2012-2015 Benoît Chesneau.
66

7-
__Version:__ 0.4.2
7+
__Version:__ 0.5.0
88

99
# econfig
1010

@@ -30,30 +30,31 @@ for last changes.
3030
Quick usage example:
3131

3232
```
33-
1> application:start(gproc).
33+
1> application:ensure_all_started(econfig).
3434
ok
35-
2> application:start(econfig).
35+
2> econfig:register_config(test, ["test/fixtures/test.ini", "test/fixtures/test2.ini"], [autoreload]).
3636
ok
37-
3> econfig:register_config(couchdb, ["/Users/benoitc/refuge/rcouch/rel/rcouch/etc/default.ini", "/Users/benoitc/refuge/rcouch/rel/rcouch/etc/local.ini"], [autoreload]).
38-
ok
39-
4> econfig:subscribe(couchdb).
37+
3> econfig:subscribe(test).
4038
true
41-
5> econfig:get_value(couchdb, "couchdb").
42-
[{"delayed_commits","true"},
43-
{"file_compression","snappy"},
44-
{"os_process_timeout","5000"},
45-
{"uri_file","./data/couch.uri"},
46-
{"index_dir","./data"},
47-
{"max_document_size","4294967296"},
48-
{"database_dir","./data"},
49-
{"max_dbs_open","100"}]
50-
6> econfig:set_value(couchdb, "ssl", "test", "1").
39+
4> econfig:get_value(test, "section1").
40+
[{"key 3","value 3"},
41+
{"key1","value1"},
42+
{"key2","value 2"},
43+
{"key4","value 4"},
44+
{"key5","value5"}]
45+
5> econfig:set_value(test, "section1", "key6", "value6").
5146
ok
52-
7> flush().
53-
Shell got {config_updated,couchdb,{set,{"ssl","test"}}}
47+
6> flush().
48+
Shell got {config_updated,test,{set,{"section1","key6"}}}
5449
ok
5550
```
5651

52+
## Specific features
53+
54+
### on_change hook
55+
56+
Some application may want to handle changes without suscribing to change. This change allows a user to pass a change function when registering the configuation. This function will be called each time a change happen.
57+
5758
Contribute
5859
----------
5960
For issues, comments or feedback please [create an issue!] [1]

doc/README.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# econfig - simple Erlang config handler using INI files #
44

5-
Copyright (c) 2012-2014 Benoît Chesneau.
5+
Copyright (c) 2012-2015 Benoît Chesneau.
66

7-
__Version:__ 0.4.2
7+
__Version:__ 0.5.0
88

99
# econfig
1010

@@ -30,30 +30,31 @@ for last changes.
3030
Quick usage example:
3131

3232
```
33-
1> application:start(gproc).
33+
1> application:ensure_all_started(econfig).
3434
ok
35-
2> application:start(econfig).
35+
2> econfig:register_config(test, ["test/fixtures/test.ini", "test/fixtures/test2.ini"], [autoreload]).
3636
ok
37-
3> econfig:register_config(couchdb, ["/Users/benoitc/refuge/rcouch/rel/rcouch/etc/default.ini", "/Users/benoitc/refuge/rcouch/rel/rcouch/etc/local.ini"], [autoreload]).
38-
ok
39-
4> econfig:subscribe(couchdb).
37+
3> econfig:subscribe(test).
4038
true
41-
5> econfig:get_value(couchdb, "couchdb").
42-
[{"delayed_commits","true"},
43-
{"file_compression","snappy"},
44-
{"os_process_timeout","5000"},
45-
{"uri_file","./data/couch.uri"},
46-
{"index_dir","./data"},
47-
{"max_document_size","4294967296"},
48-
{"database_dir","./data"},
49-
{"max_dbs_open","100"}]
50-
6> econfig:set_value(couchdb, "ssl", "test", "1").
39+
4> econfig:get_value(test, "section1").
40+
[{"key 3","value 3"},
41+
{"key1","value1"},
42+
{"key2","value 2"},
43+
{"key4","value 4"},
44+
{"key5","value5"}]
45+
5> econfig:set_value(test, "section1", "key6", "value6").
5146
ok
52-
7> flush().
53-
Shell got {config_updated,couchdb,{set,{"ssl","test"}}}
47+
6> flush().
48+
Shell got {config_updated,test,{set,{"section1","key6"}}}
5449
ok
5550
```
5651

52+
## Specific features
53+
54+
### on_change hook
55+
56+
Some application may want to handle changes without suscribing to change. This change allows a user to pass a change function when registering the configuation. This function will be called each time a change happen.
57+
5758
Contribute
5859
----------
5960
For issues, comments or feedback please [create an issue!] [1]

0 commit comments

Comments
 (0)