Skip to content

Commit d494dc6

Browse files
author
Eugene Ponizovsky
committed
Compleated POD documentation. Rewrited example.
Also added condition to skip directories durring configuration files processing.
1 parent 6beaba6 commit d494dc6

File tree

15 files changed

+314
-174
lines changed

15 files changed

+314
-174
lines changed

README

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ To install this module type the following:
1212

1313
DESCRIPTION
1414

15-
Config::Processor is the cascading configuration files parser with file inclusions
15+
Config::Processor is the cascading configuration files processor with file inclusions
1616
and variables interpolation support.
1717

1818
AUTHOR
@@ -27,4 +27,3 @@ All rights reserved.
2727
This module is free software; you can redistribute it and/or modify it under
2828
the same terms as Perl itself.
2929

30-

examples/etc/db.json

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1-
{ "db": {
2-
"generic": {
3-
"port": "5432",
4-
"dbname": "main",
5-
"options": {
6-
"PrintWarn": 0,
7-
"PrintError": 0,
8-
"RaiseError": 1,
9-
"pg_enable_utf8": 1
10-
}
11-
},
12-
13-
"master": {
14-
"underlay": { "var": "db.generic" },
15-
"host": "master-db.myservice.com"
16-
},
1+
{ "myapp": {
2+
"db": {
3+
"connectors": {
4+
"underlay": [
5+
{ "include": "db_connectors/default.yml" },
6+
{ "include": "db_connectors/default_test.yml" }
7+
],
178

18-
"slave": {
19-
"underlay": { "var": "db.generic" },
20-
"host": "slave-db.myservice.com"
21-
},
9+
"stat_master": {
10+
"underlay": { "var": "myapp.db.connectors.default" },
11+
"host": "stat-master.mydb.com",
12+
"username": "stat_writer",
13+
"password": "stat_writer_pass"
14+
},
2215

23-
"test": {
24-
"underlay": { "var": "db.generic" },
25-
"host": "test-db.myservice.com"
26-
},
16+
"stat_slave": {
17+
"underlay": { "var": "myapp.db.connectors.default" },
18+
"host": "stat-slave.mydb.com",
19+
"username": "stat_reader",
20+
"password": "stat_reader_pass"
21+
},
2722

28-
"overlay": [
29-
{ "include": "db_production.yml" },
30-
{ "include": "db_test.json" }
31-
]
23+
"test": {
24+
"underlay": { "var": "myapp.db.connectors.default_test" },
25+
"username": "test",
26+
"password": "test_pass"
27+
}
28+
}
29+
}
3230
}
3331
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default:
2+
port: "1234"
3+
dbname: 'stat'
4+
options:
5+
PrintWarn: 0
6+
PrintError: 0
7+
RaiseError: 1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
default_test:
2+
underlay: { var: myapp.db.connectors.default }
3+
host: 'stat-test.mydb.com'

examples/etc/db_production.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

examples/etc/db_test.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/etc/dirs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
myapp:
2+
media_formats: [ "images", "audio", "video" ]
3+
4+
dirs:
5+
root_dir: "/myapp"
6+
templates_dir: "${myapp.dirs.root_dir}/templates"
7+
sessions_dir: "${myapp.dirs.root_dir}/sessions"
8+
media_dirs:
9+
- "${myapp.dirs.root_dir}/medis/${myapp.media_formats.0}"
10+
- "${myapp.dirs.root_dir}/media/${myapp.media_formats.1}"
11+
- "${myapp.dirs.root_dir}/media/${myapp.media_formats.2}"

examples/etc/passwords/db.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/etc/passwords/system.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/etc/pathes.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)