vulcan 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,146 @@
|
|
1
|
+
// Generated by CoffeeScript 1.3.3
|
2
|
+
(function() {
|
3
|
+
var Scope, extend, last, _ref;
|
4
|
+
|
5
|
+
_ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
|
6
|
+
|
7
|
+
exports.Scope = Scope = (function() {
|
8
|
+
|
9
|
+
Scope.root = null;
|
10
|
+
|
11
|
+
function Scope(parent, expressions, method) {
|
12
|
+
this.parent = parent;
|
13
|
+
this.expressions = expressions;
|
14
|
+
this.method = method;
|
15
|
+
this.variables = [
|
16
|
+
{
|
17
|
+
name: 'arguments',
|
18
|
+
type: 'arguments'
|
19
|
+
}
|
20
|
+
];
|
21
|
+
this.positions = {};
|
22
|
+
if (!this.parent) {
|
23
|
+
Scope.root = this;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
Scope.prototype.add = function(name, type, immediate) {
|
28
|
+
if (this.shared && !immediate) {
|
29
|
+
return this.parent.add(name, type, immediate);
|
30
|
+
}
|
31
|
+
if (Object.prototype.hasOwnProperty.call(this.positions, name)) {
|
32
|
+
return this.variables[this.positions[name]].type = type;
|
33
|
+
} else {
|
34
|
+
return this.positions[name] = this.variables.push({
|
35
|
+
name: name,
|
36
|
+
type: type
|
37
|
+
}) - 1;
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
Scope.prototype.namedMethod = function() {
|
42
|
+
if (this.method.name || !this.parent) {
|
43
|
+
return this.method;
|
44
|
+
}
|
45
|
+
return this.parent.namedMethod();
|
46
|
+
};
|
47
|
+
|
48
|
+
Scope.prototype.find = function(name) {
|
49
|
+
if (this.check(name)) {
|
50
|
+
return true;
|
51
|
+
}
|
52
|
+
this.add(name, 'var');
|
53
|
+
return false;
|
54
|
+
};
|
55
|
+
|
56
|
+
Scope.prototype.parameter = function(name) {
|
57
|
+
if (this.shared && this.parent.check(name, true)) {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
return this.add(name, 'param');
|
61
|
+
};
|
62
|
+
|
63
|
+
Scope.prototype.check = function(name) {
|
64
|
+
var _ref1;
|
65
|
+
return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0));
|
66
|
+
};
|
67
|
+
|
68
|
+
Scope.prototype.temporary = function(name, index) {
|
69
|
+
if (name.length > 1) {
|
70
|
+
return '_' + name + (index > 1 ? index - 1 : '');
|
71
|
+
} else {
|
72
|
+
return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a');
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|
76
|
+
Scope.prototype.type = function(name) {
|
77
|
+
var v, _i, _len, _ref1;
|
78
|
+
_ref1 = this.variables;
|
79
|
+
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
80
|
+
v = _ref1[_i];
|
81
|
+
if (v.name === name) {
|
82
|
+
return v.type;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
return null;
|
86
|
+
};
|
87
|
+
|
88
|
+
Scope.prototype.freeVariable = function(name, reserve) {
|
89
|
+
var index, temp;
|
90
|
+
if (reserve == null) {
|
91
|
+
reserve = true;
|
92
|
+
}
|
93
|
+
index = 0;
|
94
|
+
while (this.check((temp = this.temporary(name, index)))) {
|
95
|
+
index++;
|
96
|
+
}
|
97
|
+
if (reserve) {
|
98
|
+
this.add(temp, 'var', true);
|
99
|
+
}
|
100
|
+
return temp;
|
101
|
+
};
|
102
|
+
|
103
|
+
Scope.prototype.assign = function(name, value) {
|
104
|
+
this.add(name, {
|
105
|
+
value: value,
|
106
|
+
assigned: true
|
107
|
+
}, true);
|
108
|
+
return this.hasAssignments = true;
|
109
|
+
};
|
110
|
+
|
111
|
+
Scope.prototype.hasDeclarations = function() {
|
112
|
+
return !!this.declaredVariables().length;
|
113
|
+
};
|
114
|
+
|
115
|
+
Scope.prototype.declaredVariables = function() {
|
116
|
+
var realVars, tempVars, v, _i, _len, _ref1;
|
117
|
+
realVars = [];
|
118
|
+
tempVars = [];
|
119
|
+
_ref1 = this.variables;
|
120
|
+
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
121
|
+
v = _ref1[_i];
|
122
|
+
if (v.type === 'var') {
|
123
|
+
(v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
return realVars.sort().concat(tempVars.sort());
|
127
|
+
};
|
128
|
+
|
129
|
+
Scope.prototype.assignedVariables = function() {
|
130
|
+
var v, _i, _len, _ref1, _results;
|
131
|
+
_ref1 = this.variables;
|
132
|
+
_results = [];
|
133
|
+
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
|
134
|
+
v = _ref1[_i];
|
135
|
+
if (v.type.assigned) {
|
136
|
+
_results.push("" + v.name + " = " + v.type.value);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
return _results;
|
140
|
+
};
|
141
|
+
|
142
|
+
return Scope;
|
143
|
+
|
144
|
+
})();
|
145
|
+
|
146
|
+
}).call(this);
|
@@ -0,0 +1,55 @@
|
|
1
|
+
{
|
2
|
+
"name": "coffee-script",
|
3
|
+
"description": "Unfancy JavaScript",
|
4
|
+
"keywords": [
|
5
|
+
"javascript",
|
6
|
+
"language",
|
7
|
+
"coffeescript",
|
8
|
+
"compiler"
|
9
|
+
],
|
10
|
+
"author": {
|
11
|
+
"name": "Jeremy Ashkenas"
|
12
|
+
},
|
13
|
+
"version": "1.3.3",
|
14
|
+
"licenses": [
|
15
|
+
{
|
16
|
+
"type": "MIT",
|
17
|
+
"url": "https://raw.github.com/jashkenas/coffee-script/master/LICENSE"
|
18
|
+
}
|
19
|
+
],
|
20
|
+
"engines": {
|
21
|
+
"node": ">=0.4.0"
|
22
|
+
},
|
23
|
+
"directories": {
|
24
|
+
"lib": "./lib/coffee-script"
|
25
|
+
},
|
26
|
+
"main": "./lib/coffee-script/coffee-script",
|
27
|
+
"bin": {
|
28
|
+
"coffee": "./bin/coffee",
|
29
|
+
"cake": "./bin/cake"
|
30
|
+
},
|
31
|
+
"homepage": "http://coffeescript.org",
|
32
|
+
"bugs": {
|
33
|
+
"name": "https://github.com/jashkenas/coffee-script/issues"
|
34
|
+
},
|
35
|
+
"repository": {
|
36
|
+
"type": "git",
|
37
|
+
"url": "git://github.com/jashkenas/coffee-script.git"
|
38
|
+
},
|
39
|
+
"devDependencies": {
|
40
|
+
"uglify-js": ">=1.0.0",
|
41
|
+
"jison": ">=0.2.0"
|
42
|
+
},
|
43
|
+
"_npmUser": {
|
44
|
+
"name": "ddollar",
|
45
|
+
"email": "ddollar@gmail.com"
|
46
|
+
},
|
47
|
+
"_id": "coffee-script@1.3.3",
|
48
|
+
"dependencies": {},
|
49
|
+
"optionalDependencies": {},
|
50
|
+
"_engineSupported": true,
|
51
|
+
"_npmVersion": "1.1.21",
|
52
|
+
"_nodeVersion": "v0.6.17",
|
53
|
+
"_defaultsLoaded": true,
|
54
|
+
"_from": "coffee-script@1.3.x"
|
55
|
+
}
|
@@ -73,13 +73,11 @@ module.exports = function(options){
|
|
73
73
|
*/
|
74
74
|
|
75
75
|
function formRequest(req) {
|
76
|
-
var contentType = req.headers['content-type'];
|
77
|
-
if (!contentType) return;
|
78
76
|
return req.body === undefined
|
79
77
|
&& (req.method === 'POST'
|
80
78
|
|| req.method === 'PUT')
|
81
|
-
&& (~
|
82
|
-
|| ~
|
79
|
+
&& (~req.headers['content-type'].indexOf('multipart/form-data')
|
80
|
+
|| ~req.headers['content-type'].indexOf('urlencoded'));
|
83
81
|
}
|
84
82
|
|
85
83
|
/**
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Formidable
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/felixge/node-formidable.png?branch=master)](http://travis-ci.org/felixge/node-formidable)
|
4
|
+
|
3
5
|
## Purpose
|
4
6
|
|
5
7
|
A node.js module for parsing form data, especially file uploads.
|
@@ -8,7 +10,7 @@ A node.js module for parsing form data, especially file uploads.
|
|
8
10
|
|
9
11
|
This module was developed for [Transloadit](http://transloadit.com/), a service focused on uploading
|
10
12
|
and encoding images and videos. It has been battle-tested against hundreds of GB of file uploads from
|
11
|
-
a
|
13
|
+
a large variety of clients and is considered production-ready.
|
12
14
|
|
13
15
|
## Features
|
14
16
|
|
@@ -20,14 +22,40 @@ a big variety of clients and is considered production-ready.
|
|
20
22
|
|
21
23
|
## Changelog
|
22
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
|
+
|
42
|
+
### v1.0.6
|
43
|
+
|
44
|
+
* Do not default to the default to the field name for file uploads where
|
45
|
+
filename="".
|
46
|
+
|
23
47
|
### v1.0.5
|
24
48
|
|
25
49
|
* Support filename="" in multipart parts
|
26
50
|
* Explain unexpected end() errors in parser better
|
27
51
|
|
52
|
+
**Note:** Starting with this version, formidable emits 'file' events for empty
|
53
|
+
file input fields. Previously those were incorrectly emitted as regular file
|
54
|
+
input fields with value = "".
|
55
|
+
|
28
56
|
### v1.0.4
|
29
57
|
|
30
|
-
* Detect a good default tmp directory regardless of
|
58
|
+
* Detect a good default tmp directory regardless of platform. (#88)
|
31
59
|
|
32
60
|
### v1.0.3
|
33
61
|
|
@@ -54,8 +82,8 @@ a big variety of clients and is considered production-ready.
|
|
54
82
|
|
55
83
|
* Add support for multipart boundaries that are quoted strings. (Jeff Craig)
|
56
84
|
|
57
|
-
This marks the
|
58
|
-
several
|
85
|
+
This marks the beginning of development on version 2.0 which will include
|
86
|
+
several architectural improvements.
|
59
87
|
|
60
88
|
[See Commits](https://github.com/felixge/node-formidable/compare/v0.9.11...v1.0.0)
|
61
89
|
|
@@ -114,7 +142,7 @@ Parse an incoming file upload.
|
|
114
142
|
var formidable = require('formidable'),
|
115
143
|
http = require('http'),
|
116
144
|
|
117
|
-
|
145
|
+
util = require('util');
|
118
146
|
|
119
147
|
http.createServer(function(req, res) {
|
120
148
|
if (req.url == '/upload' && req.method.toLowerCase() == 'post') {
|
@@ -123,7 +151,7 @@ Parse an incoming file upload.
|
|
123
151
|
form.parse(req, function(err, fields, files) {
|
124
152
|
res.writeHead(200, {'content-type': 'text/plain'});
|
125
153
|
res.write('received upload:\n\n');
|
126
|
-
res.end(
|
154
|
+
res.end(util.inspect({fields: fields, files: files}));
|
127
155
|
});
|
128
156
|
return;
|
129
157
|
}
|
@@ -141,45 +169,45 @@ Parse an incoming file upload.
|
|
141
169
|
|
142
170
|
## API
|
143
171
|
|
144
|
-
###
|
172
|
+
### formidable.IncomingForm
|
145
173
|
|
146
|
-
|
174
|
+
__new formidable.IncomingForm()__
|
147
175
|
|
148
176
|
Creates a new incoming form.
|
149
177
|
|
150
|
-
|
178
|
+
__incomingForm.encoding = 'utf-8'__
|
151
179
|
|
152
180
|
The encoding to use for incoming form fields.
|
153
181
|
|
154
|
-
|
182
|
+
__incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()__
|
155
183
|
|
156
|
-
The directory for placing file uploads in. You can later on
|
157
|
-
`fs.rename()`. The default
|
184
|
+
The directory for placing file uploads in. You can move them later on using
|
185
|
+
`fs.rename()`. The default directory is picked at module load time depending on
|
158
186
|
the first existing directory from those listed above.
|
159
187
|
|
160
|
-
|
188
|
+
__incomingForm.keepExtensions = false__
|
161
189
|
|
162
190
|
If you want the files written to `incomingForm.uploadDir` to include the extensions of the original files, set this property to `true`.
|
163
191
|
|
164
|
-
|
192
|
+
__incomingForm.type__
|
165
193
|
|
166
194
|
Either 'multipart' or 'urlencoded' depending on the incoming request.
|
167
195
|
|
168
|
-
|
196
|
+
__incomingForm.maxFieldsSize = 2 * 1024 * 1024__
|
169
197
|
|
170
198
|
Limits the amount of memory a field (not file) can allocate in bytes.
|
171
|
-
|
199
|
+
If this value is exceeded, an `'error'` event is emitted. The default
|
172
200
|
size is 2MB.
|
173
201
|
|
174
|
-
|
202
|
+
__incomingForm.bytesReceived__
|
175
203
|
|
176
204
|
The amount of bytes received for this form so far.
|
177
205
|
|
178
|
-
|
206
|
+
__incomingForm.bytesExpected__
|
179
207
|
|
180
208
|
The expected number of bytes in this form.
|
181
209
|
|
182
|
-
|
210
|
+
__incomingForm.parse(request, [cb])__
|
183
211
|
|
184
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:
|
185
213
|
|
@@ -187,7 +215,7 @@ Parses an incoming node.js `request` containing form data. If `cb` is provided,
|
|
187
215
|
// ...
|
188
216
|
});
|
189
217
|
|
190
|
-
|
218
|
+
__incomingForm.onPart(part)__
|
191
219
|
|
192
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.
|
193
221
|
|
@@ -208,59 +236,59 @@ If you want to use formidable to only handle certain parts for you, you can do s
|
|
208
236
|
|
209
237
|
Check the code in this method for further inspiration.
|
210
238
|
|
211
|
-
|
239
|
+
__Event: 'progress' (bytesReceived, bytesExpected)__
|
212
240
|
|
213
241
|
Emitted after each incoming chunk of data that has been parsed. Can be used to roll your own progress bar.
|
214
242
|
|
215
|
-
|
243
|
+
__Event: 'field' (name, value)__
|
216
244
|
|
217
245
|
Emitted whenever a field / value pair has been received.
|
218
246
|
|
219
|
-
|
247
|
+
__Event: 'fileBegin' (name, file)__
|
220
248
|
|
221
249
|
Emitted whenever a new file is detected in the upload stream. Use this even if
|
222
250
|
you want to stream the file to somewhere else while buffering the upload on
|
223
251
|
the file system.
|
224
252
|
|
225
|
-
|
253
|
+
__Event: 'file' (name, file)__
|
226
254
|
|
227
255
|
Emitted whenever a field / file pair has been received. `file` is an instance of `File`.
|
228
256
|
|
229
|
-
|
257
|
+
__Event: 'error' (err)__
|
230
258
|
|
231
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.
|
232
260
|
|
233
|
-
|
261
|
+
__Event: 'aborted'__
|
234
262
|
|
235
|
-
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
|
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).
|
236
264
|
|
237
|
-
|
265
|
+
__Event: 'end' ()__
|
238
266
|
|
239
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.
|
240
268
|
|
241
|
-
###
|
269
|
+
### formidable.File
|
242
270
|
|
243
|
-
|
271
|
+
__file.size = 0__
|
244
272
|
|
245
|
-
The size of the
|
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.
|
246
274
|
|
247
|
-
|
275
|
+
__file.path = null__
|
248
276
|
|
249
277
|
The path this file is being written to. You can modify this in the `'fileBegin'` event in
|
250
278
|
case you are unhappy with the way formidable generates a temporary path for your files.
|
251
279
|
|
252
|
-
|
280
|
+
__file.name = null__
|
253
281
|
|
254
282
|
The name this file had according to the uploading client.
|
255
283
|
|
256
|
-
|
284
|
+
__file.type = null__
|
257
285
|
|
258
286
|
The mime type of this file, according to the uploading client.
|
259
287
|
|
260
|
-
|
288
|
+
__file.lastModifiedDate = null__
|
261
289
|
|
262
290
|
A date object (or `null`) containing the time this file was last written to. Mostly
|
263
|
-
here for
|
291
|
+
here for compatibility with the [W3C File API Draft](http://dev.w3.org/2006/webapi/FileAPI/).
|
264
292
|
|
265
293
|
## License
|
266
294
|
|