Files
gitbook/lib/models
Ryan Swanson 465e8d6c0a Fixed two issues for handling git URLs for plugins that are published to git repositories rather than on npmjs.org.
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.
2016-05-26 14:30:29 -04:00
..
2016-04-30 22:06:16 +02:00
2016-05-17 12:48:03 +02:00
2016-04-30 22:06:16 +02:00
2016-04-22 22:21:34 +02:00
2016-04-22 11:00:21 +02:00
2016-05-12 15:12:08 +02:00
2016-04-28 21:25:58 +02:00
2016-05-11 13:11:32 +02:00
2016-04-26 14:25:54 +02:00
2016-05-09 22:01:25 +02:00

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;