Code coverage report for lib/common/properties-parser.js

Statements: 88.57% (31 / 35)      Branches: 50% (3 / 6)      Functions: 88.89% (8 / 9)      Lines: 88.57% (31 / 35)      Ignored: none     

All files » lib/common/ » properties-parser.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    1 1 1 1 1 5   1     1 10 10 10       10     10   1 5 5 5 5       5 5     5   1 5 5 5 5       5     5   1   1 1  
///<reference path=".d.ts"/>
"use strict";
var propertiesParser = require("properties-parser");
var Future = require("fibers/future");
var assert = require("assert");
var PropertiesParser = (function () {
    function PropertiesParser() {
        this._editor = null;
    }
    PropertiesParser.prototype.parse = function (text) {
        return propertiesParser.parse(text);
    };
    PropertiesParser.prototype.read = function (filePath) {
        var future = new Future();
        propertiesParser.read(filePath, function (err, data) {
            Iif (err) {
                future.throw(err);
            }
            else {
                future.return(data);
            }
        });
        return future;
    };
    PropertiesParser.prototype.createEditor = function (filePath) {
        var _this = this;
        var future = new Future();
        propertiesParser.createEditor(filePath, function (err, data) {
            Iif (err) {
                future.throw(err);
            }
            else {
                _this._editor = data;
                future.return(_this._editor);
            }
        });
        return future;
    };
    PropertiesParser.prototype.saveEditor = function () {
        assert.ok(this._editor, "Editor is undefied. Ensure that createEditor is called.");
        var future = new Future();
        this._editor.save(function (err) {
            Iif (err) {
                future.throw(err);
            }
            else {
                future.return();
            }
        });
        return future;
    };
    return PropertiesParser;
})();
exports.PropertiesParser = PropertiesParser;
$injector.register("propertiesParser", PropertiesParser);