Code coverage report for master/plugins/railsTemplate.js

Statements: 100% (3 / 3)      Branches: 50% (1 / 2)      Functions: 100% (1 / 1)      Lines: 100% (3 / 3)      Ignored: none     

All files » master/plugins/ » railsTemplate.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21              1               1 1        
/**
    @overview Strips the rails template tags from a js.erb file
    @module plugins/railsTemplate
    @author Jannon Frank <jannon@jannon.net>
 */
'use strict';
 
exports.handlers = {
    /**
     * Remove rails tags from the source input (e.g. <% foo bar %>)
     * @param e
     * @param e.filename
     * @param e.source
     */
    beforeParse: function(e) {
        Eif (e.filename.match(/\.erb$/)) {
            e.source = e.source.replace(/<%.*%>/g, '');
        }
    }
};