node-query/node_modules/jsdoc/plugins/railsTemplate.js

20 lines
482 B
JavaScript
Raw Normal View History

2014-10-20 16:56:45 -04:00
/**
@overview Strips the rails template tags from a js.erb file
@module plugins/railsTemplate
@author Jannon Frank <jannon@jannon.net>
*/
2014-10-22 10:11:40 -04:00
'use strict';
2014-10-20 16:56:45 -04:00
exports.handlers = {
/**
* Remove rails tags from the source input (e.g. <% foo bar %>)
* @param e
* @param e.filename
* @param e.source
*/
beforeParse: function(e) {
if (e.filename.match(/\.erb$/)) {
2014-10-22 10:11:40 -04:00
e.source = e.source.replace(/<%.*%>/g, '');
2014-10-20 16:56:45 -04:00
}
}
};