Code coverage report for lib/project.js

Statements: 48.48% (16 / 33)      Branches: 37.5% (9 / 24)      Functions: 66.67% (2 / 3)      Lines: 48.48% (16 / 33)      Ignored: none     

All files » lib/ » project.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 631   1                         3 3     3 3 3 3       3           3         3 3     3   3           3               3          
YUI.add('project', function (Y) {
 
    Y.Project = {
        mix: function (json, options) {
            if (json.project) {
                options = Y.merge(options, json.project);
            }
 
            if (options.title && !options.name) {
                options.name = options.title;
            }
 
            return options;
        },
        init: function (options) {
            var project = {};
            Iif (options.configfile) {
                project = Y.Files.getJSON(options.configfile);
            } else {
                Y.log('Scanning for yuidoc.json file.', 'info', 'yuidoc');
                project = Y.getProjectData();
                Eif (!project) {
                    project = {};
                }
            }
 
            Iif (project.options && Object.keys(project.options).length) {
                options = Y.merge(project.options, options);
                delete project.options;
                options.project = project;
            }
 
            Iif (options.version && options.project) {
                options.project.version = options.version;
                delete options.version;
            }
 
            Eif (!options.outdir) {
                options.outdir = './out';
            }
 
            options.paths = Y.validatePaths(options.paths, options.ignorePaths);
 
            Iif (!options.paths.length) {
                Y.log('Paths argument was empty', 'warn', 'yuidoc');
                Y.showHelp();
                process.exit(1);
            }
 
            Iif (typeof options.tabtospace === 'number') {
                /*jshint onevar:false */
                options.tabspace = '';
                for (var s = 0; s < options.tabtospace; s++) {
                    options.tabspace += ' ';
                }
            }
 
            return options;
        }
    };
 
});