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,32 @@
|
|
1
|
+
var mkdirp = require('../');
|
2
|
+
var path = require('path');
|
3
|
+
var fs = require('fs');
|
4
|
+
var test = require('tap').test;
|
5
|
+
|
6
|
+
test('async perm', function (t) {
|
7
|
+
t.plan(2);
|
8
|
+
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
|
9
|
+
|
10
|
+
mkdirp(file, 0755, function (err) {
|
11
|
+
if (err) t.fail(err);
|
12
|
+
else path.exists(file, function (ex) {
|
13
|
+
if (!ex) t.fail('file not created')
|
14
|
+
else fs.stat(file, function (err, stat) {
|
15
|
+
if (err) t.fail(err)
|
16
|
+
else {
|
17
|
+
t.equal(stat.mode & 0777, 0755);
|
18
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
19
|
+
t.end();
|
20
|
+
}
|
21
|
+
})
|
22
|
+
})
|
23
|
+
});
|
24
|
+
});
|
25
|
+
|
26
|
+
test('async root perm', function (t) {
|
27
|
+
mkdirp('/tmp', 0755, function (err) {
|
28
|
+
if (err) t.fail(err);
|
29
|
+
t.end();
|
30
|
+
});
|
31
|
+
t.end();
|
32
|
+
});
|
@@ -0,0 +1,39 @@
|
|
1
|
+
var mkdirp = require('../');
|
2
|
+
var path = require('path');
|
3
|
+
var fs = require('fs');
|
4
|
+
var test = require('tap').test;
|
5
|
+
|
6
|
+
test('sync perm', function (t) {
|
7
|
+
t.plan(2);
|
8
|
+
var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
|
9
|
+
|
10
|
+
mkdirp.sync(file, 0755);
|
11
|
+
path.exists(file, function (ex) {
|
12
|
+
if (!ex) t.fail('file not created')
|
13
|
+
else fs.stat(file, function (err, stat) {
|
14
|
+
if (err) t.fail(err)
|
15
|
+
else {
|
16
|
+
t.equal(stat.mode & 0777, 0755);
|
17
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
18
|
+
t.end();
|
19
|
+
}
|
20
|
+
})
|
21
|
+
});
|
22
|
+
});
|
23
|
+
|
24
|
+
test('sync root perm', function (t) {
|
25
|
+
t.plan(1);
|
26
|
+
|
27
|
+
var file = '/tmp';
|
28
|
+
mkdirp.sync(file, 0755);
|
29
|
+
path.exists(file, function (ex) {
|
30
|
+
if (!ex) t.fail('file not created')
|
31
|
+
else fs.stat(file, function (err, stat) {
|
32
|
+
if (err) t.fail(err)
|
33
|
+
else {
|
34
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
35
|
+
t.end();
|
36
|
+
}
|
37
|
+
})
|
38
|
+
});
|
39
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
var mkdirp = require('../');
|
2
|
+
var path = require('path');
|
3
|
+
var fs = require('fs');
|
4
|
+
var test = require('tap').test;
|
5
|
+
|
6
|
+
test('sync', function (t) {
|
7
|
+
t.plan(2);
|
8
|
+
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
9
|
+
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
10
|
+
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
11
|
+
|
12
|
+
var file = '/tmp/' + [x,y,z].join('/');
|
13
|
+
|
14
|
+
var err = mkdirp.sync(file, 0755);
|
15
|
+
if (err) t.fail(err);
|
16
|
+
else path.exists(file, function (ex) {
|
17
|
+
if (!ex) t.fail('file not created')
|
18
|
+
else fs.stat(file, function (err, stat) {
|
19
|
+
if (err) t.fail(err)
|
20
|
+
else {
|
21
|
+
t.equal(stat.mode & 0777, 0755);
|
22
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
23
|
+
t.end();
|
24
|
+
}
|
25
|
+
})
|
26
|
+
})
|
27
|
+
});
|
@@ -0,0 +1,28 @@
|
|
1
|
+
var mkdirp = require('../');
|
2
|
+
var path = require('path');
|
3
|
+
var fs = require('fs');
|
4
|
+
var test = require('tap').test;
|
5
|
+
|
6
|
+
test('implicit mode from umask', function (t) {
|
7
|
+
t.plan(2);
|
8
|
+
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
9
|
+
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
10
|
+
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
11
|
+
|
12
|
+
var file = '/tmp/' + [x,y,z].join('/');
|
13
|
+
|
14
|
+
mkdirp(file, function (err) {
|
15
|
+
if (err) t.fail(err);
|
16
|
+
else path.exists(file, function (ex) {
|
17
|
+
if (!ex) t.fail('file not created')
|
18
|
+
else fs.stat(file, function (err, stat) {
|
19
|
+
if (err) t.fail(err)
|
20
|
+
else {
|
21
|
+
t.equal(stat.mode & 0777, 0777 & (~process.umask()));
|
22
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
23
|
+
t.end();
|
24
|
+
}
|
25
|
+
})
|
26
|
+
})
|
27
|
+
});
|
28
|
+
});
|
@@ -0,0 +1,27 @@
|
|
1
|
+
var mkdirp = require('../');
|
2
|
+
var path = require('path');
|
3
|
+
var fs = require('fs');
|
4
|
+
var test = require('tap').test;
|
5
|
+
|
6
|
+
test('umask sync modes', function (t) {
|
7
|
+
t.plan(2);
|
8
|
+
var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
9
|
+
var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
10
|
+
var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
|
11
|
+
|
12
|
+
var file = '/tmp/' + [x,y,z].join('/');
|
13
|
+
|
14
|
+
var err = mkdirp.sync(file);
|
15
|
+
if (err) t.fail(err);
|
16
|
+
else path.exists(file, function (ex) {
|
17
|
+
if (!ex) t.fail('file not created')
|
18
|
+
else fs.stat(file, function (err, stat) {
|
19
|
+
if (err) t.fail(err)
|
20
|
+
else {
|
21
|
+
t.equal(stat.mode & 0777, (0777 & (~process.umask())));
|
22
|
+
t.ok(stat.isDirectory(), 'target not a directory');
|
23
|
+
t.end();
|
24
|
+
}
|
25
|
+
})
|
26
|
+
})
|
27
|
+
});
|
@@ -1,4 +1,14 @@
|
|
1
1
|
|
2
|
+
0.4.2 / 2012-02-08
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Fixed: ensure objects are created when appropriate not arrays [aheckmann]
|
6
|
+
|
7
|
+
0.4.1 / 2012-01-26
|
8
|
+
==================
|
9
|
+
|
10
|
+
* Fixed stringify()ing numbers. Closes #23
|
11
|
+
|
2
12
|
0.4.0 / 2011-11-21
|
3
13
|
==================
|
4
14
|
|
@@ -8,8 +8,15 @@
|
|
8
8
|
|
9
9
|
## Examples
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
```js
|
12
|
+
var qs = require('qs');
|
13
|
+
|
14
|
+
qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
|
15
|
+
// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
|
16
|
+
|
17
|
+
qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
|
18
|
+
// => user[name]=Tobi&user[email]=tobi%40learnboost.com
|
19
|
+
```
|
13
20
|
|
14
21
|
## Testing
|
15
22
|
|
@@ -9,7 +9,7 @@
|
|
9
9
|
* Library version.
|
10
10
|
*/
|
11
11
|
|
12
|
-
exports.version = '0.4.
|
12
|
+
exports.version = '0.4.2';
|
13
13
|
|
14
14
|
/**
|
15
15
|
* Object#toString() ref for stringify().
|
@@ -21,7 +21,7 @@ var toString = Object.prototype.toString;
|
|
21
21
|
* Cache non-integer test regexp.
|
22
22
|
*/
|
23
23
|
|
24
|
-
var
|
24
|
+
var isint = /^[0-9]+$/;
|
25
25
|
|
26
26
|
function promote(parent, key) {
|
27
27
|
if (parent[key].length == 0) return parent[key] = {};
|
@@ -58,11 +58,11 @@ function parse(parts, parent, key, val) {
|
|
58
58
|
// prop
|
59
59
|
} else if (~part.indexOf(']')) {
|
60
60
|
part = part.substr(0, part.length - 1);
|
61
|
-
if(
|
61
|
+
if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
|
62
62
|
parse(parts, obj, part, val);
|
63
63
|
// key
|
64
64
|
} else {
|
65
|
-
if(
|
65
|
+
if (!isint.test(part) && Array.isArray(obj)) obj = promote(parent, key);
|
66
66
|
parse(parts, obj, part, val);
|
67
67
|
}
|
68
68
|
}
|
@@ -80,7 +80,7 @@ function merge(parent, key, val){
|
|
80
80
|
parse(parts, parent, 'base', val);
|
81
81
|
// optimize
|
82
82
|
} else {
|
83
|
-
if (
|
83
|
+
if (!isint.test(key) && Array.isArray(parent.base)) {
|
84
84
|
var t = {};
|
85
85
|
for (var k in parent.base) t[k] = parent.base[k];
|
86
86
|
parent.base = t;
|
@@ -161,7 +161,7 @@ var stringify = exports.stringify = function(obj, prefix) {
|
|
161
161
|
} else if ('string' == typeof obj) {
|
162
162
|
return stringifyString(obj, prefix);
|
163
163
|
} else {
|
164
|
-
return prefix;
|
164
|
+
return prefix + '=' + obj;
|
165
165
|
}
|
166
166
|
};
|
167
167
|
|
@@ -210,12 +210,14 @@ function stringifyObject(obj, prefix) {
|
|
210
210
|
var ret = []
|
211
211
|
, keys = Object.keys(obj)
|
212
212
|
, key;
|
213
|
+
|
213
214
|
for (var i = 0, len = keys.length; i < len; ++i) {
|
214
215
|
key = keys[i];
|
215
216
|
ret.push(stringify(obj[key], prefix
|
216
217
|
? prefix + '[' + encodeURIComponent(key) + ']'
|
217
218
|
: encodeURIComponent(key)));
|
218
219
|
}
|
220
|
+
|
219
221
|
return ret.join('&');
|
220
222
|
}
|
221
223
|
|
@@ -1,16 +1,34 @@
|
|
1
1
|
{
|
2
2
|
"name": "qs",
|
3
3
|
"description": "querystring parser",
|
4
|
-
"version": "0.4.
|
4
|
+
"version": "0.4.2",
|
5
5
|
"repository": {
|
6
|
-
"type"
|
7
|
-
"url"
|
6
|
+
"type": "git",
|
7
|
+
"url": "git://github.com/visionmedia/node-querystring.git"
|
8
8
|
},
|
9
9
|
"devDependencies": {
|
10
|
-
|
11
|
-
|
10
|
+
"mocha": "*",
|
11
|
+
"should": "*"
|
12
|
+
},
|
13
|
+
"author": {
|
14
|
+
"name": "TJ Holowaychuk",
|
15
|
+
"email": "tj@vision-media.ca",
|
16
|
+
"url": "http://tjholowaychuk.com"
|
12
17
|
},
|
13
|
-
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
|
14
18
|
"main": "index",
|
15
|
-
"engines": {
|
16
|
-
|
19
|
+
"engines": {
|
20
|
+
"node": "*"
|
21
|
+
},
|
22
|
+
"_npmUser": {
|
23
|
+
"name": "ddollar",
|
24
|
+
"email": "ddollar@gmail.com"
|
25
|
+
},
|
26
|
+
"_id": "qs@0.4.2",
|
27
|
+
"dependencies": {},
|
28
|
+
"optionalDependencies": {},
|
29
|
+
"_engineSupported": true,
|
30
|
+
"_npmVersion": "1.1.21",
|
31
|
+
"_nodeVersion": "v0.6.17",
|
32
|
+
"_defaultsLoaded": true,
|
33
|
+
"_from": "qs@0.4.x"
|
34
|
+
}
|
@@ -91,8 +91,12 @@ module.exports = {
|
|
91
91
|
|
92
92
|
qs.parse('user[name][first]=tj&user[name][first]=TJ')
|
93
93
|
.should.eql({ user: { name: { first: ['tj', 'TJ'] }}});
|
94
|
+
|
95
|
+
var o = qs.parse('existing[fcbaebfecc][name][last]=tj')
|
96
|
+
o.should.eql({ existing: { 'fcbaebfecc': { name: { last: 'tj' }}}})
|
97
|
+
Array.isArray(o.existing).should.be.false;
|
94
98
|
},
|
95
|
-
|
99
|
+
|
96
100
|
'test right-hand brackets': function(){
|
97
101
|
qs.parse('pets=["tobi"]')
|
98
102
|
.should.eql({ pets: '["tobi"]' });
|
@@ -139,6 +143,14 @@ module.exports = {
|
|
139
143
|
'test malformed uri': function(){
|
140
144
|
qs.parse('{%:%}').should.eql({ '{%:%}': '' });
|
141
145
|
qs.parse('foo=%:%}').should.eql({ 'foo': '%:%}' });
|
146
|
+
},
|
147
|
+
|
148
|
+
'test semi-parsed': function(){
|
149
|
+
qs.parse({ 'user[name]': 'tobi' })
|
150
|
+
.should.eql({ user: { name: 'tobi' }});
|
151
|
+
|
152
|
+
qs.parse({ 'user[name]': 'tobi', 'user[email][main]': 'tobi@lb.com' })
|
153
|
+
.should.eql({ user: { name: 'tobi', email: { main: 'tobi@lb.com' } }});
|
142
154
|
}
|
143
155
|
|
144
156
|
// 'test complex': function(){
|
@@ -5,19 +5,19 @@
|
|
5
5
|
|
6
6
|
var qs = require('../')
|
7
7
|
, should = require('should')
|
8
|
-
,
|
8
|
+
, str_identities = {
|
9
9
|
'basics': [
|
10
|
-
{
|
11
|
-
{
|
12
|
-
{
|
13
|
-
{
|
14
|
-
{
|
15
|
-
{
|
16
|
-
{
|
10
|
+
{ str: 'foo=bar', obj: {'foo' : 'bar'}},
|
11
|
+
{ str: 'foo=%22bar%22', obj: {'foo' : '\"bar\"'}},
|
12
|
+
{ str: 'foo=', obj: {'foo': ''}},
|
13
|
+
{ str: 'foo=1&bar=2', obj: {'foo' : '1', 'bar' : '2'}},
|
14
|
+
{ str: 'my%20weird%20field=q1!2%22\'w%245%267%2Fz8)%3F', obj: {'my weird field': "q1!2\"'w$5&7/z8)?"}},
|
15
|
+
{ str: 'foo%3Dbaz=bar', obj: {'foo=baz': 'bar'}},
|
16
|
+
{ str: 'foo=bar&bar=baz', obj: {foo: 'bar', bar: 'baz'}}
|
17
17
|
],
|
18
18
|
'escaping': [
|
19
|
-
{
|
20
|
-
{
|
19
|
+
{ str: 'foo=foo%20bar', obj: {foo: 'foo bar'}},
|
20
|
+
{ str: 'cht=p3&chd=t%3A60%2C40&chs=250x100&chl=Hello%7CWorld', obj: {
|
21
21
|
cht: 'p3'
|
22
22
|
, chd: 't:60,40'
|
23
23
|
, chs: '250x100'
|
@@ -25,27 +25,31 @@ var qs = require('../')
|
|
25
25
|
}}
|
26
26
|
],
|
27
27
|
'nested': [
|
28
|
-
{
|
29
|
-
{
|
30
|
-
{
|
31
|
-
{
|
32
|
-
{
|
33
|
-
{
|
34
|
-
{
|
35
|
-
{
|
36
|
-
{
|
37
|
-
{
|
38
|
-
{
|
39
|
-
{
|
40
|
-
{
|
41
|
-
{
|
42
|
-
{
|
43
|
-
{
|
44
|
-
{
|
28
|
+
{ str: 'foo[]=bar&foo[]=quux', obj: {'foo' : ['bar', 'quux']}},
|
29
|
+
{ str: 'foo[]=bar', obj: {foo: ['bar']}},
|
30
|
+
{ str: 'foo[]=1&foo[]=2', obj: {'foo' : ['1', '2']}},
|
31
|
+
{ str: 'foo=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : 'bar', 'baz' : ['1', '2', '3']}},
|
32
|
+
{ str: 'foo[]=bar&baz[]=1&baz[]=2&baz[]=3', obj: {'foo' : ['bar'], 'baz' : ['1', '2', '3']}},
|
33
|
+
{ str: 'x[y][z]=1', obj: {'x' : {'y' : {'z' : '1'}}}},
|
34
|
+
{ str: 'x[y][z][]=1', obj: {'x' : {'y' : {'z' : ['1']}}}},
|
35
|
+
{ str: 'x[y][z]=2', obj: {'x' : {'y' : {'z' : '2'}}}},
|
36
|
+
{ str: 'x[y][z][]=1&x[y][z][]=2', obj: {'x' : {'y' : {'z' : ['1', '2']}}}},
|
37
|
+
{ str: 'x[y][][z]=1', obj: {'x' : {'y' : [{'z' : '1'}]}}},
|
38
|
+
{ str: 'x[y][][z][]=1', obj: {'x' : {'y' : [{'z' : ['1']}]}}},
|
39
|
+
{ str: 'x[y][][z]=1&x[y][][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'w' : '2'}]}}},
|
40
|
+
{ str: 'x[y][][v][w]=1', obj: {'x' : {'y' : [{'v' : {'w' : '1'}}]}}},
|
41
|
+
{ str: 'x[y][][z]=1&x[y][][v][w]=2', obj: {'x' : {'y' : [{'z' : '1', 'v' : {'w' : '2'}}]}}},
|
42
|
+
{ str: 'x[y][][z]=1&x[y][][z]=2', obj: {'x' : {'y' : [{'z' : '1'}, {'z' : '2'}]}}},
|
43
|
+
{ str: 'x[y][][z]=1&x[y][][w]=a&x[y][][z]=2&x[y][][w]=3', obj: {'x' : {'y' : [{'z' : '1', 'w' : 'a'}, {'z' : '2', 'w' : '3'}]}}},
|
44
|
+
{ str: 'user[name][first]=tj&user[name][last]=holowaychuk', obj: { user: { name: { first: 'tj', last: 'holowaychuk' }}}}
|
45
45
|
],
|
46
46
|
'errors': [
|
47
|
-
{
|
48
|
-
{
|
47
|
+
{ obj: 'foo=bar', message: 'stringify expects an object' },
|
48
|
+
{ obj: ['foo', 'bar'], message: 'stringify expects an object' }
|
49
|
+
],
|
50
|
+
'numbers': [
|
51
|
+
{ str: 'limit[]=1&limit[]=2&limit[]=3', obj: { limit: [1, 2, '3'] }},
|
52
|
+
{ str: 'limit=1', obj: { limit: 1 }}
|
49
53
|
]
|
50
54
|
};
|
51
55
|
|
@@ -64,9 +68,9 @@ function err(fn, msg){
|
|
64
68
|
|
65
69
|
function test(type) {
|
66
70
|
var str, obj;
|
67
|
-
for (var i = 0; i <
|
68
|
-
str =
|
69
|
-
obj =
|
71
|
+
for (var i = 0; i < str_identities[type].length; i++) {
|
72
|
+
str = str_identities[type][i].str;
|
73
|
+
obj = str_identities[type][i].obj;
|
70
74
|
qs.stringify(obj).should.eql(str);
|
71
75
|
}
|
72
76
|
}
|
@@ -83,13 +87,17 @@ module.exports = {
|
|
83
87
|
'test nested': function() {
|
84
88
|
test('nested');
|
85
89
|
},
|
90
|
+
|
91
|
+
'test numbers': function(){
|
92
|
+
test('numbers');
|
93
|
+
},
|
86
94
|
|
87
95
|
'test errors': function() {
|
88
|
-
var
|
89
|
-
for (var i = 0; i <
|
90
|
-
message
|
91
|
-
|
92
|
-
err(function(){ qs.stringify(
|
96
|
+
var obj, message;
|
97
|
+
for (var i = 0; i < str_identities['errors'].length; i++) {
|
98
|
+
message = str_identities['errors'][i].message;
|
99
|
+
obj = str_identities['errors'][i].obj;
|
100
|
+
err(function(){ qs.stringify(obj) }, message);
|
93
101
|
}
|
94
102
|
}
|
95
103
|
};
|