Ghost/core/test/utils/fixtures
Aileen Nowak 63642fd8ad YAML settings loader and parser
closes #9528

These code changes introduce a YAML parser which will load and parse YAML files from the `/content/settings` directory. There are three major parts involved:

1. `ensure-settings.js`: this fn takes care that on bootstrap, the supported files are present in the `/content/settings` directory. If the files are not present, they get copied back from our default files. The default files to copy from are located in `core/server/services/settings`.

2. `loader.js`: the settings loader reads the requested `yaml` file from the disk and passes it to the yaml parser, which returns a `json` object of the file. The settings loader throws an error, if the file is not accessible, e. g. because of permission errors.

3. `yaml-parser`: gets passed a `yaml` file and returns a `json` object. If the file is not parseable, it returns a clear error that contains the information, what and where the parsing error occurred (e. g. line number and reason).

- added a `get()` fn to settings services, that returns the settings object that's asked for. e. g. `settings.get('routes').then(()...` will return the `routes` settings.
- added a `getAll()` fn to settings services, that returns all available settings in an object. The object looks like: `{routes: {routes: {}, collections: {}, resources: {}}, globals: {value: {}}`, assuming that we have to supported settings `routes` and `globals`.

Further additions:
- config `contentPath` for `settings`
- config overrides for default `yaml` files location in `/core/server/services/settings`

**Important**: These code changes are in preparation for Dynamic Routing and not yet used. The process of copying the supported `yaml` files (in this first step, the `routes.yaml` file) is not yet activated.
2018-04-15 19:40:22 +02:00
..
app Cleanup indentation now JSCS can see it 2016-06-11 20:25:15 +01:00
config 🎨 config optimisations (#7921) 2017-02-02 12:46:30 +00:00
csv 🎨 Use GhostAuth name and example emails (#7475) 2016-10-03 15:11:43 +01:00
data feature: define redirects in a custom file (#7719) (#7945) 2017-02-06 15:32:40 +01:00
export 🐛 Fixed importer bug: can't resolve authors relation 2018-04-10 01:10:06 +02:00
filter-param Multiple authors (#9426) 2018-03-27 15:16:15 +01:00
images 🎨 Blog icon improvements (#8260) 2017-04-11 13:40:17 +02:00
import 🙀 Image field naming & new img_url helper (#8364) 2017-04-24 18:21:47 +01:00
settings YAML settings loader and parser 2018-04-15 19:40:22 +02:00
themes Theme translations and blog localisation (#8437) 2018-01-09 14:50:57 +01:00
data-generator.js Fetch relations by default when insert/updating posts (#9568) 2018-04-15 12:12:20 +02:00
example.js Add jscs task to grunt file and clean up files to adhere to jscs rules. 2014-09-17 21:44:29 -04:00
test.hbs Move API tests to /integration/ 2013-11-07 14:26:47 +01:00