summaryrefslogtreecommitdiffstats
path: root/lib/models
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-26 11:00:36 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-26 11:00:36 +0200
commit8a3f80ba82bd706083015f228c551d64768a287e (patch)
tree1afa30295ff795ec209e91501f6d4146dd1dd4d4 /lib/models
parent374ebd6f7a77bfbde00f5d1e730403afd86e018f (diff)
downloadgitbook-8a3f80ba82bd706083015f228c551d64768a287e.zip
gitbook-8a3f80ba82bd706083015f228c551d64768a287e.tar.gz
gitbook-8a3f80ba82bd706083015f228c551d64768a287e.tar.bz2
Add test for parsing glossary
Diffstat (limited to 'lib/models')
-rw-r--r--lib/models/config.js3
-rw-r--r--lib/models/file.js9
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/models/config.js b/lib/models/config.js
index 8684a03..720ac57 100644
--- a/lib/models/config.js
+++ b/lib/models/config.js
@@ -2,10 +2,11 @@ var is = require('is');
var Immutable = require('immutable');
var File = require('./file');
+var configDefault = require('../constants/configDefault');
var Config = Immutable.Record({
file: File(),
- values: Immutable.Map()
+ values: configDefault
}, 'Config');
Config.prototype.getPath = function() {
diff --git a/lib/models/file.js b/lib/models/file.js
index b6b06ee..ff7b899 100644
--- a/lib/models/file.js
+++ b/lib/models/file.js
@@ -20,6 +20,15 @@ File.prototype.getMTime = function() {
};
/**
+ Does the file exists / is set
+
+ @return {Boolean}
+*/
+File.prototype.exists = function() {
+ return Boolean(this.getPath());
+};
+
+/**
Return type of file ('markdown' or 'asciidoc')
@return {String}