mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +00:00
465e8d6c0a
Fixed issue in pluginDependency to dereference 'name' and 'version' using Immutable Map.get(...) accessors since config values are now wrapped by Immutable.fromJS(...) in config.js > setValue(...). Added associated unit test. Fixed issue in resolveVersion where a plugin may be using a git URL rather than a semver for the version portion of the plugin config definition. In addition, refactored the resolveVersion function into a new module to allow for unit testing. Added associated unit test.
var Immutable = require('immutable');
var File = require('./file');
var Readme = Immutable.Record({
file: File(),
title: String(),
description: String()
});
Readme.prototype.getFile = function() {
return this.get('file');
};
Readme.prototype.getTitle = function() {
return this.get('title');
};
Readme.prototype.getDescription = function() {
return this.get('description');
};
/**
Create a new readme
@param {File} file
@param {Object} def
@return {Readme}
*/
Readme.create = function(file, def) {
def = def || {};
return new Readme({
file: file,
title: def.title || '',
description: def.description || ''
});
};
module.exports = Readme;