From e79a0132f348c26c40a51f157b39797c95e21e08 Mon Sep 17 00:00:00 2001 From: Martin Donnelly Date: Wed, 15 Jun 2016 14:38:21 +0100 Subject: [PATCH] tidied feeds a bit and fixed fit --- .idea/workspace.xml | 782 +++++++++--------- bare-news.js | 85 ++ fit.js | 49 +- news.js | 18 +- node_modules/ejs/Jakefile | 1 + node_modules/ejs/README.md | 80 +- node_modules/ejs/ejs.js | 15 +- node_modules/ejs/ejs.min.js | 2 +- node_modules/ejs/lib/ejs.js | 10 + node_modules/ejs/package.json | 25 +- node_modules/ejs/test/ejs.js | 38 + node_modules/ejs/test/tmp/include.ejs | 1 - .../ejs/test/tmp/include_preprocessor.ejs | 1 - node_modules/ejs/test/tmp/renderFile.ejs | 1 - node_modules/express/package.json | 10 +- node_modules/lodash/README.md | 8 +- node_modules/lodash/array.js | 1 + node_modules/lodash/lang.js | 1 + node_modules/lodash/package.json | 37 +- node_modules/rss-braider/lib/RssBraider.js | 3 +- node_modules/rss-braider/package.json | 8 +- paleo.js | 20 +- plugins/fix_images.js | 6 +- plugins/fix_scripts.js | 4 +- 24 files changed, 704 insertions(+), 502 deletions(-) create mode 100644 bare-news.js delete mode 100644 node_modules/ejs/test/tmp/include.ejs delete mode 100644 node_modules/ejs/test/tmp/include_preprocessor.ejs delete mode 100644 node_modules/ejs/test/tmp/renderFile.ejs diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 8fb58a1..4c451e4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,30 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -24,164 +47,143 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -192,7 +194,6 @@ @@ -253,15 +255,44 @@ $PROJECT_DIR$/gulpfile.js + + + scripts + + + vendor + + + remote + + + styles + + + partials + + + index + + + clean + + + + + + default + + DEFINITION_ORDER @@ -288,6 +319,7 @@ + @@ -316,13 +348,12 @@ - @@ -332,7 +363,7 @@ - + @@ -352,134 +383,24 @@ - + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -519,7 +440,7 @@ - C:/Program Files/nodejs/node.exe + project @@ -563,19 +484,23 @@ + + + - + - - - + + + + @@ -606,14 +531,13 @@ - - - - 1438335954140 - 1438336477190 @@ -951,23 +875,29 @@ - - - + - - + + - - - - + + + @@ -979,6 +909,7 @@ + @@ -1045,26 +976,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -1118,13 +1029,6 @@ - - - - - - - @@ -1147,13 +1051,6 @@ - - - - - - - @@ -1162,14 +1059,14 @@ - - - + + + @@ -1189,14 +1086,6 @@ - - - - - - - - @@ -1222,13 +1111,6 @@ - - - - - - - @@ -1261,21 +1143,6 @@ - - - - - - - - - - - - - - - @@ -1286,10 +1153,10 @@ - + - - + + @@ -1302,26 +1169,26 @@ - + - - + + - + - - + + - + - - + + @@ -1342,26 +1209,42 @@ - - - - - - - - - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1371,23 +1254,116 @@ - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bare-news.js b/bare-news.js new file mode 100644 index 0000000..14739ae --- /dev/null +++ b/bare-news.js @@ -0,0 +1,85 @@ +var outputFile = 'news', RssBraider = require('rss-braider'), fs = require('fs'), ejs = require( + 'ejs'), read = require('fs').readFileSync, join = require('path').join, str = read( + join(__dirname, '/templates/rss.ejs'), + 'utf8'), feeds = {}; + +var log4js = require('log4js'); +var logger = log4js.getLogger(); + +// Pull feeds from config files: , +// feeds.simple_test_feed = require("./config/feed").feed; +// Or define in-line + +// filters 'filter_3_days', 'fix_images', 'fix_scripts' +feeds.simple_test_feed = { + "feed_name": "feed", + "default_count": 1, + "no_cdata_fields": [], // Don't wrap these fields in CDATA tags + "meta": { + "title": "News", + "description": "Combined News Feed", + 'site_url': 'http://pipes.silvrtree.co.uk/news.xml' + }, + "plugins": [ + 'filter_3_days', 'fix_images', 'fix_scripts' + ], + "sources": [ + { + "count": 100, + "feed_url": "http://www.telegraph.co.uk/news/rss.xml" + } + ] +} + +; +var braider_options = { + feeds: feeds, + indent: " ", + date_sort_order: "desc", // Newest first + log_level: "warn", + dedupe_fields: ['link', 'guid'], + plugins_directories: [__dirname + "/plugins/"] +}; +var rss_braider = RssBraider.createClient(braider_options); + +// Override logging level (debug, info, warn, err, off) +//rss_braider.logger.level('off'); + +rss_braider.processFeed('simple_test_feed', 'json', function(err, data) { + console.log('A'); + if (err) { + logger.error(err); + return err; + } + + console.log('B'); + + var j = JSON.parse(data); + + console.log('C'); + var ejsOutput = ejs.compile(str)(j); + + console.log('D'); + fs.writeFile(__dirname + "/dist/" + outputFile + ".html", + ejsOutput, + function(err) { + + if (err) { + logger.error(err); + return console.error(err); + } + + console.log("The file was saved!"); + }); + + fs.writeFile(__dirname + "/dist/" + outputFile + ".json", + data, + function(err) { + if (err) { + logger.error(err); + return console.error(err); + } + + console.log("The file was saved!"); + }); +}); diff --git a/fit.js b/fit.js index 0da611e..95ade2e 100644 --- a/fit.js +++ b/fit.js @@ -6,20 +6,43 @@ var outputFile = 'fit', RssBraider = require('rss-braider'), fs = require('fs'), // Pull feeds from config files: , // feeds.simple_test_feed = require("./config/feed").feed; // Or define in-line + +// filters + +// 'filter_last_week', 'fix_images', 'fix_scripts' + + feeds.simple_test_feed = { - "feed_name": "feed", "default_count": 1, "no_cdata_fields": [], // Don't wrap these fields in CDATA tags + "feed_name": "feed", "default_count": 1, "no_cdata_fields" : ['description'], // Don't wrap these fields in CDATA tags "meta": { "title": "Fitness", "description": "Combined Fitness Feed", 'site_url': 'http://pipes.silvrtree.co.uk/fit.xml' - }, "plugins": ['filter_last_week', 'fix_images', 'fix_scripts'], "sources": [ + }, "plugins": ['filter_last_week', 'fix_images', 'fix_scripts'], + + 'custom_namespaces' : { + "content" : "http://purl.org/rss/1.0/modules/content/", + "slash" : "http://purl.org/rss/1.0/modules/slash/", + "media" : "http://search.yahoo.com/mrss/", + "ev" : "http://purl.org/rss/2.0/modules/event/", + "sy" : "http://purl.org/rss/1.0/modules/syndication/", + "wfw" : "http://wellformedweb.org/CommentAPI/", + "dc" : "http://purl.org/dc/elements/1.1/", + "atom" : "http://www.w3.org/2005/Atom" + }, + + "sources": [ { "count": 100, "feed_url": "http://www.mensfitness.co.uk/feeds/all" - }, { + }, + + { "count": 100, "feed_url": "http://www.coachmag.co.uk/feeds/all" - }, { + }, + + { "count": 100, "feed_url": "http://muscleandbrawn.com/feed/" }, @@ -34,25 +57,21 @@ feeds.simple_test_feed = { "count": 100, "feed_url": "http://www.simplyshredded.com/feed" }, - { + /* { - "count": 100, "feed_url": "http://www.gym-talk.com/feed/" - }, + "count": 100, "feed_url": "http://www.gym-talk.com/feed" + },*/ { "count": 100, "feed_url": "http://www.bornfitness.com/feed/" }, - { - "count": 100, "feed_url": "http://breakingmuscle.com/uk/feed/rss" - }, + /*{ - { - - "count": 100, "feed_url": "http://breakingmuscle.com/uk/feed/wod.xml" - }, + "count": 100, "feed_url": "http://breakingmuscle.co.uk/uk/feed/rss" + },*/ { @@ -75,7 +94,7 @@ var braider_options = { feeds: feeds, indent: " ", date_sort_order: "desc", // Newest first - log_level: "warn", + log_level: "debug", dedupe_fields: ['link', 'guid'], plugins_directories: [__dirname + "/plugins/"] }; diff --git a/news.js b/news.js index 1f87652..6cbe728 100644 --- a/news.js +++ b/news.js @@ -13,7 +13,7 @@ var logger = log4js.getLogger(); feeds.simple_test_feed = { "feed_name": "feed", "default_count": 1, - "no_cdata_fields": [], // Don't wrap these fields in CDATA tags + "no_cdata_fields": ['description'], // Don't wrap these fields in CDATA tags "meta": { "title": "News", "description": "Combined News Feed", @@ -22,6 +22,16 @@ feeds.simple_test_feed = { "plugins": [ 'filter_3_days', 'fix_images', 'fix_scripts' ], + 'custom_namespaces' : { + "content" : "http://purl.org/rss/1.0/modules/content/", + "slash" : "http://purl.org/rss/1.0/modules/slash/", + "media" : "http://search.yahoo.com/mrss/", + "ev" : "http://purl.org/rss/2.0/modules/event/", + "sy" : "http://purl.org/rss/1.0/modules/syndication/", + "wfw" : "http://wellformedweb.org/CommentAPI/", + "dc" : "http://purl.org/dc/elements/1.1/", + "atom" : "http://www.w3.org/2005/Atom" + }, "sources": [ { "count": 100, @@ -91,11 +101,7 @@ feeds.simple_test_feed = { }, { "count": 100, - "feed_url": "http://www.telegraph.co.uk/newsfeed/rss/news-uk_news.xml" - }, - { - "count": 100, - "feed_url": "http://www.telegraph.co.uk/news/worldnews/rss" + "feed_url": "http://www.telegraph.co.uk/news/rss.xml" }, { "count": 100, diff --git a/node_modules/ejs/Jakefile b/node_modules/ejs/Jakefile index 0362e98..28defba 100644 --- a/node_modules/ejs/Jakefile +++ b/node_modules/ejs/Jakefile @@ -34,6 +34,7 @@ publishTask('ejs', ['build'], function () { this.packageFiles.include([ 'Jakefile' , 'README.md' + , 'LICENSE' , 'package.json' , 'ejs.js' , 'ejs.min.js' diff --git a/node_modules/ejs/README.md b/node_modules/ejs/README.md index 8d3dbbb..b88b7b4 100644 --- a/node_modules/ejs/README.md +++ b/node_modules/ejs/README.md @@ -14,7 +14,7 @@ $ npm install ejs ## Features * Control flow with `<% %>` - * Escaped output with `<%= %>` + * Escaped output with `<%= %>` (escape function configurable) * Unescaped raw output with `<%- %>` * Newline-trim mode ('newline slurping') with `-%>` ending tag * Whitespace-trim mode (slurp all whitespace) for control flow with `<%_ _%>` @@ -42,19 +42,28 @@ template(data); ejs.render(str, data, options); // => Rendered HTML string + +ejs.renderFile(filename, data, options, function(err, str){ + // str => Rendered HTML string +}); ``` -You can also use the shortcut `ejs.render(dataAndOptions);` where you pass +It is also possible to use `ejs.render(dataAndOptions);` where you pass everything in a single object. In that case, you'll end up with local variables -for all the passed options. +for all the passed options. However, be aware that your code could break if we +add an option with the same name as one of your data object's properties. +Therefore, we do not recommend using this shortcut. ## Options - `cache` Compiled functions are cached, requires `filename` - - `filename` Used by `cache` to key caches, and for includes + - `filename` The name of the file being rendered. Not required if you + are using `renderFile()`. Used by `cache` to key caches, and for includes. - `context` Function execution context - `compileDebug` When `false` no debug instrumentation is compiled - - `client` Returns standalone compiled function + - `client` When `true`, compiles a function that can be rendered + in the browser without needing to load the EJS Runtime + ([ejs.min.js](https://github.com/mde/ejs/releases/latest)). - `delimiter` Character to use with angle brackets for open/close - `debug` Output generated function body - `strict` When set to `true`, generated function is in strict mode @@ -64,23 +73,37 @@ for all the passed options. and trailing whitespace. It also enables a safer version of `-%>` line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line). + - `escape` The escaping function used with `<%=` construct. It is + used in rendering and is `.toString()`ed in the generation of client functions. (By default escapes XML). + +This project uses [JSDoc](http://usejsdoc.org/). For the full public API +documentation, clone the repository and run `npm run doc`. This will run JSDoc +with the proper options and output the documentation to `out/`. If you want +the both the public & private API docs, run `npm run devdoc` instead. ## Tags - `<%` 'Scriptlet' tag, for control-flow, no output - - `<%=` Outputs the value into the template (HTML escaped) + - `<%_` 'Whitespace Slurping' Scriptlet tag, strips all whitespace before it + - `<%=` Outputs the value into the template (escaped) - `<%-` Outputs the unescaped value into the template - `<%#` Comment tag, no execution, no output - `<%%` Outputs a literal '<%' - `%>` Plain ending tag - `-%>` Trim-mode ('newline slurp') tag, trims following newline + - `_%>` 'Whitespace Slurping' ending tag, removes all whitespace after it + +For the full syntax documentation, please see [docs/syntax.md](https://github.com/mde/ejs/blob/master/docs/syntax.md). ## Includes Includes either have to be an absolute path, or, if not, are assumed as -relative to the template with the `include` call. (This requires the -`filename` option.) For example if you are including `./views/user/show.ejs` -from `./views/users.ejs` you would use `<%- include('user/show') %>`. +relative to the template with the `include` call. For example if you are +including `./views/user/show.ejs` from `./views/users.ejs` you would +use `<%- include('user/show') %>`. + +You must specify the `filename` option for the template with the `include` +call unless you are using `renderFile()`. You'll likely want to use the raw output tag (`<%-`) with your include to avoid double-escaping the HTML output. @@ -155,9 +178,44 @@ including headers and footers, like so: ## Client-side support Go to the [Latest Release](https://github.com/mde/ejs/releases/latest), download -`./ejs.js` or `./ejs.min.js`. +`./ejs.js` or `./ejs.min.js`. Alternately, you can compile it yourself by cloning +the repository and running `jake build` (or `$(npm bin)/jake build` if jake is +not installed globally). -Include one of these on your page, and `ejs.render(str)`. +Include one of these files on your page, and `ejs` should be available globally. + +### Example + +```html +
+ + +``` + +### Caveats + +Most of EJS will work as expected; however, there are a few things to note: + +1. Obviously, since you do not have access to the filesystem, `ejs.renderFile()` won't work. +2. For the same reason, `include`s do not work unless you use an `IncludeCallback`. Here is an example: + ```javascript + var str = "Hello <%= include('file', {person: 'John'}); %>", + fn = ejs.compile(str, {client: true}); + + fn(data, null, function(path, d){ // IncludeCallback + // path -> 'file' + // d -> {person: 'John'} + // Put your code here + // Return the contents of file as a string + }); // returns rendered string + ``` ## Related projects diff --git a/node_modules/ejs/ejs.js b/node_modules/ejs/ejs.js index bdd07ff..4b87155 100644 --- a/node_modules/ejs/ejs.js +++ b/node_modules/ejs/ejs.js @@ -524,6 +524,10 @@ Template.prototype = { , d = this.opts.delimiter; if (matches && matches.length) { + if (this.opts.compileDebug && this.opts.filename) { + this.source = ' ; __lines = ' + JSON.stringify(this.templateText) + '\n'; + this.source += ' ; __filename = "' + this.opts.filename.replace(/\\/g, '/') + '"\n'; + } matches.forEach(function (line, index) { var opening , closing @@ -708,6 +712,12 @@ Template.prototype = { } }; +/* + * Export the internal function for escaping XML so people + * can use for manual escaping if needed + * */ +exports.escapeXML = utils.escapeXML; + /** * Express.js support. * @@ -1159,6 +1169,7 @@ process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues +process.versions = {}; function noop() {} @@ -1190,7 +1201,7 @@ module.exports={ "engine", "ejs" ], - "version": "2.4.0", + "version": "2.4.1", "author": "Matthew Eernisse (http://fleegix.org)", "contributors": [ "Timothy Gu (https://timothygu.github.io)" @@ -1219,10 +1230,10 @@ module.exports={ }, "scripts": { "test": "mocha", + "sample": "npm install express && node sample/index.js", "coverage": "istanbul cover node_modules/mocha/bin/_mocha", "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*", "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*" } } - },{}]},{},[1]); diff --git a/node_modules/ejs/ejs.min.js b/node_modules/ejs/ejs.min.js index 334d919..46f5b39 100644 --- a/node_modules/ejs/ejs.min.js +++ b/node_modules/ejs/ejs.min.js @@ -1 +1 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o|-%>|_%>)",_OPTS=["cache","filename","delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","localsName"],_TRAILING_SEMCOL=/;\s*$/,_BOM=/^\uFEFF/;exports.cache=utils.cache;exports.localsName=_DEFAULT_LOCALS_NAME;exports.resolveInclude=function(name,filename){var path=require("path"),dirname=path.dirname,extname=path.extname,resolve=path.resolve,includePath=resolve(dirname(filename),name),ext=extname(name);if(!ext){includePath+=".ejs"}return includePath};function handleCache(options,template){var fn,path=options.filename,hasTemplate=arguments.length>1;if(options.cache){if(!path){throw new Error("cache option requires a filename")}fn=exports.cache.get(path);if(fn){return fn}if(!hasTemplate){template=fs.readFileSync(path).toString().replace(_BOM,"")}}else if(!hasTemplate){if(!path){throw new Error("Internal EJS error: no file name or template "+"provided")}template=fs.readFileSync(path).toString().replace(_BOM,"")}fn=exports.compile(template,options);if(options.cache){exports.cache.set(path,fn)}return fn}function includeFile(path,options){var opts=utils.shallowCopy({},options);if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}opts.filename=exports.resolveInclude(path,opts.filename);return handleCache(opts)}function includeSource(path,options){var opts=utils.shallowCopy({},options),includePath,template;if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}includePath=exports.resolveInclude(path,opts.filename);template=fs.readFileSync(includePath).toString().replace(_BOM,"");opts.filename=includePath;var templ=new Template(template,opts);templ.generateSource();return templ.source}function rethrow(err,str,filename,lineno){var lines=str.split("\n"),start=Math.max(lineno-3,0),end=Math.min(lines.length,lineno+3);var context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" >> ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"ejs")+":"+lineno+"\n"+context+"\n\n"+err.message;throw err}function cpOptsInData(data,opts){_OPTS.forEach(function(p){if(typeof data[p]!="undefined"){opts[p]=data[p]}})}exports.compile=function compile(template,opts){var templ;if(opts&&opts.scope){if(!scopeOptionWarned){console.warn("`scope` option is deprecated and will be removed in EJS 3");scopeOptionWarned=true}if(!opts.context){opts.context=opts.scope}delete opts.scope}templ=new Template(template,opts);return templ.compile()};exports.render=function(template,data,opts){data=data||{};opts=opts||{};var fn;if(arguments.length==2){cpOptsInData(data,opts)}return handleCache(opts,template)(data)};exports.renderFile=function(){var args=Array.prototype.slice.call(arguments),path=args.shift(),cb=args.pop(),data=args.shift()||{},opts=args.pop()||{},result;opts=utils.shallowCopy({},opts);if(arguments.length==3){if(data.settings&&data.settings["view options"]){cpOptsInData(data.settings["view options"],opts)}else{cpOptsInData(data,opts)}}opts.filename=path;try{result=handleCache(opts)(data)}catch(err){return cb(err)}return cb(null,result)};exports.clearCache=function(){exports.cache.reset()};function Template(text,opts){opts=opts||{};var options={};this.templateText=text;this.mode=null;this.truncate=false;this.currentLine=1;this.source="";this.dependencies=[];options.client=opts.client||false;options.escapeFunction=opts.escape||utils.escapeXML;options.compileDebug=opts.compileDebug!==false;options.debug=!!opts.debug;options.filename=opts.filename;options.delimiter=opts.delimiter||exports.delimiter||_DEFAULT_DELIMITER;options.strict=opts.strict||false;options.context=opts.context;options.cache=opts.cache||false;options.rmWhitespace=opts.rmWhitespace;options.localsName=opts.localsName||exports.localsName||_DEFAULT_LOCALS_NAME;if(options.strict){options._with=false}else{options._with=typeof opts._with!="undefined"?opts._with:true}this.opts=options;this.regex=this.createRegex()}Template.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};Template.prototype={createRegex:function(){var str=_REGEX_STRING,delim=utils.escapeRegExpChars(this.opts.delimiter);str=str.replace(/%/g,delim);return new RegExp(str)},compile:function(){var src,fn,opts=this.opts,prepended="",appended="",escape=opts.escapeFunction;if(opts.rmWhitespace){this.templateText=this.templateText.replace(/\r/g,"").replace(/^\s+|\s+$/gm,"")}this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");if(!this.source){this.generateSource();prepended+=" var __output = [], __append = __output.push.bind(__output);"+"\n";if(opts._with!==false){prepended+=" with ("+opts.localsName+" || {}) {"+"\n";appended+=" }"+"\n"}appended+=' return __output.join("");'+"\n";this.source=prepended+this.source+appended}if(opts.compileDebug){src="var __line = 1"+"\n"+" , __lines = "+JSON.stringify(this.templateText)+"\n"+" , __filename = "+(opts.filename?JSON.stringify(opts.filename):"undefined")+";"+"\n"+"try {"+"\n"+this.source+"} catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line);"+"\n"+"}"+"\n"}else{src=this.source}if(opts.debug){console.log(src)}if(opts.client){src="escape = escape || "+escape.toString()+";"+"\n"+src;if(opts.compileDebug){src="rethrow = rethrow || "+rethrow.toString()+";"+"\n"+src}}if(opts.strict){src='"use strict";\n'+src}try{fn=new Function(opts.localsName+", escape, include, rethrow",src)}catch(e){if(e instanceof SyntaxError){if(opts.filename){e.message+=" in "+opts.filename}e.message+=" while compiling ejs"}throw e}if(opts.client){fn.dependencies=this.dependencies;return fn}var returnedFn=function(data){var include=function(path,includeData){var d=utils.shallowCopy({},data);if(includeData){d=utils.shallowCopy(d,includeData)}return includeFile(path,opts)(d)};return fn.apply(opts.context,[data||{},escape,include,rethrow])};returnedFn.dependencies=this.dependencies;return returnedFn},generateSource:function(){var self=this,matches=this.parseTemplateText(),d=this.opts.delimiter;if(matches&&matches.length){matches.forEach(function(line,index){var opening,closing,include,includeOpts,includeSrc;if(line.indexOf("<"+d)===0&&line.indexOf("<"+d+d)!==0){closing=matches[index+2];if(!(closing==d+">"||closing=="-"+d+">"||closing=="_"+d+">")){throw new Error('Could not find matching close tag for "'+line+'".')}}if(include=line.match(/^\s*include\s+(\S+)/)){opening=matches[index-1];if(opening&&(opening=="<"+d||opening=="<"+d+"-"||opening=="<"+d+"_")){includeOpts=utils.shallowCopy({},self.opts);includeSrc=includeSource(include[1],includeOpts);includeSrc=" ; (function(){"+"\n"+includeSrc+" ; })()"+"\n";self.source+=includeSrc;self.dependencies.push(exports.resolveInclude(include[1],includeOpts.filename));return}}self.scanLine(line)})}},parseTemplateText:function(){var str=this.templateText,pat=this.regex,result=pat.exec(str),arr=[],firstPos,lastPos;while(result){firstPos=result.index;lastPos=pat.lastIndex;if(firstPos!==0){arr.push(str.substring(0,firstPos));str=str.slice(firstPos)}arr.push(result[0]);str=str.slice(result[0].length);result=pat.exec(str)}if(str){arr.push(str)}return arr},scanLine:function(line){var self=this,d=this.opts.delimiter,newLineCount=0;function _addOutput(){if(self.truncate){line=line.replace(/^(?:\r\n|\r|\n)/,"");self.truncate=false}else if(self.opts.rmWhitespace){line=line.replace(/^\n/,"")}if(!line){return}line=line.replace(/\\/g,"\\\\");line=line.replace(/\n/g,"\\n");line=line.replace(/\r/g,"\\r");line=line.replace(/"/g,'\\"');self.source+=' ; __append("'+line+'")'+"\n"}newLineCount=line.split("\n").length-1;switch(line){case"<"+d:case"<"+d+"_":this.mode=Template.modes.EVAL;break;case"<"+d+"=":this.mode=Template.modes.ESCAPED;break;case"<"+d+"-":this.mode=Template.modes.RAW;break;case"<"+d+"#":this.mode=Template.modes.COMMENT;break;case"<"+d+d:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+line.replace("<"+d+d,"<"+d)+'")'+"\n";break;case d+">":case"-"+d+">":case"_"+d+">":if(this.mode==Template.modes.LITERAL){_addOutput()}this.mode=null;this.truncate=line.indexOf("-")===0||line.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case Template.modes.EVAL:case Template.modes.ESCAPED:case Template.modes.RAW:if(line.lastIndexOf("//")>line.lastIndexOf("\n")){line+="\n"}}switch(this.mode){case Template.modes.EVAL:this.source+=" ; "+line+"\n";break;case Template.modes.ESCAPED:this.source+=" ; __append(escape("+line.replace(_TRAILING_SEMCOL,"").trim()+"))"+"\n";break;case Template.modes.RAW:this.source+=" ; __append("+line.replace(_TRAILING_SEMCOL,"").trim()+")"+"\n";break;case Template.modes.COMMENT:break;case Template.modes.LITERAL:_addOutput();break}}else{_addOutput()}}if(self.opts.compileDebug&&newLineCount){this.currentLine+=newLineCount;this.source+=" ; __line = "+this.currentLine+"\n"}}};exports.__express=exports.renderFile;if(require.extensions){require.extensions[".ejs"]=function(module,filename){filename=filename||module.filename;var options={filename:filename,client:true},template=fs.readFileSync(filename).toString(),fn=exports.compile(template,options);module._compile("module.exports = "+fn.toString()+";",filename)}}exports.VERSION=_VERSION_STRING;if(typeof window!="undefined"){window.ejs=exports}},{"../package.json":6,"./utils":2,fs:3,path:4}],2:[function(require,module,exports){"use strict";var regExpChars=/[|\\{}()[\]^$+*?.]/g;exports.escapeRegExpChars=function(string){if(!string){return""}return String(string).replace(regExpChars,"\\$&")};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>\'"]/g;function encode_char(c){return _ENCODE_HTML_RULES[c]||c}var escapeFuncStr="var _ENCODE_HTML_RULES = {\n"+' "&": "&"\n'+' , "<": "<"\n'+' , ">": ">"\n'+' , \'"\': """\n'+' , "\'": "'"\n'+" }\n"+" , _MATCH_HTML = /[&<>'\"]/g;\n"+"function encode_char(c) {\n"+" return _ENCODE_HTML_RULES[c] || c;\n"+"};\n";exports.escapeXML=function(markup){return markup==undefined?"":String(markup).replace(_MATCH_HTML,encode_char)};exports.escapeXML.toString=function(){return Function.prototype.toString.call(this)+";\n"+escapeFuncStr};exports.shallowCopy=function(to,from){from=from||{};for(var p in from){to[p]=from[p]}return to};exports.cache={_data:{},set:function(key,val){this._data[key]=val},get:function(key){return this._data[key]},reset:function(){this._data={}}}},{}],3:[function(require,module,exports){},{}],4:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i (http://fleegix.org)",contributors:["Timothy Gu (https://timothygu.github.io)"],license:"Apache-2.0",main:"./lib/ejs.js",repository:{type:"git",url:"git://github.com/mde/ejs.git"},bugs:"https://github.com/mde/ejs/issues",homepage:"https://github.com/mde/ejs",dependencies:{},devDependencies:{browserify:"^8.0.3",istanbul:"~0.3.5",jake:"^8.0.0",jsdoc:"^3.3.0-beta1","lru-cache":"^2.5.0",mocha:"^2.1.0",rimraf:"^2.2.8","uglify-js":"^2.4.16"},engines:{node:">=0.10.0"},scripts:{test:"mocha",coverage:"istanbul cover node_modules/mocha/bin/_mocha",doc:"rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",devdoc:"rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"}}},{}]},{},[1]); \ No newline at end of file +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o|-%>|_%>)",_OPTS=["cache","filename","delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","localsName"],_TRAILING_SEMCOL=/;\s*$/,_BOM=/^\uFEFF/;exports.cache=utils.cache;exports.localsName=_DEFAULT_LOCALS_NAME;exports.resolveInclude=function(name,filename){var path=require("path"),dirname=path.dirname,extname=path.extname,resolve=path.resolve,includePath=resolve(dirname(filename),name),ext=extname(name);if(!ext){includePath+=".ejs"}return includePath};function handleCache(options,template){var fn,path=options.filename,hasTemplate=arguments.length>1;if(options.cache){if(!path){throw new Error("cache option requires a filename")}fn=exports.cache.get(path);if(fn){return fn}if(!hasTemplate){template=fs.readFileSync(path).toString().replace(_BOM,"")}}else if(!hasTemplate){if(!path){throw new Error("Internal EJS error: no file name or template "+"provided")}template=fs.readFileSync(path).toString().replace(_BOM,"")}fn=exports.compile(template,options);if(options.cache){exports.cache.set(path,fn)}return fn}function includeFile(path,options){var opts=utils.shallowCopy({},options);if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}opts.filename=exports.resolveInclude(path,opts.filename);return handleCache(opts)}function includeSource(path,options){var opts=utils.shallowCopy({},options),includePath,template;if(!opts.filename){throw new Error("`include` requires the 'filename' option.")}includePath=exports.resolveInclude(path,opts.filename);template=fs.readFileSync(includePath).toString().replace(_BOM,"");opts.filename=includePath;var templ=new Template(template,opts);templ.generateSource();return templ.source}function rethrow(err,str,filename,lineno){var lines=str.split("\n"),start=Math.max(lineno-3,0),end=Math.min(lines.length,lineno+3);var context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" >> ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"ejs")+":"+lineno+"\n"+context+"\n\n"+err.message;throw err}function cpOptsInData(data,opts){_OPTS.forEach(function(p){if(typeof data[p]!="undefined"){opts[p]=data[p]}})}exports.compile=function compile(template,opts){var templ;if(opts&&opts.scope){if(!scopeOptionWarned){console.warn("`scope` option is deprecated and will be removed in EJS 3");scopeOptionWarned=true}if(!opts.context){opts.context=opts.scope}delete opts.scope}templ=new Template(template,opts);return templ.compile()};exports.render=function(template,data,opts){data=data||{};opts=opts||{};var fn;if(arguments.length==2){cpOptsInData(data,opts)}return handleCache(opts,template)(data)};exports.renderFile=function(){var args=Array.prototype.slice.call(arguments),path=args.shift(),cb=args.pop(),data=args.shift()||{},opts=args.pop()||{},result;opts=utils.shallowCopy({},opts);if(arguments.length==3){if(data.settings&&data.settings["view options"]){cpOptsInData(data.settings["view options"],opts)}else{cpOptsInData(data,opts)}}opts.filename=path;try{result=handleCache(opts)(data)}catch(err){return cb(err)}return cb(null,result)};exports.clearCache=function(){exports.cache.reset()};function Template(text,opts){opts=opts||{};var options={};this.templateText=text;this.mode=null;this.truncate=false;this.currentLine=1;this.source="";this.dependencies=[];options.client=opts.client||false;options.escapeFunction=opts.escape||utils.escapeXML;options.compileDebug=opts.compileDebug!==false;options.debug=!!opts.debug;options.filename=opts.filename;options.delimiter=opts.delimiter||exports.delimiter||_DEFAULT_DELIMITER;options.strict=opts.strict||false;options.context=opts.context;options.cache=opts.cache||false;options.rmWhitespace=opts.rmWhitespace;options.localsName=opts.localsName||exports.localsName||_DEFAULT_LOCALS_NAME;if(options.strict){options._with=false}else{options._with=typeof opts._with!="undefined"?opts._with:true}this.opts=options;this.regex=this.createRegex()}Template.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};Template.prototype={createRegex:function(){var str=_REGEX_STRING,delim=utils.escapeRegExpChars(this.opts.delimiter);str=str.replace(/%/g,delim);return new RegExp(str)},compile:function(){var src,fn,opts=this.opts,prepended="",appended="",escape=opts.escapeFunction;if(opts.rmWhitespace){this.templateText=this.templateText.replace(/\r/g,"").replace(/^\s+|\s+$/gm,"")}this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");if(!this.source){this.generateSource();prepended+=" var __output = [], __append = __output.push.bind(__output);"+"\n";if(opts._with!==false){prepended+=" with ("+opts.localsName+" || {}) {"+"\n";appended+=" }"+"\n"}appended+=' return __output.join("");'+"\n";this.source=prepended+this.source+appended}if(opts.compileDebug){src="var __line = 1"+"\n"+" , __lines = "+JSON.stringify(this.templateText)+"\n"+" , __filename = "+(opts.filename?JSON.stringify(opts.filename):"undefined")+";"+"\n"+"try {"+"\n"+this.source+"} catch (e) {"+"\n"+" rethrow(e, __lines, __filename, __line);"+"\n"+"}"+"\n"}else{src=this.source}if(opts.debug){console.log(src)}if(opts.client){src="escape = escape || "+escape.toString()+";"+"\n"+src;if(opts.compileDebug){src="rethrow = rethrow || "+rethrow.toString()+";"+"\n"+src}}if(opts.strict){src='"use strict";\n'+src}try{fn=new Function(opts.localsName+", escape, include, rethrow",src)}catch(e){if(e instanceof SyntaxError){if(opts.filename){e.message+=" in "+opts.filename}e.message+=" while compiling ejs"}throw e}if(opts.client){fn.dependencies=this.dependencies;return fn}var returnedFn=function(data){var include=function(path,includeData){var d=utils.shallowCopy({},data);if(includeData){d=utils.shallowCopy(d,includeData)}return includeFile(path,opts)(d)};return fn.apply(opts.context,[data||{},escape,include,rethrow])};returnedFn.dependencies=this.dependencies;return returnedFn},generateSource:function(){var self=this,matches=this.parseTemplateText(),d=this.opts.delimiter;if(matches&&matches.length){if(this.opts.compileDebug&&this.opts.filename){this.source=" ; __lines = "+JSON.stringify(this.templateText)+"\n";this.source+=' ; __filename = "'+this.opts.filename.replace(/\\/g,"/")+'"\n'}matches.forEach(function(line,index){var opening,closing,include,includeOpts,includeSrc;if(line.indexOf("<"+d)===0&&line.indexOf("<"+d+d)!==0){closing=matches[index+2];if(!(closing==d+">"||closing=="-"+d+">"||closing=="_"+d+">")){throw new Error('Could not find matching close tag for "'+line+'".')}}if(include=line.match(/^\s*include\s+(\S+)/)){opening=matches[index-1];if(opening&&(opening=="<"+d||opening=="<"+d+"-"||opening=="<"+d+"_")){includeOpts=utils.shallowCopy({},self.opts);includeSrc=includeSource(include[1],includeOpts);includeSrc=" ; (function(){"+"\n"+includeSrc+" ; })()"+"\n";self.source+=includeSrc;self.dependencies.push(exports.resolveInclude(include[1],includeOpts.filename));return}}self.scanLine(line)})}},parseTemplateText:function(){var str=this.templateText,pat=this.regex,result=pat.exec(str),arr=[],firstPos,lastPos;while(result){firstPos=result.index;lastPos=pat.lastIndex;if(firstPos!==0){arr.push(str.substring(0,firstPos));str=str.slice(firstPos)}arr.push(result[0]);str=str.slice(result[0].length);result=pat.exec(str)}if(str){arr.push(str)}return arr},scanLine:function(line){var self=this,d=this.opts.delimiter,newLineCount=0;function _addOutput(){if(self.truncate){line=line.replace(/^(?:\r\n|\r|\n)/,"");self.truncate=false}else if(self.opts.rmWhitespace){line=line.replace(/^\n/,"")}if(!line){return}line=line.replace(/\\/g,"\\\\");line=line.replace(/\n/g,"\\n");line=line.replace(/\r/g,"\\r");line=line.replace(/"/g,'\\"');self.source+=' ; __append("'+line+'")'+"\n"}newLineCount=line.split("\n").length-1;switch(line){case"<"+d:case"<"+d+"_":this.mode=Template.modes.EVAL;break;case"<"+d+"=":this.mode=Template.modes.ESCAPED;break;case"<"+d+"-":this.mode=Template.modes.RAW;break;case"<"+d+"#":this.mode=Template.modes.COMMENT;break;case"<"+d+d:this.mode=Template.modes.LITERAL;this.source+=' ; __append("'+line.replace("<"+d+d,"<"+d)+'")'+"\n";break;case d+">":case"-"+d+">":case"_"+d+">":if(this.mode==Template.modes.LITERAL){_addOutput()}this.mode=null;this.truncate=line.indexOf("-")===0||line.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case Template.modes.EVAL:case Template.modes.ESCAPED:case Template.modes.RAW:if(line.lastIndexOf("//")>line.lastIndexOf("\n")){line+="\n"}}switch(this.mode){case Template.modes.EVAL:this.source+=" ; "+line+"\n";break;case Template.modes.ESCAPED:this.source+=" ; __append(escape("+line.replace(_TRAILING_SEMCOL,"").trim()+"))"+"\n";break;case Template.modes.RAW:this.source+=" ; __append("+line.replace(_TRAILING_SEMCOL,"").trim()+")"+"\n";break;case Template.modes.COMMENT:break;case Template.modes.LITERAL:_addOutput();break}}else{_addOutput()}}if(self.opts.compileDebug&&newLineCount){this.currentLine+=newLineCount;this.source+=" ; __line = "+this.currentLine+"\n"}}};exports.escapeXML=utils.escapeXML;exports.__express=exports.renderFile;if(require.extensions){require.extensions[".ejs"]=function(module,filename){filename=filename||module.filename;var options={filename:filename,client:true},template=fs.readFileSync(filename).toString(),fn=exports.compile(template,options);module._compile("module.exports = "+fn.toString()+";",filename)}}exports.VERSION=_VERSION_STRING;if(typeof window!="undefined"){window.ejs=exports}},{"../package.json":6,"./utils":2,fs:3,path:4}],2:[function(require,module,exports){"use strict";var regExpChars=/[|\\{}()[\]^$+*?.]/g;exports.escapeRegExpChars=function(string){if(!string){return""}return String(string).replace(regExpChars,"\\$&")};var _ENCODE_HTML_RULES={"&":"&","<":"<",">":">",'"':""","'":"'"},_MATCH_HTML=/[&<>\'"]/g;function encode_char(c){return _ENCODE_HTML_RULES[c]||c}var escapeFuncStr="var _ENCODE_HTML_RULES = {\n"+' "&": "&"\n'+' , "<": "<"\n'+' , ">": ">"\n'+' , \'"\': """\n'+' , "\'": "'"\n'+" }\n"+" , _MATCH_HTML = /[&<>'\"]/g;\n"+"function encode_char(c) {\n"+" return _ENCODE_HTML_RULES[c] || c;\n"+"};\n";exports.escapeXML=function(markup){return markup==undefined?"":String(markup).replace(_MATCH_HTML,encode_char)};exports.escapeXML.toString=function(){return Function.prototype.toString.call(this)+";\n"+escapeFuncStr};exports.shallowCopy=function(to,from){from=from||{};for(var p in from){to[p]=from[p]}return to};exports.cache={_data:{},set:function(key,val){this._data[key]=val},get:function(key){return this._data[key]},reset:function(){this._data={}}}},{}],3:[function(require,module,exports){},{}],4:[function(require,module,exports){(function(process){function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var splitPath=function(filename){return splitPathRe.exec(filename).slice(1)};exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=exports.isAbsolute(path),trailingSlash=substr(path,-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.isAbsolute=function(path){return path.charAt(0)==="/"};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){if(typeof p!=="string"){throw new TypeError("Arguments to path.join must be strings")}return p}).join("/"))};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i (http://fleegix.org)",contributors:["Timothy Gu (https://timothygu.github.io)"],license:"Apache-2.0",main:"./lib/ejs.js",repository:{type:"git",url:"git://github.com/mde/ejs.git"},bugs:"https://github.com/mde/ejs/issues",homepage:"https://github.com/mde/ejs",dependencies:{},devDependencies:{browserify:"^8.0.3",istanbul:"~0.3.5",jake:"^8.0.0",jsdoc:"^3.3.0-beta1","lru-cache":"^2.5.0",mocha:"^2.1.0",rimraf:"^2.2.8","uglify-js":"^2.4.16"},engines:{node:">=0.10.0"},scripts:{test:"mocha",sample:"npm install express && node sample/index.js",coverage:"istanbul cover node_modules/mocha/bin/_mocha",doc:"rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*",devdoc:"rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*"}}},{}]},{},[1]); diff --git a/node_modules/ejs/lib/ejs.js b/node_modules/ejs/lib/ejs.js index 7704ed1..c0566a6 100644 --- a/node_modules/ejs/lib/ejs.js +++ b/node_modules/ejs/lib/ejs.js @@ -523,6 +523,10 @@ Template.prototype = { , d = this.opts.delimiter; if (matches && matches.length) { + if (this.opts.compileDebug && this.opts.filename) { + this.source = ' ; __lines = ' + JSON.stringify(this.templateText) + '\n'; + this.source += ' ; __filename = "' + this.opts.filename.replace(/\\/g, '/') + '"\n'; + } matches.forEach(function (line, index) { var opening , closing @@ -707,6 +711,12 @@ Template.prototype = { } }; +/* + * Export the internal function for escaping XML so people + * can use for manual escaping if needed + * */ +exports.escapeXML = utils.escapeXML; + /** * Express.js support. * diff --git a/node_modules/ejs/package.json b/node_modules/ejs/package.json index e2212e1..8b0c0e9 100644 --- a/node_modules/ejs/package.json +++ b/node_modules/ejs/package.json @@ -2,20 +2,24 @@ "_args": [ [ "ejs@*", - "C:\\mddev\\rinser" + "/Users/martin/newdev/Rinser" ] ], "_from": "ejs@*", - "_id": "ejs@2.4.1", + "_id": "ejs@2.4.2", "_inCache": true, "_installable": true, "_location": "/ejs", - "_nodeVersion": "0.12.4", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/ejs-2.4.2.tgz_1464117640663_0.8193834638223052" + }, "_npmUser": { "email": "mde@fleegix.org", "name": "mde" }, - "_npmVersion": "2.10.1", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { "name": "ejs", @@ -28,11 +32,11 @@ "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/ejs/-/ejs-2.4.1.tgz", - "_shasum": "82e15b1b2a1f948b18097476ba2bd7c66f4d1566", + "_resolved": "http://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz", + "_shasum": "7057eb4812958fb731841cd9ca353343efe597b1", "_shrinkwrap": null, "_spec": "ejs@*", - "_where": "C:\\mddev\\rinser", + "_where": "/Users/martin/newdev/Rinser", "author": { "email": "mde@fleegix.org", "name": "Matthew Eernisse", @@ -62,8 +66,8 @@ }, "directories": {}, "dist": { - "shasum": "82e15b1b2a1f948b18097476ba2bd7c66f4d1566", - "tarball": "http://registry.npmjs.org/ejs/-/ejs-2.4.1.tgz" + "shasum": "7057eb4812958fb731841cd9ca353343efe597b1", + "tarball": "https://registry.npmjs.org/ejs/-/ejs-2.4.2.tgz" }, "engines": { "node": ">=0.10.0" @@ -97,7 +101,8 @@ "coverage": "istanbul cover node_modules/mocha/bin/_mocha", "devdoc": "rimraf out && jsdoc -p -c jsdoc.json lib/* docs/jsdoc/*", "doc": "rimraf out && jsdoc -c jsdoc.json lib/* docs/jsdoc/*", + "sample": "npm install express && node sample/index.js", "test": "mocha" }, - "version": "2.4.1" + "version": "2.4.2" } diff --git a/node_modules/ejs/test/ejs.js b/node_modules/ejs/test/ejs.js index fdcc957..1baf07f 100644 --- a/node_modules/ejs/test/ejs.js +++ b/node_modules/ejs/test/ejs.js @@ -135,6 +135,32 @@ suite('ejs.compile(str, options)', function () { // There could be a `rethrow` in the function declaration assert((fn.toString().match(/rethrow/g) || []).length <= 1); }); + + test('support custom escape function', function () { + var customEscape + , fn; + customEscape = function customEscape(str) { + return !str ? '' : str.toUpperCase(); + }; + fn = ejs.compile('HELLO <%= name %>', {escape: customEscape}); + assert.equal(fn({name: 'world'}), 'HELLO WORLD'); + }); + + test('support custom escape function in client mode', function () { + var customEscape + , fn + , str; + customEscape = function customEscape(str) { + return !str ? '' : str.toUpperCase(); + }; + fn = ejs.compile('HELLO <%= name %>', {escape: customEscape, client: true}); + str = fn.toString(); + if (!process.env.running_under_istanbul) { + eval('var preFn = ' + str); + assert.equal(preFn({name: 'world'}), 'HELLO WORLD'); + } + }); + }); suite('ejs.render(str, data, opts)', function () { @@ -460,6 +486,18 @@ suite('<%=', function () { assert.equal(ejs.render('<%= name %>', {name: '&foo_bar;'}), '&foo_bar;'); }); + + test('should accept custom function', function() { + + var customEscape = function customEscape(str) { + return !str ? '' : str.toUpperCase(); + }; + + assert.equal( + ejs.render('<%= name %>', {name: 'The Jones\'s'}, {escape: customEscape}), + 'THE JONES\'S' + ); + }); }); suite('<%-', function () { diff --git a/node_modules/ejs/test/tmp/include.ejs b/node_modules/ejs/test/tmp/include.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/include.ejs +++ /dev/null @@ -1 +0,0 @@ -

New

\ No newline at end of file diff --git a/node_modules/ejs/test/tmp/include_preprocessor.ejs b/node_modules/ejs/test/tmp/include_preprocessor.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/include_preprocessor.ejs +++ /dev/null @@ -1 +0,0 @@ -

New

\ No newline at end of file diff --git a/node_modules/ejs/test/tmp/renderFile.ejs b/node_modules/ejs/test/tmp/renderFile.ejs deleted file mode 100644 index 595b6c0..0000000 --- a/node_modules/ejs/test/tmp/renderFile.ejs +++ /dev/null @@ -1 +0,0 @@ -

New

\ No newline at end of file diff --git a/node_modules/express/package.json b/node_modules/express/package.json index 249f157..0f036b7 100644 --- a/node_modules/express/package.json +++ b/node_modules/express/package.json @@ -2,7 +2,7 @@ "_args": [ [ "express@^4.13.4", - "C:\\mddev\\rinser" + "/Users/martin/newdev/Rinser" ] ], "_from": "express@>=4.13.4 <5.0.0", @@ -16,7 +16,7 @@ }, "_npmVersion": "1.4.28", "_phantomChildren": { - "mime-types": "2.1.10" + "mime-types": "2.1.11" }, "_requested": { "name": "express", @@ -29,11 +29,11 @@ "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/express/-/express-4.13.4.tgz", + "_resolved": "http://registry.npmjs.org/express/-/express-4.13.4.tgz", "_shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24", "_shrinkwrap": null, "_spec": "express@^4.13.4", - "_where": "C:\\mddev\\rinser", + "_where": "/Users/martin/newdev/Rinser", "author": { "email": "tj@vision-media.ca", "name": "TJ Holowaychuk" @@ -121,7 +121,7 @@ "directories": {}, "dist": { "shasum": "3c0b76f3c77590c8345739061ec0bd3ba067ec24", - "tarball": "http://registry.npmjs.org/express/-/express-4.13.4.tgz" + "tarball": "https://registry.npmjs.org/express/-/express-4.13.4.tgz" }, "engines": { "node": ">= 0.10.0" diff --git a/node_modules/lodash/README.md b/node_modules/lodash/README.md index 5990a70..59cc860 100644 --- a/node_modules/lodash/README.md +++ b/node_modules/lodash/README.md @@ -1,4 +1,4 @@ -# lodash v4.11.1 +# lodash v4.13.1 The [Lodash](https://lodash.com/) library exported as [Node.js](https://nodejs.org/) modules. @@ -28,13 +28,13 @@ var chunk = require('lodash/chunk'); var extend = require('lodash/fp/extend'); ``` -See the [package source](https://github.com/lodash/lodash/tree/4.11.1-npm) for more details. +See the [package source](https://github.com/lodash/lodash/tree/4.13.1-npm) for more details. **Note:**
-Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL.
+Don’t assign values to the [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` in the Node.js < 6 REPL.
Install [n_](https://www.npmjs.com/package/n_) for a REPL that includes `lodash` by default. ## Support -Tested in Chrome 48-49, Firefox 44-45, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10, 0.12, 4, & 5, & PhantomJS 1.9.8.
+Tested in Chrome 49-50, Firefox 45-46, IE 9-11, Edge 13, Safari 8-9, Node.js 0.10-6, & PhantomJS 1.9.8.
Automated [browser](https://saucelabs.com/u/lodash) & [CI](https://travis-ci.org/lodash/lodash/) test runs are available. diff --git a/node_modules/lodash/array.js b/node_modules/lodash/array.js index 06eda29..af688d3 100644 --- a/node_modules/lodash/array.js +++ b/node_modules/lodash/array.js @@ -12,6 +12,7 @@ module.exports = { 'fill': require('./fill'), 'findIndex': require('./findIndex'), 'findLastIndex': require('./findLastIndex'), + 'first': require('./first'), 'flatten': require('./flatten'), 'flattenDeep': require('./flattenDeep'), 'flattenDepth': require('./flattenDepth'), diff --git a/node_modules/lodash/lang.js b/node_modules/lodash/lang.js index 665f5c6..6340c4b 100644 --- a/node_modules/lodash/lang.js +++ b/node_modules/lodash/lang.js @@ -47,6 +47,7 @@ module.exports = { 'lt': require('./lt'), 'lte': require('./lte'), 'toArray': require('./toArray'), + 'toFinite': require('./toFinite'), 'toInteger': require('./toInteger'), 'toLength': require('./toLength'), 'toNumber': require('./toNumber'), diff --git a/node_modules/lodash/package.json b/node_modules/lodash/package.json index f7c90b8..c41cbbd 100644 --- a/node_modules/lodash/package.json +++ b/node_modules/lodash/package.json @@ -1,42 +1,43 @@ { "_args": [ [ - "lodash@^4.6.1", + "lodash@^4.11.1", "/Users/martin/newdev/Rinser" ] ], - "_from": "lodash@>=4.6.1 <5.0.0", - "_id": "lodash@4.11.1", + "_from": "lodash@>=4.11.1 <5.0.0", + "_id": "lodash@4.13.1", "_inCache": true, "_installable": true, "_location": "/lodash", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.2.4", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash-4.11.1.tgz_1460618480099_0.40750555554404855" + "tmp": "tmp/lodash-4.13.1.tgz_1464019142054_0.5244540225248784" }, "_npmUser": { "email": "john.david.dalton@gmail.com", "name": "jdalton" }, - "_npmVersion": "2.15.3", + "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { "name": "lodash", - "raw": "lodash@^4.6.1", - "rawSpec": "^4.6.1", + "raw": "lodash@^4.11.1", + "rawSpec": "^4.11.1", "scope": null, - "spec": ">=4.6.1 <5.0.0", + "spec": ">=4.11.1 <5.0.0", "type": "range" }, "_requiredBy": [ "#DEV:/", - "/cheerio" + "/cheerio", + "/gulp-jshint" ], - "_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz", - "_shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc", + "_resolved": "http://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz", + "_shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68", "_shrinkwrap": null, - "_spec": "lodash@^4.6.1", + "_spec": "lodash@^4.11.1", "_where": "/Users/martin/newdev/Rinser", "author": { "email": "john.david.dalton@gmail.com", @@ -68,8 +69,8 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "a32106eb8e2ec8e82c241611414773c9df15f8bc", - "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.11.1.tgz" + "shasum": "83e4b10913f48496d4d16fec4a560af2ee744b68", + "tarball": "https://registry.npmjs.org/lodash/-/lodash-4.13.1.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -85,10 +86,6 @@ "name": "jdalton", "email": "john.david.dalton@gmail.com" }, - { - "name": "jridgewell", - "email": "justin+npm@ridgewell.name" - }, { "name": "mathias", "email": "mathias@qiwi.be" @@ -108,5 +105,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.11.1" + "version": "4.13.1" } diff --git a/node_modules/rss-braider/lib/RssBraider.js b/node_modules/rss-braider/lib/RssBraider.js index 3ad04c9..eb8c2c6 100644 --- a/node_modules/rss-braider/lib/RssBraider.js +++ b/node_modules/rss-braider/lib/RssBraider.js @@ -93,7 +93,6 @@ RssBraider.prototype.processFeed = function(feed_name, format, callback) req.on('response', function (res) { var stream = this; if (res.statusCode !== 200) { - console.error(source); return this.emit('error', 'Bad status code: ' + res.statusCode); } stream.pipe(feedparser); @@ -295,4 +294,4 @@ RssBraider.prototype.date_sort = function(articles_arr) { return sorted_articles; }; -module.exports = RssBraider; +module.exports = RssBraider; \ No newline at end of file diff --git a/node_modules/rss-braider/package.json b/node_modules/rss-braider/package.json index b5b5f28..9b3c165 100644 --- a/node_modules/rss-braider/package.json +++ b/node_modules/rss-braider/package.json @@ -2,7 +2,7 @@ "_args": [ [ "rss-braider@^1.0.0", - "C:\\mddev\\rinser" + "/Users/martin/newdev/Rinser" ] ], "_from": "rss-braider@>=1.0.0 <2.0.0", @@ -28,11 +28,11 @@ "_requiredBy": [ "#DEV:/" ], - "_resolved": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz", + "_resolved": "http://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz", "_shasum": "1ea5ddf8d39151728a5a039af5b0c3407f3e464b", "_shrinkwrap": null, "_spec": "rss-braider@^1.0.0", - "_where": "C:\\mddev\\rinser", + "_where": "/Users/martin/newdev/Rinser", "author": { "email": "kgebhardt@kqed.org", "name": "Kip Gebhardt" @@ -58,7 +58,7 @@ "directories": {}, "dist": { "shasum": "1ea5ddf8d39151728a5a039af5b0c3407f3e464b", - "tarball": "http://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/rss-braider/-/rss-braider-1.0.0.tgz" }, "gitHead": "755970200088eab93a8a8ae15b47a11b9fbb5880", "homepage": "https://github.com/KQED/rss-braider", diff --git a/paleo.js b/paleo.js index 91293e1..443693c 100644 --- a/paleo.js +++ b/paleo.js @@ -22,43 +22,43 @@ feeds.simple_test_feed = { }, "plugins": ['filter_3_days', "fix_images", 'fix_scripts'], "sources": [{ - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://feeds.feedburner.com/PaleoPlan" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://nomnompaleo.com/rss" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://thepaleodiet.com/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://paleoleap.com/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://ultimatepaleoguide.com/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://elanaspantry.com/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://feeds.feedburner.com/Paleomg-PaleoRecipes" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://civilizedcavemancooking.com/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://www.ruled.me/feed/" }, { - /* "name" : "JobServe",*/ + "count": 100, "feed_url": "http://www.primalbro.com/blog?format=RSS" } diff --git a/plugins/fix_images.js b/plugins/fix_images.js index c54eb47..646821c 100644 --- a/plugins/fix_images.js +++ b/plugins/fix_images.js @@ -1,9 +1,7 @@ module.exports = function (item, itemOptions, source) { -//console.log(itemOptions); -// console.log((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)); - //if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) { + if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) { var match = itemOptions.description.replace(/\ssrc=/gi, ' src="assets/fm.png" data-src='); itemOptions.description = match; - //} + } return itemOptions; }; diff --git a/plugins/fix_scripts.js b/plugins/fix_scripts.js index 13cda3e..d97a00d 100644 --- a/plugins/fix_scripts.js +++ b/plugins/fix_scripts.js @@ -1,5 +1,5 @@ module.exports = function (item, itemOptions, source) { - //if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) { + if ((typeof itemOptions.descriptions !== 'undefined') && (itemOptions.description !== null)) { var match = itemOptions.description.replace( /)<[^<]*)*<\/script>/gi, @@ -7,7 +7,7 @@ module.exports = function (item, itemOptions, source) { match = match.replace(/)<[^<]*)*<\/iframe>/gi, ''); itemOptions.description = match; - //} + } return itemOptions; };