vulcan 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/vulcan/cli.rb +20 -10
- data/lib/vulcan/version.rb +1 -1
- data/server/Procfile +1 -1
- data/server/bin/web +10 -0
- data/server/lib/cloudant.coffee +20 -0
- data/server/lib/logger.coffee +17 -0
- data/server/lib/on.coffee +10 -0
- data/server/lib/spawner.coffee +65 -0
- data/server/node_modules/coffee-script/CNAME +1 -0
- data/server/node_modules/coffee-script/LICENSE +22 -0
- data/server/node_modules/coffee-script/README +51 -0
- data/server/node_modules/coffee-script/Rakefile +78 -0
- data/server/node_modules/coffee-script/bin/cake +7 -0
- data/server/node_modules/coffee-script/bin/coffee +7 -0
- data/server/node_modules/coffee-script/extras/jsl.conf +44 -0
- data/server/node_modules/coffee-script/lib/coffee-script/browser.js +92 -0
- data/server/node_modules/coffee-script/lib/coffee-script/cake.js +111 -0
- data/server/node_modules/coffee-script/lib/coffee-script/coffee-script.js +167 -0
- data/server/node_modules/coffee-script/lib/coffee-script/command.js +500 -0
- data/server/node_modules/coffee-script/lib/coffee-script/grammar.js +606 -0
- data/server/node_modules/coffee-script/lib/coffee-script/helpers.js +77 -0
- data/server/node_modules/coffee-script/lib/coffee-script/index.js +11 -0
- data/server/node_modules/coffee-script/lib/coffee-script/lexer.js +788 -0
- data/server/node_modules/coffee-script/lib/coffee-script/nodes.js +2986 -0
- data/server/node_modules/coffee-script/lib/coffee-script/optparse.js +138 -0
- data/server/node_modules/coffee-script/lib/coffee-script/parser.js +683 -0
- data/server/node_modules/coffee-script/lib/coffee-script/repl.js +261 -0
- data/server/node_modules/coffee-script/lib/coffee-script/rewriter.js +349 -0
- data/server/node_modules/coffee-script/lib/coffee-script/scope.js +146 -0
- data/server/node_modules/coffee-script/package.json +55 -0
- data/server/node_modules/connect-form/History.md +0 -6
- data/server/node_modules/connect-form/lib/connect-form.js +2 -4
- data/server/node_modules/connect-form/node_modules/formidable/Readme.md +64 -36
- data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +5 -1
- data/server/node_modules/connect-form/node_modules/formidable/package.json +20 -6
- data/server/node_modules/connect-form/node_modules/formidable/test/common.js +5 -6
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/funkyfilename.txt +1 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +1 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/{slow → integration}/test-fixtures.js +38 -33
- data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-incoming-form.js +11 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/run.js +1 -6
- data/server/node_modules/connect-form/node_modules/formidable/test/unit/test-incoming-form.js +63 -0
- data/server/node_modules/connect-form/package.json +27 -5
- data/server/node_modules/cradle/README.md +10 -10
- data/server/node_modules/cradle/lib/cradle.js +117 -523
- data/server/node_modules/cradle/lib/cradle/database/attachments.js +120 -0
- data/server/node_modules/cradle/lib/cradle/database/changes.js +56 -0
- data/server/node_modules/cradle/lib/cradle/database/documents.js +215 -0
- data/server/node_modules/cradle/lib/cradle/database/index.js +65 -0
- data/server/node_modules/cradle/lib/cradle/database/views.js +125 -0
- data/server/node_modules/cradle/node_modules/follow/LICENSE +202 -0
- data/server/node_modules/cradle/node_modules/follow/README.md +164 -0
- data/server/node_modules/cradle/node_modules/follow/Rakefile +54 -0
- data/server/node_modules/cradle/node_modules/follow/api.js +35 -0
- data/server/node_modules/cradle/node_modules/follow/browser/eventemitter2.js +453 -0
- data/server/node_modules/cradle/node_modules/follow/browser/export.js +78 -0
- data/server/node_modules/cradle/node_modules/follow/browser/index.html +14 -0
- data/server/node_modules/cradle/node_modules/follow/browser/jquery-1.6.1.min.js +18 -0
- data/server/node_modules/cradle/node_modules/follow/browser/log4js.js +46 -0
- data/server/node_modules/cradle/node_modules/follow/browser/main.js +92 -0
- data/server/node_modules/cradle/node_modules/follow/browser/querystring.js +28 -0
- data/server/node_modules/cradle/node_modules/follow/browser/request.jquery.js +237 -0
- data/server/node_modules/cradle/node_modules/follow/browser/require.js +33 -0
- data/server/node_modules/cradle/node_modules/follow/browser/util.js +28 -0
- data/server/node_modules/cradle/node_modules/follow/cli.js +101 -0
- data/server/node_modules/cradle/node_modules/follow/lib/feed.js +556 -0
- data/server/node_modules/cradle/node_modules/follow/lib/index.js +66 -0
- data/server/node_modules/cradle/node_modules/follow/lib/stream.js +305 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/LICENSE +55 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/README.md +285 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/main.js +618 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/mimetypes.js +146 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/oauth.js +34 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/package.json +42 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/googledoodle.png +0 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/run.sh +6 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/server.js +57 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-body.js +90 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-cookie.js +29 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-cookiejar.js +90 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-errors.js +30 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-oauth.js +109 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-pipes.js +167 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-proxy.js +39 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/tests/test-timeout.js +87 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/uuid.js +19 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/vendor/cookie/index.js +55 -0
- data/server/node_modules/cradle/node_modules/follow/node_modules/request/vendor/cookie/jar.js +72 -0
- data/server/node_modules/cradle/node_modules/follow/package.json +45 -0
- data/server/node_modules/cradle/node_modules/follow/test/couch.js +153 -0
- data/server/node_modules/cradle/node_modules/follow/test/follow.js +136 -0
- data/server/node_modules/cradle/node_modules/follow/test/issues.js +178 -0
- data/server/node_modules/cradle/node_modules/follow/test/issues/10.js +24 -0
- data/server/node_modules/cradle/node_modules/follow/test/stream.js +493 -0
- data/server/node_modules/cradle/node_modules/request/LICENSE +55 -0
- data/server/node_modules/cradle/node_modules/request/README.md +287 -0
- data/server/node_modules/cradle/node_modules/request/forever.js +103 -0
- data/server/node_modules/cradle/node_modules/request/main.js +913 -0
- data/server/node_modules/cradle/node_modules/request/mimetypes.js +152 -0
- data/server/node_modules/cradle/node_modules/request/oauth.js +34 -0
- data/server/node_modules/cradle/node_modules/request/package.json +42 -0
- data/server/node_modules/cradle/node_modules/request/tests/googledoodle.png +0 -0
- data/server/node_modules/cradle/node_modules/request/tests/run.js +38 -0
- data/server/node_modules/cradle/node_modules/request/tests/server.js +82 -0
- data/server/node_modules/cradle/node_modules/request/tests/squid.conf +77 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.cnf +20 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.crl +0 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.crt +17 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.csr +13 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.key +18 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/ca.srl +1 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.cnf +19 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.crt +16 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.csr +11 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.js +28 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/ca/server.key +9 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/npm-ca.crt +16 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/test.crt +15 -0
- data/server/node_modules/cradle/node_modules/request/tests/ssl/test.key +15 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-body.js +95 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-cookie.js +29 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-cookiejar.js +90 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-defaults.js +68 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-errors.js +37 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-headers.js +52 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-httpModule.js +94 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-https-strict.js +97 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-https.js +86 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-oauth.js +117 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-params.js +92 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-pipes.js +202 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-proxy.js +39 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-qs.js +28 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-redirect.js +154 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-timeout.js +87 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-toJSON.js +14 -0
- data/server/node_modules/cradle/node_modules/request/tests/test-tunnel.js +61 -0
- data/server/node_modules/cradle/node_modules/request/tunnel.js +229 -0
- data/server/node_modules/cradle/node_modules/request/uuid.js +19 -0
- data/server/node_modules/cradle/node_modules/request/vendor/cookie/index.js +65 -0
- data/server/node_modules/cradle/node_modules/request/vendor/cookie/jar.js +72 -0
- data/server/node_modules/cradle/node_modules/vargs/package.json +33 -10
- data/server/node_modules/cradle/package.json +50 -12
- data/server/node_modules/cradle/test/cache-test.js +1 -4
- data/server/node_modules/cradle/test/connection-test.js +179 -0
- data/server/node_modules/cradle/test/database-attachment-test.js +344 -0
- data/server/node_modules/cradle/test/database-cache-test.js +132 -0
- data/server/node_modules/cradle/test/database-test.js +219 -0
- data/server/node_modules/cradle/test/database-view-test.js +141 -0
- data/server/node_modules/cradle/test/fixtures/databases.json +28 -1
- data/server/node_modules/cradle/test/helpers/seed.js +14 -5
- data/server/node_modules/cradle/test/response-test.js +1 -1
- data/server/node_modules/express/History.md +16 -0
- data/server/node_modules/express/bin/express +7 -6
- data/server/node_modules/express/lib-cov/application.js +510 -0
- data/server/node_modules/express/lib-cov/express.js +65 -0
- data/server/node_modules/express/lib-cov/middleware.js +54 -0
- data/server/node_modules/express/lib-cov/request.js +225 -0
- data/server/node_modules/express/lib-cov/response.js +611 -0
- data/server/node_modules/express/lib-cov/router/collection.js +40 -0
- data/server/node_modules/express/lib-cov/router/index.js +515 -0
- data/server/node_modules/express/lib-cov/router/methods.js +9 -0
- data/server/node_modules/express/lib-cov/router/route.js +68 -0
- data/server/node_modules/express/lib-cov/utils.js +151 -0
- data/server/node_modules/express/lib-cov/view.js +81 -0
- data/server/node_modules/express/lib/express.js +1 -1
- data/server/node_modules/express/lib/http.js +1 -2
- data/server/node_modules/express/lib/request.js +2 -2
- data/server/node_modules/express/lib/router/methods.js +10 -1
- data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/http.js +3 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +0 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +1 -2
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +42 -25
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +14 -3
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +11 -0
- data/server/node_modules/express/node_modules/connect/package.json +35 -7
- data/server/node_modules/express/node_modules/mime/package.json +30 -8
- data/server/node_modules/express/node_modules/mkdirp/README.markdown +35 -2
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +1 -1
- data/server/node_modules/express/node_modules/mkdirp/index.js +72 -13
- data/server/node_modules/express/node_modules/mkdirp/package.json +39 -21
- data/server/node_modules/express/node_modules/mkdirp/test/chmod.js +38 -0
- data/server/node_modules/express/node_modules/mkdirp/test/clobber.js +37 -0
- data/server/node_modules/express/node_modules/mkdirp/test/perm.js +32 -0
- data/server/node_modules/express/node_modules/mkdirp/test/perm_sync.js +39 -0
- data/server/node_modules/express/node_modules/mkdirp/test/sync.js +27 -0
- data/server/node_modules/express/node_modules/mkdirp/test/umask.js +28 -0
- data/server/node_modules/express/node_modules/mkdirp/test/umask_sync.js +27 -0
- data/server/node_modules/express/node_modules/qs/History.md +10 -0
- data/server/node_modules/express/node_modules/qs/Readme.md +9 -2
- data/server/node_modules/express/node_modules/qs/examples.js +3 -0
- data/server/node_modules/express/node_modules/qs/lib/querystring.js +8 -6
- data/server/node_modules/express/node_modules/qs/package.json +26 -8
- data/server/node_modules/express/node_modules/qs/test/parse.js +13 -1
- data/server/node_modules/express/node_modules/qs/test/stringify.js +45 -37
- data/server/node_modules/express/package.json +55 -16
- data/server/node_modules/express/test.js +41 -0
- data/server/node_modules/knox/package.json +26 -4
- data/server/node_modules/node-uuid/package.json +40 -11
- data/server/node_modules/node-uuid/test/test.js +1 -1
- data/server/node_modules/nodemon/README.md +120 -0
- data/server/node_modules/nodemon/nodemon.js +518 -0
- data/server/node_modules/nodemon/nodemonignore.example +11 -0
- data/server/node_modules/nodemon/package.json +49 -0
- data/server/node_modules/restler/README.md +144 -94
- data/server/node_modules/restler/lib/multipartform.js +2 -0
- data/server/node_modules/restler/lib/restler.js +218 -61
- data/server/node_modules/restler/package.json +35 -8
- data/server/node_modules/restler/test/all.js +6 -1
- data/server/node_modules/restler/test/restler.js +624 -118
- data/server/package.json +14 -10
- data/server/web.coffee +64 -0
- data/server/web.js +15 -3
- metadata +170 -57
- data/server/index.js +0 -14
- data/server/node_modules/connect-form/LICENSE +0 -22
- data/server/node_modules/connect-form/index.js +0 -100
- data/server/node_modules/connect-form/node_modules/formidable/test/fast/test-incoming-form.js +0 -45
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +0 -24
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/multi_video.upload +0 -0
- data/server/node_modules/cradle/Makefile +0 -10
- data/server/node_modules/cradle/test/cradle-test.js +0 -650
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +0 -13
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -26
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +0 -23
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -24
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +0 -22
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/multi_video.upload +0 -0
- data/server/node_modules/express/node_modules/connect/test.js +0 -52
- data/server/node_modules/express/testing/foo/app.js +0 -35
- data/server/node_modules/express/testing/foo/package.json +0 -9
- data/server/node_modules/express/testing/foo/public/stylesheets/style.css +0 -8
- data/server/node_modules/express/testing/foo/routes/index.js +0 -10
- data/server/node_modules/express/testing/foo/views/index.jade +0 -2
- data/server/node_modules/express/testing/foo/views/layout.jade +0 -6
- data/server/node_modules/express/testing/index.js +0 -43
- data/server/node_modules/express/testing/public/test.txt +0 -2971
- data/server/node_modules/express/testing/views/page.html +0 -1
- data/server/node_modules/express/testing/views/page.jade +0 -3
- data/server/node_modules/express/testing/views/test.md +0 -1
- data/server/node_modules/express/testing/views/user/index.jade +0 -1
- data/server/node_modules/express/testing/views/user/list.jade +0 -1
- data/server/node_modules/knox/lib/knox/mime/index.js +0 -308
- data/server/node_modules/knox/lib/knox/mime/test.js +0 -59
- data/server/node_modules/node-uuid/test/benchmark-native +0 -0
- data/server/node_modules/on/index.js +0 -13
- data/server/node_modules/restler/test/test_helper.js +0 -163
- data/server/node_modules/spawner/index.js +0 -106
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/* automatically generated by JSCoverage - do not edit */
|
|
2
|
+
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
|
|
3
|
+
if (! _$jscoverage['router/methods.js']) {
|
|
4
|
+
_$jscoverage['router/methods.js'] = [];
|
|
5
|
+
_$jscoverage['router/methods.js'][12] = 0;
|
|
6
|
+
}
|
|
7
|
+
_$jscoverage['router/methods.js'][12]++;
|
|
8
|
+
module.exports = ["get", "post", "put", "head", "delete", "options", "trace", "copy", "lock", "mkcol", "move", "propfind", "proppatch", "unlock", "report", "mkactivity", "checkout", "merge", "m-search", "notify", "subscribe", "unsubscribe", "patch"];
|
|
9
|
+
_$jscoverage['router/methods.js'].source = ["","/*!"," * Express - router - methods"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * HTTP methods supported by node."," */","","module.exports = ["," 'get'"," , 'post'"," , 'put'"," , 'head'"," , 'delete'"," , 'options'"," , 'trace'"," , 'copy'"," , 'lock'"," , 'mkcol'"," , 'move'"," , 'propfind'"," , 'proppatch'"," , 'unlock'"," , 'report'"," , 'mkactivity'"," , 'checkout'"," , 'merge'"," , 'm-search'"," , 'notify'"," , 'subscribe'"," , 'unsubscribe'"," , 'patch'","];"];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* automatically generated by JSCoverage - do not edit */
|
|
2
|
+
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
|
|
3
|
+
if (! _$jscoverage['router/route.js']) {
|
|
4
|
+
_$jscoverage['router/route.js'] = [];
|
|
5
|
+
_$jscoverage['router/route.js'][11] = 0;
|
|
6
|
+
_$jscoverage['router/route.js'][29] = 0;
|
|
7
|
+
_$jscoverage['router/route.js'][30] = 0;
|
|
8
|
+
_$jscoverage['router/route.js'][31] = 0;
|
|
9
|
+
_$jscoverage['router/route.js'][32] = 0;
|
|
10
|
+
_$jscoverage['router/route.js'][33] = 0;
|
|
11
|
+
_$jscoverage['router/route.js'][34] = 0;
|
|
12
|
+
_$jscoverage['router/route.js'][48] = 0;
|
|
13
|
+
_$jscoverage['router/route.js'][49] = 0;
|
|
14
|
+
_$jscoverage['router/route.js'][69] = 0;
|
|
15
|
+
_$jscoverage['router/route.js'][70] = 0;
|
|
16
|
+
_$jscoverage['router/route.js'][71] = 0;
|
|
17
|
+
_$jscoverage['router/route.js'][72] = 0;
|
|
18
|
+
_$jscoverage['router/route.js'][73] = 0;
|
|
19
|
+
_$jscoverage['router/route.js'][77] = 0;
|
|
20
|
+
_$jscoverage['router/route.js'][78] = 0;
|
|
21
|
+
_$jscoverage['router/route.js'][79] = 0;
|
|
22
|
+
_$jscoverage['router/route.js'][88] = 0;
|
|
23
|
+
}
|
|
24
|
+
_$jscoverage['router/route.js'][11]++;
|
|
25
|
+
module.exports = Route;
|
|
26
|
+
_$jscoverage['router/route.js'][29]++;
|
|
27
|
+
function Route(method, path, callbacks, options) {
|
|
28
|
+
_$jscoverage['router/route.js'][30]++;
|
|
29
|
+
options = options || {};
|
|
30
|
+
_$jscoverage['router/route.js'][31]++;
|
|
31
|
+
this.path = path;
|
|
32
|
+
_$jscoverage['router/route.js'][32]++;
|
|
33
|
+
this.method = method;
|
|
34
|
+
_$jscoverage['router/route.js'][33]++;
|
|
35
|
+
this.callbacks = callbacks;
|
|
36
|
+
_$jscoverage['router/route.js'][34]++;
|
|
37
|
+
this.regexp = normalize(path, this.keys = [], options.sensitive, options.strict);
|
|
38
|
+
}
|
|
39
|
+
_$jscoverage['router/route.js'][48]++;
|
|
40
|
+
Route.prototype.match = (function (path) {
|
|
41
|
+
_$jscoverage['router/route.js'][49]++;
|
|
42
|
+
return this.regexp.exec(path);
|
|
43
|
+
});
|
|
44
|
+
_$jscoverage['router/route.js'][69]++;
|
|
45
|
+
function normalize(path, keys, sensitive, strict) {
|
|
46
|
+
_$jscoverage['router/route.js'][70]++;
|
|
47
|
+
if (path instanceof RegExp) {
|
|
48
|
+
_$jscoverage['router/route.js'][70]++;
|
|
49
|
+
return path;
|
|
50
|
+
}
|
|
51
|
+
_$jscoverage['router/route.js'][71]++;
|
|
52
|
+
if (path instanceof Array) {
|
|
53
|
+
_$jscoverage['router/route.js'][72]++;
|
|
54
|
+
path = "(" + path.join("|") + ")";
|
|
55
|
+
}
|
|
56
|
+
_$jscoverage['router/route.js'][73]++;
|
|
57
|
+
path = path.concat(strict? "": "/?").replace(/\/\(/g, "(?:/").replace(/(\/)?(\.)?:(\w+)(?:(\(.*?\)))?(\?)?/g, (function (_, slash, format, key, capture, optional) {
|
|
58
|
+
_$jscoverage['router/route.js'][77]++;
|
|
59
|
+
keys.push({name: key, optional: ! ! optional});
|
|
60
|
+
_$jscoverage['router/route.js'][78]++;
|
|
61
|
+
slash = slash || "";
|
|
62
|
+
_$jscoverage['router/route.js'][79]++;
|
|
63
|
+
return "" + (optional? "": slash) + "(?:" + (optional? slash: "") + (format || "") + (capture || (format && "([^/.]+?)" || "([^/]+?)")) + ")" + (optional || "");
|
|
64
|
+
})).replace(/([\/.])/g, "\\$1").replace(/\*/g, "(.*)");
|
|
65
|
+
_$jscoverage['router/route.js'][88]++;
|
|
66
|
+
return new RegExp("^" + path + "$", sensitive? "": "i");
|
|
67
|
+
}
|
|
68
|
+
_$jscoverage['router/route.js'].source = ["/*!"," * Express - router - Route"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Expose `Route`."," */","","module.exports = Route;","","/**"," * Initialize `Route` with the given HTTP `method`, `path`,"," * and an array of `callbacks` and `options`."," *"," * Options:"," *"," * - `sensitive` enable case-sensitive routes"," * - `strict` enable strict matching for trailing slashes"," *"," * @param {String} method"," * @param {String} path"," * @param {Array} callbacks"," * @param {Object} options."," * @api private"," */","","function Route(method, path, callbacks, options) {"," options = options || {};"," this.path = path;"," this.method = method;"," this.callbacks = callbacks;"," this.regexp = normalize(path"," , this.keys = []"," , options.sensitive"," , options.strict);","}","","/**"," * Check if this route matches `path` and return captures made."," *"," * @param {String} path"," * @return {Array}"," * @api private"," */","","Route.prototype.match = function(path){"," return this.regexp.exec(path);","};","","/**"," * Normalize the given path string,"," * returning a regular expression."," *"," * An empty array should be passed,"," * which will contain the placeholder"," * key names. For example \"/user/:id\" will"," * then contain [\"id\"]."," *"," * @param {String|RegExp|Array} path"," * @param {Array} keys"," * @param {Boolean} sensitive"," * @param {Boolean} strict"," * @return {RegExp}"," * @api private"," */","","function normalize(path, keys, sensitive, strict) {"," if (path instanceof RegExp) return path;"," if (path instanceof Array) "," \tpath = '(' + path.join('|') + ')';"," path = path"," .concat(strict ? '' : '/?')"," .replace(/\\/\\(/g, '(?:/')"," .replace(/(\\/)?(\\.)?:(\\w+)(?:(\\(.*?\\)))?(\\?)?/g, function(_, slash, format, key, capture, optional){"," keys.push({ name: key, optional: !! optional });"," slash = slash || '';"," return ''"," + (optional ? '' : slash)"," + '(?:'"," + (optional ? slash : '')"," + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')'"," + (optional || '');"," })"," .replace(/([\\/.])/g, '\\\\$1')"," .replace(/\\*/g, '(.*)');"," return new RegExp('^' + path + '$', sensitive ? '' : 'i');","}"];
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* automatically generated by JSCoverage - do not edit */
|
|
2
|
+
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
|
|
3
|
+
if (! _$jscoverage['utils.js']) {
|
|
4
|
+
_$jscoverage['utils.js'] = [];
|
|
5
|
+
_$jscoverage['utils.js'][12] = 0;
|
|
6
|
+
_$jscoverage['utils.js'][22] = 0;
|
|
7
|
+
_$jscoverage['utils.js'][23] = 0;
|
|
8
|
+
_$jscoverage['utils.js'][24] = 0;
|
|
9
|
+
_$jscoverage['utils.js'][35] = 0;
|
|
10
|
+
_$jscoverage['utils.js'][36] = 0;
|
|
11
|
+
_$jscoverage['utils.js'][38] = 0;
|
|
12
|
+
_$jscoverage['utils.js'][39] = 0;
|
|
13
|
+
_$jscoverage['utils.js'][40] = 0;
|
|
14
|
+
_$jscoverage['utils.js'][42] = 0;
|
|
15
|
+
_$jscoverage['utils.js'][45] = 0;
|
|
16
|
+
_$jscoverage['utils.js'][58] = 0;
|
|
17
|
+
_$jscoverage['utils.js'][60] = 0;
|
|
18
|
+
_$jscoverage['utils.js'][63] = 0;
|
|
19
|
+
_$jscoverage['utils.js'][66] = 0;
|
|
20
|
+
_$jscoverage['utils.js'][69] = 0;
|
|
21
|
+
_$jscoverage['utils.js'][74] = 0;
|
|
22
|
+
_$jscoverage['utils.js'][75] = 0;
|
|
23
|
+
_$jscoverage['utils.js'][76] = 0;
|
|
24
|
+
_$jscoverage['utils.js'][79] = 0;
|
|
25
|
+
_$jscoverage['utils.js'][91] = 0;
|
|
26
|
+
_$jscoverage['utils.js'][92] = 0;
|
|
27
|
+
_$jscoverage['utils.js'][108] = 0;
|
|
28
|
+
_$jscoverage['utils.js'][109] = 0;
|
|
29
|
+
_$jscoverage['utils.js'][112] = 0;
|
|
30
|
+
_$jscoverage['utils.js'][113] = 0;
|
|
31
|
+
_$jscoverage['utils.js'][114] = 0;
|
|
32
|
+
_$jscoverage['utils.js'][115] = 0;
|
|
33
|
+
_$jscoverage['utils.js'][129] = 0;
|
|
34
|
+
_$jscoverage['utils.js'][130] = 0;
|
|
35
|
+
_$jscoverage['utils.js'][134] = 0;
|
|
36
|
+
_$jscoverage['utils.js'][137] = 0;
|
|
37
|
+
_$jscoverage['utils.js'][150] = 0;
|
|
38
|
+
_$jscoverage['utils.js'][151] = 0;
|
|
39
|
+
_$jscoverage['utils.js'][154] = 0;
|
|
40
|
+
_$jscoverage['utils.js'][158] = 0;
|
|
41
|
+
_$jscoverage['utils.js'][169] = 0;
|
|
42
|
+
_$jscoverage['utils.js'][170] = 0;
|
|
43
|
+
}
|
|
44
|
+
_$jscoverage['utils.js'][12]++;
|
|
45
|
+
var mime = require("mime");
|
|
46
|
+
_$jscoverage['utils.js'][22]++;
|
|
47
|
+
exports.isAbsolute = (function (path) {
|
|
48
|
+
_$jscoverage['utils.js'][23]++;
|
|
49
|
+
if ("/" == path[0]) {
|
|
50
|
+
_$jscoverage['utils.js'][23]++;
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
_$jscoverage['utils.js'][24]++;
|
|
54
|
+
if (":" == path[1] && "\\" == path[2]) {
|
|
55
|
+
_$jscoverage['utils.js'][24]++;
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
_$jscoverage['utils.js'][35]++;
|
|
60
|
+
exports.flatten = (function (arr, ret) {
|
|
61
|
+
_$jscoverage['utils.js'][36]++;
|
|
62
|
+
var ret = ret || [], len = arr.length;
|
|
63
|
+
_$jscoverage['utils.js'][38]++;
|
|
64
|
+
for (var i = 0; i < len; ++i) {
|
|
65
|
+
_$jscoverage['utils.js'][39]++;
|
|
66
|
+
if (Array.isArray(arr[i])) {
|
|
67
|
+
_$jscoverage['utils.js'][40]++;
|
|
68
|
+
exports.flatten(arr[i], ret);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
_$jscoverage['utils.js'][42]++;
|
|
72
|
+
ret.push(arr[i]);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_$jscoverage['utils.js'][45]++;
|
|
76
|
+
return ret;
|
|
77
|
+
});
|
|
78
|
+
_$jscoverage['utils.js'][58]++;
|
|
79
|
+
exports.accepts = (function (type, str) {
|
|
80
|
+
_$jscoverage['utils.js'][60]++;
|
|
81
|
+
if (! str) {
|
|
82
|
+
_$jscoverage['utils.js'][60]++;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
_$jscoverage['utils.js'][63]++;
|
|
86
|
+
if (! ~ type.indexOf("/")) {
|
|
87
|
+
_$jscoverage['utils.js'][63]++;
|
|
88
|
+
type = mime.lookup(type);
|
|
89
|
+
}
|
|
90
|
+
_$jscoverage['utils.js'][66]++;
|
|
91
|
+
type = type.split("/");
|
|
92
|
+
_$jscoverage['utils.js'][69]++;
|
|
93
|
+
var accepted = exports.parseAccept(str), len = accepted.length, obj, ok;
|
|
94
|
+
_$jscoverage['utils.js'][74]++;
|
|
95
|
+
for (var i = 0; i < len; ++i) {
|
|
96
|
+
_$jscoverage['utils.js'][75]++;
|
|
97
|
+
obj = accepted[i];
|
|
98
|
+
_$jscoverage['utils.js'][76]++;
|
|
99
|
+
if (exports.accept(type, obj)) {
|
|
100
|
+
_$jscoverage['utils.js'][76]++;
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_$jscoverage['utils.js'][79]++;
|
|
105
|
+
return false;
|
|
106
|
+
});
|
|
107
|
+
_$jscoverage['utils.js'][91]++;
|
|
108
|
+
exports.accept = (function (type, other) {
|
|
109
|
+
_$jscoverage['utils.js'][92]++;
|
|
110
|
+
return (type[0] == other.type || "*" == other.type) && (type[1] == other.subtype || "*" == other.subtype);
|
|
111
|
+
});
|
|
112
|
+
_$jscoverage['utils.js'][108]++;
|
|
113
|
+
exports.parseAccept = (function (str) {
|
|
114
|
+
_$jscoverage['utils.js'][109]++;
|
|
115
|
+
return exports.parseQuality(str).map((function (obj) {
|
|
116
|
+
_$jscoverage['utils.js'][112]++;
|
|
117
|
+
var parts = obj.value.split("/");
|
|
118
|
+
_$jscoverage['utils.js'][113]++;
|
|
119
|
+
obj.type = parts[0];
|
|
120
|
+
_$jscoverage['utils.js'][114]++;
|
|
121
|
+
obj.subtype = parts[1];
|
|
122
|
+
_$jscoverage['utils.js'][115]++;
|
|
123
|
+
return obj;
|
|
124
|
+
}));
|
|
125
|
+
});
|
|
126
|
+
_$jscoverage['utils.js'][129]++;
|
|
127
|
+
exports.parseQuality = (function (str) {
|
|
128
|
+
_$jscoverage['utils.js'][130]++;
|
|
129
|
+
return str.split(/ *, */).map(quality).filter((function (obj) {
|
|
130
|
+
_$jscoverage['utils.js'][134]++;
|
|
131
|
+
return obj.quality;
|
|
132
|
+
})).sort((function (a, b) {
|
|
133
|
+
_$jscoverage['utils.js'][137]++;
|
|
134
|
+
return b.quality - a.quality;
|
|
135
|
+
}));
|
|
136
|
+
});
|
|
137
|
+
_$jscoverage['utils.js'][150]++;
|
|
138
|
+
function quality(str) {
|
|
139
|
+
_$jscoverage['utils.js'][151]++;
|
|
140
|
+
var parts = str.split(/ *; */), val = parts[0];
|
|
141
|
+
_$jscoverage['utils.js'][154]++;
|
|
142
|
+
var q = parts[1]? parseFloat(parts[1].split(/ *= */)[1]): 1;
|
|
143
|
+
_$jscoverage['utils.js'][158]++;
|
|
144
|
+
return ({value: val, quality: q});
|
|
145
|
+
}
|
|
146
|
+
_$jscoverage['utils.js'][169]++;
|
|
147
|
+
exports.escape = (function (html) {
|
|
148
|
+
_$jscoverage['utils.js'][170]++;
|
|
149
|
+
return String(html).replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
150
|
+
});
|
|
151
|
+
_$jscoverage['utils.js'].source = ["","/*!"," * Express - utils"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var mime = require('mime');","","/**"," * Check if `path` looks absolute."," *"," * @param {String} path"," * @return {Boolean}"," * @api private"," */","","exports.isAbsolute = function(path){"," if ('/' == path[0]) return true;"," if (':' == path[1] && '\\\\' == path[2]) return true;","};","","/**"," * Flatten the given `arr`."," *"," * @param {Array} arr"," * @return {Array}"," * @api private"," */","","exports.flatten = function(arr, ret){"," var ret = ret || []"," , len = arr.length;"," for (var i = 0; i < len; ++i) {"," if (Array.isArray(arr[i])) {"," exports.flatten(arr[i], ret);"," } else {"," ret.push(arr[i]);"," }"," }"," return ret;","};","","/**"," * Check if `type` is acceptable based on"," * the given `str`."," *"," * @param {String} type"," * @param {String} str"," * @return {Boolean}"," * @api private"," */","","exports.accepts = function(type, str){"," // accept anything when Accept is not present"," if (!str) return true;",""," // resolve mime"," if (!~type.indexOf('/')) type = mime.lookup(type);",""," // split type/subtype"," type = type.split('/');",""," // parse"," var accepted = exports.parseAccept(str)"," , len = accepted.length"," , obj"," , ok;",""," for (var i = 0; i < len; ++i) {"," obj = accepted[i];"," if (exports.accept(type, obj)) return true;"," }",""," return false;","};","","/**"," * Check if `type` array is acceptable for `other`."," *"," * @param {Array} type"," * @param {Object} other"," * @return {Boolean}"," * @api private"," */","","exports.accept = function(type, other){"," return (type[0] == other.type || '*' == other.type)"," && (type[1] == other.subtype || '*' == other.subtype);","};","","/**"," * Parse accept `str`, returning"," * an array objects containing"," * `.type` and `.subtype` along"," * with the values provided by"," * `parseQuality()`."," *"," * @param {Type} name"," * @return {Type}"," * @api private"," */","","exports.parseAccept = function(str){"," return exports"," .parseQuality(str)"," .map(function(obj){"," var parts = obj.value.split('/');"," obj.type = parts[0];"," obj.subtype = parts[1];"," return obj;"," });","};","","/**"," * Parse quality `str`, returning an"," * array of objects with `.value` and"," * `.quality`."," *"," * @param {Type} name"," * @return {Type}"," * @api private"," */","","exports.parseQuality = function(str){"," return str"," .split(/ *, */)"," .map(quality)"," .filter(function(obj){"," return obj.quality;"," })"," .sort(function(a, b){"," return b.quality - a.quality;"," });","};","","/**"," * Parse quality `str` returning an"," * object with `.value` and `.quality`."," *"," * @param {String} str"," * @return {Object}"," * @api private"," */","","function quality(str) {"," var parts = str.split(/ *; */)"," , val = parts[0];",""," var q = parts[1]"," ? parseFloat(parts[1].split(/ *= */)[1])"," : 1;",""," return { value: val, quality: q };","}","","/**"," * Escape special characters in the given string of html."," *"," * @param {String} html"," * @return {String}"," * @api private"," */","","exports.escape = function(html) {"," return String(html)"," .replace(/&/g, '&amp;')"," .replace(/\"/g, '&quot;')"," .replace(/</g, '&lt;')"," .replace(/>/g, '&gt;');","};"];
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* automatically generated by JSCoverage - do not edit */
|
|
2
|
+
if (typeof _$jscoverage === 'undefined') _$jscoverage = {};
|
|
3
|
+
if (! _$jscoverage['view.js']) {
|
|
4
|
+
_$jscoverage['view.js'] = [];
|
|
5
|
+
_$jscoverage['view.js'][12] = 0;
|
|
6
|
+
_$jscoverage['view.js'][25] = 0;
|
|
7
|
+
_$jscoverage['view.js'][41] = 0;
|
|
8
|
+
_$jscoverage['view.js'][42] = 0;
|
|
9
|
+
_$jscoverage['view.js'][43] = 0;
|
|
10
|
+
_$jscoverage['view.js'][44] = 0;
|
|
11
|
+
_$jscoverage['view.js'][45] = 0;
|
|
12
|
+
_$jscoverage['view.js'][46] = 0;
|
|
13
|
+
_$jscoverage['view.js'][47] = 0;
|
|
14
|
+
_$jscoverage['view.js'][48] = 0;
|
|
15
|
+
_$jscoverage['view.js'][49] = 0;
|
|
16
|
+
_$jscoverage['view.js'][50] = 0;
|
|
17
|
+
_$jscoverage['view.js'][61] = 0;
|
|
18
|
+
_$jscoverage['view.js'][62] = 0;
|
|
19
|
+
_$jscoverage['view.js'][65] = 0;
|
|
20
|
+
_$jscoverage['view.js'][66] = 0;
|
|
21
|
+
_$jscoverage['view.js'][69] = 0;
|
|
22
|
+
_$jscoverage['view.js'][70] = 0;
|
|
23
|
+
_$jscoverage['view.js'][81] = 0;
|
|
24
|
+
_$jscoverage['view.js'][82] = 0;
|
|
25
|
+
}
|
|
26
|
+
_$jscoverage['view.js'][12]++;
|
|
27
|
+
var path = require("path"), utils = require("./utils"), fs = require("fs"), dirname = path.dirname, basename = path.basename, extname = path.extname, exists = path.existsSync, join = path.join;
|
|
28
|
+
_$jscoverage['view.js'][25]++;
|
|
29
|
+
module.exports = View;
|
|
30
|
+
_$jscoverage['view.js'][41]++;
|
|
31
|
+
function View(name, options) {
|
|
32
|
+
_$jscoverage['view.js'][42]++;
|
|
33
|
+
options = options || {};
|
|
34
|
+
_$jscoverage['view.js'][43]++;
|
|
35
|
+
this.name = name;
|
|
36
|
+
_$jscoverage['view.js'][44]++;
|
|
37
|
+
this.root = options.root;
|
|
38
|
+
_$jscoverage['view.js'][45]++;
|
|
39
|
+
var engines = options.engines;
|
|
40
|
+
_$jscoverage['view.js'][46]++;
|
|
41
|
+
this.defaultEngine = options.defaultEngine;
|
|
42
|
+
_$jscoverage['view.js'][47]++;
|
|
43
|
+
var ext = this.ext = extname(name);
|
|
44
|
+
_$jscoverage['view.js'][48]++;
|
|
45
|
+
if (! ext) {
|
|
46
|
+
_$jscoverage['view.js'][48]++;
|
|
47
|
+
name += (ext = this.ext = "." + this.defaultEngine);
|
|
48
|
+
}
|
|
49
|
+
_$jscoverage['view.js'][49]++;
|
|
50
|
+
this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express);
|
|
51
|
+
_$jscoverage['view.js'][50]++;
|
|
52
|
+
this.path = this.lookup(name);
|
|
53
|
+
}
|
|
54
|
+
_$jscoverage['view.js'][61]++;
|
|
55
|
+
View.prototype.lookup = (function (path) {
|
|
56
|
+
_$jscoverage['view.js'][62]++;
|
|
57
|
+
var ext = this.ext;
|
|
58
|
+
_$jscoverage['view.js'][65]++;
|
|
59
|
+
if (! utils.isAbsolute(path)) {
|
|
60
|
+
_$jscoverage['view.js'][65]++;
|
|
61
|
+
path = join(this.root, path);
|
|
62
|
+
}
|
|
63
|
+
_$jscoverage['view.js'][66]++;
|
|
64
|
+
if (exists(path)) {
|
|
65
|
+
_$jscoverage['view.js'][66]++;
|
|
66
|
+
return path;
|
|
67
|
+
}
|
|
68
|
+
_$jscoverage['view.js'][69]++;
|
|
69
|
+
path = join(dirname(path), basename(path, ext), "index" + ext);
|
|
70
|
+
_$jscoverage['view.js'][70]++;
|
|
71
|
+
if (exists(path)) {
|
|
72
|
+
_$jscoverage['view.js'][70]++;
|
|
73
|
+
return path;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
_$jscoverage['view.js'][81]++;
|
|
77
|
+
View.prototype.render = (function (options, fn) {
|
|
78
|
+
_$jscoverage['view.js'][82]++;
|
|
79
|
+
this.engine(this.path, options, fn);
|
|
80
|
+
});
|
|
81
|
+
_$jscoverage['view.js'].source = ["","/*!"," * Express - View"," * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>"," * MIT Licensed"," */","","/**"," * Module dependencies."," */","","var path = require('path')"," , utils = require('./utils')"," , fs = require('fs')"," , dirname = path.dirname"," , basename = path.basename"," , extname = path.extname"," , exists = path.existsSync"," , join = path.join;","","/**"," * Expose `View`."," */","","module.exports = View;","","/**"," * Initialize a new `View` with the given `name`."," *"," * Options:"," *"," * - `defaultEngine` the default template engine name "," * - `engines` template engine require() cache "," * - `root` root path for view lookup "," *"," * @param {String} name"," * @param {Object} options"," * @api private"," */","","function View(name, options) {"," options = options || {};"," this.name = name;"," this.root = options.root;"," var engines = options.engines;"," this.defaultEngine = options.defaultEngine;"," var ext = this.ext = extname(name);"," if (!ext) name += (ext = this.ext = '.' + this.defaultEngine);"," this.engine = engines[ext] || (engines[ext] = require(ext.slice(1)).__express);"," this.path = this.lookup(name);","}","","/**"," * Lookup view by the given `path`"," *"," * @param {String} path"," * @return {String}"," * @api private"," */","","View.prototype.lookup = function(path){"," var ext = this.ext;",""," // <path>.<engine>"," if (!utils.isAbsolute(path)) path = join(this.root, path);"," if (exists(path)) return path;",""," // <path>/index.<engine>"," path = join(dirname(path), basename(path, ext), 'index' + ext);"," if (exists(path)) return path;","};","","/**"," * Render with the given `options` and callback `fn(err, str)`."," *"," * @param {Object} options"," * @param {Function} fn"," * @api private"," */","","View.prototype.render = function(options, fn){"," this.engine(this.path, options, fn);","};"];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
/*!
|
|
3
2
|
* Express - HTTPServer
|
|
4
3
|
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
|
|
@@ -571,7 +570,7 @@ app.all = function(path){
|
|
|
571
570
|
var args = arguments;
|
|
572
571
|
if (1 == args.length) return this.routes.lookup('all', path);
|
|
573
572
|
methods.forEach(function(method){
|
|
574
|
-
if ('all' == method) return;
|
|
573
|
+
if ('all' == method || 'del' == method) return;
|
|
575
574
|
app[method].apply(this, args);
|
|
576
575
|
}, this);
|
|
577
576
|
return this;
|
|
@@ -135,8 +135,8 @@ req.accepts = function(type){
|
|
|
135
135
|
// normalize extensions ".json" -> "json"
|
|
136
136
|
if (type && '.' == type[0]) type = type.substr(1);
|
|
137
137
|
|
|
138
|
-
// when Accept does not exist, or
|
|
139
|
-
if (!accept || '*/*'
|
|
138
|
+
// when Accept does not exist, or contains '*/*' return true
|
|
139
|
+
if (!accept || ~accept.indexOf('*/*')) {
|
|
140
140
|
return true;
|
|
141
141
|
} else if (type) {
|
|
142
142
|
// allow "html" vs "text/html" etc
|
|
@@ -54,6 +54,14 @@ var RFC5323 = ['SEARCH'];
|
|
|
54
54
|
|
|
55
55
|
var RFC5789 = ['PATCH'];
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* PURGE Method for caching reverse-proxy
|
|
59
|
+
* http://wiki.squid-cache.org/SquidFaq/OperatingSquid#How_can_I_purge_an_object_from_my_cache.3F
|
|
60
|
+
* https://www.varnish-cache.org/docs/trunk/tutorial/purging.html
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
var CACHE_PURGE = ['PURGE'];
|
|
64
|
+
|
|
57
65
|
/**
|
|
58
66
|
* Expose the methods.
|
|
59
67
|
*/
|
|
@@ -65,6 +73,7 @@ module.exports = [].concat(
|
|
|
65
73
|
, RFC3648
|
|
66
74
|
, RFC3744
|
|
67
75
|
, RFC5323
|
|
68
|
-
, RFC5789
|
|
76
|
+
, RFC5789
|
|
77
|
+
, CACHE_PURGE).map(function(method){
|
|
69
78
|
return method.toLowerCase();
|
|
70
79
|
});
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
var http = require('http')
|
|
14
14
|
, parse = require('url').parse
|
|
15
|
-
, assert = require('assert')
|
|
15
|
+
, assert = require('assert')
|
|
16
|
+
, utils = require('./utils');
|
|
16
17
|
|
|
17
18
|
// environment
|
|
18
19
|
|
|
@@ -169,7 +170,7 @@ Server.prototype.handle = function(req, res, out) {
|
|
|
169
170
|
res.statusCode = 404;
|
|
170
171
|
res.setHeader('Content-Type', 'text/plain');
|
|
171
172
|
if ('HEAD' == req.method) return res.end();
|
|
172
|
-
res.end('Cannot ' + req.method + ' ' + req.
|
|
173
|
+
res.end('Cannot ' + req.method + ' ' + utils.escape(req.originalUrl));
|
|
173
174
|
}
|
|
174
175
|
return;
|
|
175
176
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Formidable
|
|
2
2
|
|
|
3
|
-
[](http://travis-ci.org/felixge/node-formidable)
|
|
3
|
+
[](http://travis-ci.org/felixge/node-formidable)
|
|
4
4
|
|
|
5
5
|
## Purpose
|
|
6
6
|
|
|
@@ -22,6 +22,23 @@ a large variety of clients and is considered production-ready.
|
|
|
22
22
|
|
|
23
23
|
## Changelog
|
|
24
24
|
|
|
25
|
+
### v1.0.9
|
|
26
|
+
|
|
27
|
+
* Emit progress when content length header parsed (Tim Koschützki)
|
|
28
|
+
* Fix Readme syntax due to GitHub changes (goob)
|
|
29
|
+
* Replace references to old 'sys' module in Readme with 'util' (Peter Sugihara)
|
|
30
|
+
|
|
31
|
+
### v1.0.8
|
|
32
|
+
|
|
33
|
+
* Strip potentially unsafe characters when using `keepExtensions: true`.
|
|
34
|
+
* Switch to utest / urun for testing
|
|
35
|
+
* Add travis build
|
|
36
|
+
|
|
37
|
+
### v1.0.7
|
|
38
|
+
|
|
39
|
+
* Remove file from package that was causing problems when installing on windows. (#102)
|
|
40
|
+
* Fix typos in Readme (Jason Davies).
|
|
41
|
+
|
|
25
42
|
### v1.0.6
|
|
26
43
|
|
|
27
44
|
* Do not default to the default to the field name for file uploads where
|
|
@@ -125,7 +142,7 @@ Parse an incoming file upload.
|
|
|
125
142
|
var formidable = require('formidable'),
|
|
126
143
|
http = require('http'),
|
|
127
144
|
|
|
128
|
-
|
|
145
|
+
util = require('util');
|
|
129
146
|
|
|
130
147
|
http.createServer(function(req, res) {
|
|
131
148
|
if (req.url == '/upload' && req.method.toLowerCase() == 'post') {
|
|
@@ -134,7 +151,7 @@ Parse an incoming file upload.
|
|
|
134
151
|
form.parse(req, function(err, fields, files) {
|
|
135
152
|
res.writeHead(200, {'content-type': 'text/plain'});
|
|
136
153
|
res.write('received upload:\n\n');
|
|
137
|
-
res.end(
|
|
154
|
+
res.end(util.inspect({fields: fields, files: files}));
|
|
138
155
|
});
|
|
139
156
|
return;
|
|
140
157
|
}
|
|
@@ -154,43 +171,43 @@ Parse an incoming file upload.
|
|
|
154
171
|
|
|
155
172
|
### formidable.IncomingForm
|
|
156
173
|
|
|
157
|
-
|
|
174
|
+
__new formidable.IncomingForm()__
|
|
158
175
|
|
|
159
176
|
Creates a new incoming form.
|
|
160
177
|
|
|
161
|
-
|
|
178
|
+
__incomingForm.encoding = 'utf-8'__
|
|
162
179
|
|
|
163
180
|
The encoding to use for incoming form fields.
|
|
164
181
|
|
|
165
|
-
|
|
182
|
+
__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__
|
|
166
183
|
|
|
167
184
|
The directory for placing file uploads in. You can move them later on using
|
|
168
185
|
`fs.rename()`. The default directory is picked at module load time depending on
|
|
169
186
|
the first existing directory from those listed above.
|
|
170
187
|
|
|
171
|
-
|
|
188
|
+
__incomingForm.keepExtensions = false__
|
|
172
189
|
|
|
173
190
|
If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`.
|
|
174
191
|
|
|
175
|
-
|
|
192
|
+
__incomingForm.type__
|
|
176
193
|
|
|
177
194
|
Either 'multipart' or 'urlencoded' depending on the incoming request.
|
|
178
195
|
|
|
179
|
-
|
|
196
|
+
__incomingForm.maxFieldsSize = 2 * 1024 * 1024__
|
|
180
197
|
|
|
181
198
|
Limits the amount of memory a field (not file) can allocate in bytes.
|
|
182
199
|
If this value is exceeded, an `'error'` event is emitted. The default
|
|
183
200
|
size is 2MB.
|
|
184
201
|
|
|
185
|
-
|
|
202
|
+
__incomingForm.bytesReceived__
|
|
186
203
|
|
|
187
204
|
The amount of bytes received for this form so far.
|
|
188
205
|
|
|
189
|
-
|
|
206
|
+
__incomingForm.bytesExpected__
|
|
190
207
|
|
|
191
208
|
The expected number of bytes in this form.
|
|
192
209
|
|
|
193
|
-
|
|
210
|
+
__incomingForm.parse(request, [cb])__
|
|
194
211
|
|
|
195
212
|
Parses an incoming node.js `request` containing form data. If `cb` is provided, all fields an files are collected and passed to the callback:
|
|
196
213
|
|
|
@@ -198,7 +215,7 @@ Parses an incoming node.js `request` containing form data. If `cb` is provided,
|
|
|
198
215
|
// ...
|
|
199
216
|
});
|
|
200
217
|
|
|
201
|
-
|
|
218
|
+
__incomingForm.onPart(part)__
|
|
202
219
|
|
|
203
220
|
You may overwrite this method if you are interested in directly accessing the multipart stream. Doing so will disable any `'field'` / `'file'` events processing which would occur otherwise, making you fully responsible for handling the processing.
|
|
204
221
|
|
|
@@ -219,56 +236,56 @@ If you want to use formidable to only handle certain parts for you, you can do s
|
|
|
219
236
|
|
|
220
237
|
Check the code in this method for further inspiration.
|
|
221
238
|
|
|
222
|
-
|
|
239
|
+
__Event: 'progress' (bytesReceived, bytesExpected)__
|
|
223
240
|
|
|
224
241
|
Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.
|
|
225
242
|
|
|
226
|
-
|
|
243
|
+
__Event: 'field' (name, value)__
|
|
227
244
|
|
|
228
245
|
Emitted whenever a field / value pair has been received.
|
|
229
246
|
|
|
230
|
-
|
|
247
|
+
__Event: 'fileBegin' (name, file)__
|
|
231
248
|
|
|
232
249
|
Emitted whenever a new file is detected in the upload stream. Use this even if
|
|
233
250
|
you want to stream the file to somewhere else while buffering the upload on
|
|
234
251
|
the file system.
|
|
235
252
|
|
|
236
|
-
|
|
253
|
+
__Event: 'file' (name, file)__
|
|
237
254
|
|
|
238
255
|
Emitted whenever a field / file pair has been received. `file` is an instance of `File`.
|
|
239
256
|
|
|
240
|
-
|
|
257
|
+
__Event: 'error' (err)__
|
|
241
258
|
|
|
242
259
|
Emitted when there is an error processing the incoming form. A request that experiences an error is automatically paused, you will have to manually call `request.resume()` if you want the request to continue firing `'data'` events.
|
|
243
260
|
|
|
244
|
-
|
|
261
|
+
__Event: 'aborted'__
|
|
245
262
|
|
|
246
263
|
Emitted when the request was aborted by the user. Right now this can be due to a 'timeout' or 'close' event on the socket. In the future there will be a separate 'timeout' event (needs a change in the node core).
|
|
247
264
|
|
|
248
|
-
|
|
265
|
+
__Event: 'end' ()__
|
|
249
266
|
|
|
250
267
|
Emitted when the entire request has been received, and all contained files have finished flushing to disk. This is a great place for you to send your response.
|
|
251
268
|
|
|
252
269
|
### formidable.File
|
|
253
270
|
|
|
254
|
-
|
|
271
|
+
__file.size = 0__
|
|
255
272
|
|
|
256
273
|
The size of the uploaded file in bytes. If the file is still being uploaded (see `'fileBegin'` event), this property says how many bytes of the file have been written to disk yet.
|
|
257
274
|
|
|
258
|
-
|
|
275
|
+
__file.path = null__
|
|
259
276
|
|
|
260
277
|
The path this file is being written to. You can modify this in the `'fileBegin'` event in
|
|
261
278
|
case you are unhappy with the way formidable generates a temporary path for your files.
|
|
262
279
|
|
|
263
|
-
|
|
280
|
+
__file.name = null__
|
|
264
281
|
|
|
265
282
|
The name this file had according to the uploading client.
|
|
266
283
|
|
|
267
|
-
|
|
284
|
+
__file.type = null__
|
|
268
285
|
|
|
269
286
|
The mime type of this file, according to the uploading client.
|
|
270
287
|
|
|
271
|
-
|
|
288
|
+
__file.lastModifiedDate = null__
|
|
272
289
|
|
|
273
290
|
A date object (or `null`) containing the time this file was last written to. Mostly
|
|
274
291
|
here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).
|