vulcan 0.3.0 → 0.4.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/bin/vulcan +3 -1
- data/lib/vulcan/cli.rb +22 -3
- data/lib/vulcan/version.rb +1 -1
- data/server/bin/make +1 -3
- data/server/lib/spawner.js +9 -4
- data/server/node_modules/connect-form/node_modules/formidable/Readme.md +13 -2
- data/server/node_modules/connect-form/node_modules/formidable/lib/incoming_form.js +19 -7
- data/server/node_modules/connect-form/node_modules/formidable/lib/multipart_parser.js +12 -1
- data/server/node_modules/connect-form/node_modules/formidable/package.json +1 -1
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/file/plain.txt +1 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +0 -10
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +0 -9
- data/server/node_modules/connect-form/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
- data/server/node_modules/connect-form/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +1 -1
- data/server/node_modules/cradle/lib/cradle.js +0 -1
- data/server/node_modules/cradle/package.json +3 -3
- data/server/node_modules/cradle/test/cache-test.js +6 -7
- data/server/node_modules/cradle/test/cradle-test.js +4 -5
- data/server/node_modules/cradle/test/response-test.js +5 -6
- data/server/node_modules/express/History.md +53 -1
- data/server/node_modules/express/Makefile +3 -9
- data/server/node_modules/express/Readme.md +3 -1
- data/server/node_modules/express/bin/express +65 -66
- data/server/node_modules/express/lib/express.js +1 -1
- data/server/node_modules/express/lib/request.js +23 -9
- data/server/node_modules/express/lib/response.js +3 -2
- data/server/node_modules/express/lib/utils.js +13 -0
- data/server/node_modules/express/lib/view/view.js +2 -1
- data/server/node_modules/express/lib/view.js +19 -16
- data/server/node_modules/express/node_modules/connect/lib/connect.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/http.js +2 -0
- data/server/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js +135 -31
- data/server/node_modules/express/node_modules/connect/lib/middleware/limit.js +5 -1
- data/server/node_modules/express/node_modules/connect/lib/middleware/session.js +2 -2
- data/server/node_modules/express/node_modules/connect/lib/middleware/static.js +26 -21
- data/server/node_modules/express/node_modules/connect/lib/middleware/staticCache.js +91 -38
- data/server/node_modules/express/node_modules/connect/lib/middleware/vhost.js +1 -1
- data/server/node_modules/express/node_modules/connect/lib/utils.js +11 -4
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Makefile +14 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/Readme.md +286 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/TODO +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/benchmark/bench-multipart-parser.js +70 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/post.js +43 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/example/upload.js +48 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/index.js +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/file.js +61 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/incoming_form.js +377 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/index.js +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/multipart_parser.js +312 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/querystring_parser.js +25 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/lib/util.js +6 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/package.json +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/common.js +19 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/funkyfilename.txt +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/file/plain.txt +1 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/no-filename/generic.http +13 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/info.md +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-chrome-13.http +26 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-firefox-3.6.http +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/osx-safari-5.http +23 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-chrome-12.http +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-7.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-ie-8.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/http/special-chars-in-filename/xp-safari-5.http +22 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/no-filename.js +3 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/fixture/js/special-chars-in-filename.js +21 -0
- 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/node_modules/formidable/test/fixture/multipart.js +72 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/integration/test-fixtures.js +89 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/common.js +24 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/integration/test-multipart-parser.js +80 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-file.js +104 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-incoming-form.js +715 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-multipart-parser.js +50 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/simple/test-querystring-parser.js +45 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/legacy/system/test-multi-video-upload.js +72 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/run.js +2 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/test/unit/test-incoming-form.js +63 -0
- data/server/node_modules/express/node_modules/connect/node_modules/formidable/tool/record.js +47 -0
- data/server/node_modules/express/node_modules/connect/package.json +7 -6
- data/server/node_modules/express/node_modules/connect/test.js +44 -31
- data/server/node_modules/express/node_modules/mime/mime.js +3 -3
- data/server/node_modules/express/node_modules/mime/package.json +21 -10
- data/server/node_modules/express/node_modules/mime/test.js +2 -3
- data/server/node_modules/express/node_modules/mime/{mime.types → types/mime.types} +0 -0
- data/server/node_modules/express/node_modules/mime/{node.types → types/node.types} +17 -0
- data/server/node_modules/express/node_modules/mkdirp/LICENSE +21 -0
- data/server/node_modules/express/node_modules/mkdirp/README.markdown +21 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js +6 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.orig +6 -0
- data/server/node_modules/express/node_modules/mkdirp/examples/pow.js.rej +19 -0
- data/server/node_modules/express/node_modules/mkdirp/index.js +20 -0
- data/server/node_modules/express/node_modules/mkdirp/package.json +23 -0
- data/server/node_modules/express/node_modules/mkdirp/test/mkdirp.js +28 -0
- data/server/node_modules/express/node_modules/mkdirp/test/race.js +41 -0
- data/server/node_modules/express/node_modules/mkdirp/test/rel.js +32 -0
- data/server/node_modules/express/node_modules/qs/History.md +11 -0
- data/server/node_modules/express/node_modules/qs/Makefile +1 -3
- data/server/node_modules/express/node_modules/qs/Readme.md +2 -4
- data/server/node_modules/express/node_modules/qs/lib/querystring.js +100 -74
- data/server/node_modules/express/node_modules/qs/package.json +9 -2
- data/server/node_modules/express/node_modules/qs/test/mocha.opts +2 -0
- data/server/node_modules/express/node_modules/qs/test/{parse.test.js → parse.js} +1 -2
- data/server/node_modules/express/node_modules/qs/test/{stringify.test.js → stringify.js} +0 -0
- data/server/node_modules/express/package.json +9 -8
- data/server/node_modules/express/testing/foo/app.js +35 -0
- data/server/node_modules/express/testing/foo/package.json +9 -0
- data/server/node_modules/express/testing/foo/public/stylesheets/style.css +8 -0
- data/server/node_modules/express/testing/foo/routes/index.js +10 -0
- data/server/node_modules/express/testing/foo/views/index.jade +2 -0
- data/server/node_modules/express/testing/foo/views/layout.jade +6 -0
- data/server/node_modules/express/testing/index.js +43 -0
- data/server/node_modules/express/testing/public/test.txt +2971 -0
- data/server/node_modules/express/testing/views/page.html +1 -0
- data/server/node_modules/express/testing/views/page.jade +3 -0
- data/server/node_modules/express/testing/views/test.md +1 -0
- data/server/node_modules/express/testing/views/user/index.jade +1 -0
- data/server/node_modules/express/testing/views/user/list.jade +1 -0
- data/server/node_modules/node-uuid/README.md +166 -67
- data/server/node_modules/node-uuid/benchmark/README.md +53 -0
- data/server/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/server/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/server/node_modules/node-uuid/{test → benchmark}/benchmark-native.c +0 -0
- data/server/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/server/node_modules/node-uuid/package.json +5 -3
- data/server/node_modules/node-uuid/test/benchmark-native +0 -0
- data/server/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/server/node_modules/node-uuid/test/test.html +3 -0
- data/server/node_modules/node-uuid/test/test.js +214 -57
- data/server/node_modules/node-uuid/uuid.js +225 -56
- data/server/node_modules/restler/README.md +20 -7
- data/server/node_modules/restler/bin/restler +1 -1
- data/server/node_modules/restler/lib/multipartform.js +9 -8
- data/server/node_modules/restler/lib/restler.js +64 -22
- data/server/node_modules/restler/package.json +2 -2
- data/server/node_modules/restler/test/restler.js +22 -2
- data/server/node_modules/restler/test/test_helper.js +20 -1
- data/server/package.json +1 -2
- data/server/web.js +30 -7
- metadata +90 -86
- data/server/node_modules/cradle/node_modules/vows/LICENSE +0 -20
- data/server/node_modules/cradle/node_modules/vows/Makefile +0 -7
- data/server/node_modules/cradle/node_modules/vows/README.md +0 -39
- data/server/node_modules/cradle/node_modules/vows/bin/vows +0 -515
- data/server/node_modules/cradle/node_modules/vows/lib/assert/error.js +0 -27
- data/server/node_modules/cradle/node_modules/vows/lib/assert/macros.js +0 -215
- data/server/node_modules/cradle/node_modules/vows/lib/assert/utils.js +0 -77
- data/server/node_modules/cradle/node_modules/vows/lib/vows/console.js +0 -131
- data/server/node_modules/cradle/node_modules/vows/lib/vows/context.js +0 -55
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/file.js +0 -29
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-foot.html +0 -2
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/fragments/coverage-head.html +0 -61
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-html.js +0 -54
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-json.js +0 -54
- data/server/node_modules/cradle/node_modules/vows/lib/vows/coverage/report-plain.js +0 -38
- data/server/node_modules/cradle/node_modules/vows/lib/vows/extras.js +0 -28
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/dot-matrix.js +0 -67
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/json.js +0 -16
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/silent.js +0 -8
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/spec.js +0 -44
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/watch.js +0 -39
- data/server/node_modules/cradle/node_modules/vows/lib/vows/reporters/xunit.js +0 -90
- data/server/node_modules/cradle/node_modules/vows/lib/vows/suite.js +0 -319
- data/server/node_modules/cradle/node_modules/vows/lib/vows.js +0 -193
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/LICENSE +0 -20
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/Makefile +0 -4
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/README.md +0 -72
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/lib/eyes.js +0 -233
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/package.json +0 -14
- data/server/node_modules/cradle/node_modules/vows/node_modules/eyes/test/eyes-test.js +0 -55
- data/server/node_modules/cradle/node_modules/vows/package.json +0 -14
- data/server/node_modules/cradle/node_modules/vows/test/assert-test.js +0 -135
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/failing.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/log.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/passing.js +0 -17
- data/server/node_modules/cradle/node_modules/vows/test/fixtures/isolate/stderr.js +0 -18
- data/server/node_modules/cradle/node_modules/vows/test/isolate-test.js +0 -140
- data/server/node_modules/cradle/node_modules/vows/test/testInherit.js +0 -133
- data/server/node_modules/cradle/node_modules/vows/test/vows-error-test.js +0 -51
- data/server/node_modules/cradle/node_modules/vows/test/vows-test.js +0 -374
- data/server/node_modules/express/node_modules/mime/index.js +0 -1
- data/server/node_modules/express/node_modules/qs/support/expresso/History.md +0 -128
- data/server/node_modules/express/node_modules/qs/support/expresso/Makefile +0 -53
- data/server/node_modules/express/node_modules/qs/support/expresso/Readme.md +0 -61
- data/server/node_modules/express/node_modules/qs/support/expresso/bin/expresso +0 -856
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/api.html +0 -1080
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.html +0 -377
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/index.md +0 -290
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
- data/server/node_modules/express/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/bar.js +0 -4
- data/server/node_modules/express/node_modules/qs/support/expresso/lib/foo.js +0 -16
- data/server/node_modules/express/node_modules/qs/support/expresso/package.json +0 -12
- data/server/node_modules/express/node_modules/qs/support/expresso/test/assert.test.js +0 -91
- data/server/node_modules/express/node_modules/qs/support/expresso/test/async.test.js +0 -12
- data/server/node_modules/express/node_modules/qs/support/expresso/test/bar.test.js +0 -13
- data/server/node_modules/express/node_modules/qs/support/expresso/test/foo.test.js +0 -14
- data/server/node_modules/express/node_modules/qs/support/expresso/test/http.test.js +0 -146
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
- data/server/node_modules/express/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
- data/server/node_modules/express/node_modules/qs/support/should/History.md +0 -22
- data/server/node_modules/express/node_modules/qs/support/should/Makefile +0 -6
- data/server/node_modules/express/node_modules/qs/support/should/Readme.md +0 -248
- data/server/node_modules/express/node_modules/qs/support/should/examples/runner.js +0 -53
- data/server/node_modules/express/node_modules/qs/support/should/index.js +0 -2
- data/server/node_modules/express/node_modules/qs/support/should/lib/eql.js +0 -91
- data/server/node_modules/express/node_modules/qs/support/should/lib/should.js +0 -548
- data/server/node_modules/express/node_modules/qs/support/should/package.json +0 -8
- data/server/node_modules/express/node_modules/qs/support/should/test/should.test.js +0 -358
- data/server/node_modules/node-uuid/test/benchmark.js +0 -27
data/bin/vulcan
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
+
$:.unshift File.expand_path("../../lib", __FILE__)
|
|
4
|
+
|
|
3
5
|
require "net/http/post/multipart"
|
|
4
6
|
require "tmpdir"
|
|
5
7
|
require "uri"
|
|
6
|
-
require
|
|
8
|
+
require "vulcan/cli"
|
|
7
9
|
|
|
8
10
|
Vulcan::CLI.start
|
|
9
11
|
|
data/lib/vulcan/cli.rb
CHANGED
|
@@ -62,15 +62,20 @@ if no COMMAND is specified, a sensible default will be chosen for you
|
|
|
62
62
|
|
|
63
63
|
puts ">> Downloading build artifacts to: #{output}"
|
|
64
64
|
|
|
65
|
+
output_url = "#{server}/output/#{response["X-Make-Id"]}"
|
|
66
|
+
puts " (available at #{output_url})"
|
|
67
|
+
|
|
65
68
|
File.open(output, "w") do |output|
|
|
66
69
|
begin
|
|
67
|
-
output.print RestClient.get(
|
|
70
|
+
output.print RestClient.get(output_url)
|
|
68
71
|
rescue Exception => ex
|
|
69
72
|
puts ex.inspect
|
|
70
73
|
end
|
|
71
74
|
end
|
|
72
75
|
end
|
|
73
76
|
end
|
|
77
|
+
rescue Interrupt
|
|
78
|
+
error "Aborted by user"
|
|
74
79
|
rescue Errno::EPIPE
|
|
75
80
|
error "Could not connect to build server: #{server}"
|
|
76
81
|
end
|
|
@@ -111,17 +116,20 @@ update the build server
|
|
|
111
116
|
error "invalid api key detected, try running `heroku auth:token`" if api_key =~ / /
|
|
112
117
|
|
|
113
118
|
system "git init"
|
|
114
|
-
system "git remote add heroku git
|
|
119
|
+
system "git remote add heroku git@#{heroku_git_domain}:#{config[:app]}.git"
|
|
115
120
|
FileUtils.cp_r "#{server_path}/.", "."
|
|
116
121
|
File.open(".gitignore", "w") do |file|
|
|
117
122
|
file.puts ".env"
|
|
118
123
|
file.puts "node_modules"
|
|
119
124
|
end
|
|
125
|
+
|
|
126
|
+
%x{ env BUNDLE_GEMFILE= heroku config:remove BUILDPACK_URL 2>&1 }
|
|
127
|
+
|
|
120
128
|
system "git add . >/dev/null"
|
|
121
129
|
system "git commit -m commit >/dev/null"
|
|
122
130
|
system "git push heroku -f master"
|
|
123
131
|
|
|
124
|
-
%x{ env BUNDLE_GEMFILE= heroku config:add SECRET=#{config[:secret]} SPAWN_ENV=heroku HEROKU_APP=#{config[:app]} HEROKU_API_KEY=#{api_key} 2>&1 }
|
|
132
|
+
%x{ env BUNDLE_GEMFILE= heroku config:add SECRET=#{config[:secret]} SPAWN_ENV=heroku HEROKU_APP=#{config[:app]} HEROKU_API_KEY=#{api_key} NODE_PATH=lib 2>&1 }
|
|
125
133
|
%x{ env BUNDLE_GEMFILE= heroku addons:add cloudant:oxygen }
|
|
126
134
|
end
|
|
127
135
|
end
|
|
@@ -158,5 +166,16 @@ private
|
|
|
158
166
|
def server_path
|
|
159
167
|
File.expand_path("../../../server", __FILE__)
|
|
160
168
|
end
|
|
169
|
+
|
|
170
|
+
#
|
|
171
|
+
# heroku_git_domain checks to see if the heroku-accounts plugin is present,
|
|
172
|
+
# and if so, it will set the domain to the one that matches the credentials
|
|
173
|
+
# for the currently set account
|
|
174
|
+
#
|
|
175
|
+
def heroku_git_domain
|
|
176
|
+
suffix = %x{ git config heroku.account }
|
|
177
|
+
suffix = "com" if suffix.nil? or suffix.strip == ""
|
|
178
|
+
"heroku.#{suffix.strip}"
|
|
179
|
+
end
|
|
161
180
|
|
|
162
181
|
end
|
data/lib/vulcan/version.rb
CHANGED
data/server/bin/make
CHANGED
|
@@ -35,12 +35,10 @@ Dir.mktmpdir do |dir|
|
|
|
35
35
|
%x{ tar czf #{dir}/output.tgz * 2>&1 }
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
retries = 0
|
|
39
38
|
begin
|
|
40
39
|
doc.put_attachment("output", File.open("#{dir}/output.tgz"))
|
|
41
40
|
rescue RestClient::Conflict
|
|
42
|
-
|
|
43
|
-
retry if retries < 3
|
|
41
|
+
# temporarily work around problem with bigcouch
|
|
44
42
|
end
|
|
45
43
|
|
|
46
44
|
end
|
data/server/lib/spawner.js
CHANGED
|
@@ -62,7 +62,8 @@ var Spawner = function(env) {
|
|
|
62
62
|
restler.post('https://api.heroku.com/apps/' + app + '/ps', {
|
|
63
63
|
headers: {
|
|
64
64
|
'Authorization': auth,
|
|
65
|
-
'Accept': 'application/json'
|
|
65
|
+
'Accept': 'application/json',
|
|
66
|
+
'User-Agent': 'heroku-gem/2.5'
|
|
66
67
|
},
|
|
67
68
|
data: {
|
|
68
69
|
attach: true,
|
|
@@ -72,10 +73,14 @@ var Spawner = function(env) {
|
|
|
72
73
|
}).on('success', function(data) {
|
|
73
74
|
|
|
74
75
|
var url = require('url').parse(data.rendezvous_url);
|
|
75
|
-
var rendezvous = new net.Socket();
|
|
76
76
|
|
|
77
|
-
rendezvous.connect(url.port, url.hostname, function() {
|
|
78
|
-
rendezvous.
|
|
77
|
+
var rendezvous = tls.connect(url.port, url.hostname, function() {
|
|
78
|
+
if (rendezvous.authorized) {
|
|
79
|
+
console.log('valid socket');
|
|
80
|
+
rendezvous.write(url.pathname.substring(1) + '\n');
|
|
81
|
+
} else {
|
|
82
|
+
console.log('invalid socket');
|
|
83
|
+
}
|
|
79
84
|
});
|
|
80
85
|
|
|
81
86
|
rendezvous.on('data', function(data) {
|
|
@@ -20,6 +20,15 @@ a big variety of clients and is considered production-ready.
|
|
|
20
20
|
|
|
21
21
|
## Changelog
|
|
22
22
|
|
|
23
|
+
### v1.0.5
|
|
24
|
+
|
|
25
|
+
* Support filename="" in multipart parts
|
|
26
|
+
* Explain unexpected end() errors in parser better
|
|
27
|
+
|
|
28
|
+
### v1.0.4
|
|
29
|
+
|
|
30
|
+
* Detect a good default tmp directory regardless of plattform. (#88)
|
|
31
|
+
|
|
23
32
|
### v1.0.3
|
|
24
33
|
|
|
25
34
|
* Fix problems with utf8 characters (#84) / semicolons in filenames (#58)
|
|
@@ -142,9 +151,11 @@ Creates a new incoming form.
|
|
|
142
151
|
|
|
143
152
|
The encoding to use for incoming form fields.
|
|
144
153
|
|
|
145
|
-
#### incomingForm.uploadDir = '/tmp'
|
|
154
|
+
#### incomingForm.uploadDir = process.env.TMP || '/tmp' || process.cwd()
|
|
146
155
|
|
|
147
|
-
The directory for placing file uploads in. You can later on move them using
|
|
156
|
+
The directory for placing file uploads in. You can later on move them using
|
|
157
|
+
`fs.rename()`. The default directoy is picked at module load time depending on
|
|
158
|
+
the first existing directory from those listed above.
|
|
148
159
|
|
|
149
160
|
#### incomingForm.keepExtensions = false
|
|
150
161
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
if (global.GENTLY) require = GENTLY.hijack(require);
|
|
2
2
|
|
|
3
|
+
var fs = require('fs');
|
|
3
4
|
var util = require('./util'),
|
|
4
5
|
path = require('path'),
|
|
5
6
|
File = require('./file'),
|
|
@@ -17,7 +18,7 @@ function IncomingForm() {
|
|
|
17
18
|
|
|
18
19
|
this.maxFieldsSize = 2 * 1024 * 1024;
|
|
19
20
|
this.keepExtensions = false;
|
|
20
|
-
this.uploadDir =
|
|
21
|
+
this.uploadDir = IncomingForm.UPLOAD_DIR;
|
|
21
22
|
this.encoding = 'utf-8';
|
|
22
23
|
this.headers = null;
|
|
23
24
|
this.type = null;
|
|
@@ -32,6 +33,20 @@ function IncomingForm() {
|
|
|
32
33
|
util.inherits(IncomingForm, EventEmitter);
|
|
33
34
|
exports.IncomingForm = IncomingForm;
|
|
34
35
|
|
|
36
|
+
IncomingForm.UPLOAD_DIR = (function() {
|
|
37
|
+
var dirs = [process.env.TMP, '/tmp', process.cwd()];
|
|
38
|
+
for (var i = 0; i < dirs.length; i++) {
|
|
39
|
+
var dir = dirs[i];
|
|
40
|
+
var isDirectory = false;
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
isDirectory = fs.statSync(dir).isDirectory();
|
|
44
|
+
} catch (e) {}
|
|
45
|
+
|
|
46
|
+
if (isDirectory) return dir;
|
|
47
|
+
}
|
|
48
|
+
})();
|
|
49
|
+
|
|
35
50
|
IncomingForm.prototype.parse = function(req, cb) {
|
|
36
51
|
this.pause = function() {
|
|
37
52
|
try {
|
|
@@ -147,7 +162,7 @@ IncomingForm.prototype.onPart = function(part) {
|
|
|
147
162
|
IncomingForm.prototype.handlePart = function(part) {
|
|
148
163
|
var self = this;
|
|
149
164
|
|
|
150
|
-
if (
|
|
165
|
+
if (part.filename === undefined) {
|
|
151
166
|
var value = ''
|
|
152
167
|
, decoder = new StringDecoder(this.encoding);
|
|
153
168
|
|
|
@@ -278,10 +293,7 @@ IncomingForm.prototype._initMultipart = function(boundary) {
|
|
|
278
293
|
part.name = m[1];
|
|
279
294
|
}
|
|
280
295
|
|
|
281
|
-
|
|
282
|
-
if (filename) {
|
|
283
|
-
part.filename = filename;
|
|
284
|
-
}
|
|
296
|
+
part.filename = self._fileName(headerValue);
|
|
285
297
|
} else if (headerField == 'content-type') {
|
|
286
298
|
part.mime = headerValue;
|
|
287
299
|
}
|
|
@@ -311,7 +323,7 @@ IncomingForm.prototype._initMultipart = function(boundary) {
|
|
|
311
323
|
};
|
|
312
324
|
|
|
313
325
|
IncomingForm.prototype._fileName = function(headerValue) {
|
|
314
|
-
var m = headerValue.match(/filename="(
|
|
326
|
+
var m = headerValue.match(/filename="(.*?)"($|; )/i)
|
|
315
327
|
if (!m) return;
|
|
316
328
|
|
|
317
329
|
var filename = m[1].substr(m[1].lastIndexOf('\\') + 1);
|
|
@@ -49,6 +49,13 @@ function MultipartParser() {
|
|
|
49
49
|
};
|
|
50
50
|
exports.MultipartParser = MultipartParser;
|
|
51
51
|
|
|
52
|
+
MultipartParser.stateToString = function(stateNumber) {
|
|
53
|
+
for (var state in S) {
|
|
54
|
+
var number = S[state];
|
|
55
|
+
if (number === stateNumber) return state;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
52
59
|
MultipartParser.prototype.initWithBoundary = function(str) {
|
|
53
60
|
this.boundary = new Buffer(str.length+4);
|
|
54
61
|
this.boundary.write('\r\n--', 'ascii', 0);
|
|
@@ -296,6 +303,10 @@ MultipartParser.prototype.write = function(buffer) {
|
|
|
296
303
|
|
|
297
304
|
MultipartParser.prototype.end = function() {
|
|
298
305
|
if (this.state != S.END) {
|
|
299
|
-
return new Error('MultipartParser.end(): stream ended unexpectedly');
|
|
306
|
+
return new Error('MultipartParser.end(): stream ended unexpectedly: ' + this.explain());
|
|
300
307
|
}
|
|
301
308
|
};
|
|
309
|
+
|
|
310
|
+
MultipartParser.prototype.explain = function() {
|
|
311
|
+
return 'state = ' + MultipartParser.stateToString(this.state);
|
|
312
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
I am a plain text file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
POST /upload HTTP/1.1
|
|
2
|
+
Host: localhost:8080
|
|
3
|
+
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytyE4wkKlZ5CQJVTG
|
|
4
|
+
Content-Length: 1000
|
|
5
|
+
|
|
6
|
+
------WebKitFormBoundarytyE4wkKlZ5CQJVTG
|
|
7
|
+
Content-Disposition: form-data; name="upload"; filename=""
|
|
8
|
+
Content-Type: text/plain
|
|
9
|
+
|
|
10
|
+
I am a plain text file
|
|
11
|
+
|
|
12
|
+
------WebKitFormBoundarytyE4wkKlZ5CQJVTG--
|
|
13
|
+
|
|
@@ -24,13 +24,3 @@ Content-Type: text/plain
|
|
|
24
24
|
I am a text file with a funky name!
|
|
25
25
|
|
|
26
26
|
------WebKitFormBoundarytyE4wkKlZ5CQJVTG--
|
|
27
|
-
GET /favicon.ico HTTP/1.1
|
|
28
|
-
Host: localhost:8080
|
|
29
|
-
Connection: keep-alive
|
|
30
|
-
Accept: */*
|
|
31
|
-
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1
|
|
32
|
-
Accept-Encoding: gzip,deflate,sdch
|
|
33
|
-
Accept-Language: en-US,en;q=0.8
|
|
34
|
-
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
|
|
35
|
-
Cookie: jqCookieJar_tablesorter=%7B%22showListTable%22%3A%5B%5B5%2C1%5D%2C%5B1%2C0%5D%5D%7D
|
|
36
|
-
|
|
@@ -22,12 +22,3 @@ Content-Type: text/plain
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
------WebKitFormBoundaryEvqBNplR3ByrwQPa--
|
|
25
|
-
GET /favicon.ico HTTP/1.1
|
|
26
|
-
Host: 192.168.56.1:8080
|
|
27
|
-
Connection: keep-alive
|
|
28
|
-
Accept: */*
|
|
29
|
-
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
|
|
30
|
-
Accept-Encoding: gzip,deflate,sdch
|
|
31
|
-
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
|
|
32
|
-
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
|
|
33
|
-
|
|
@@ -40,7 +40,7 @@ test(function parserError() {
|
|
|
40
40
|
|
|
41
41
|
test(function end() {
|
|
42
42
|
(function testError() {
|
|
43
|
-
assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly');
|
|
43
|
+
assert.equal(parser.end().message, 'MultipartParser.end(): stream ended unexpectedly: ' + parser.explain());
|
|
44
44
|
})();
|
|
45
45
|
|
|
46
46
|
(function testRegular() {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"keywords" : ["couchdb", "database", "couch"],
|
|
6
6
|
"author" : "Alexis Sellier <self@cloudhead.net>",
|
|
7
7
|
"contributors" : [],
|
|
8
|
-
"dependencies" : { "vargs": ">=0.1.0"
|
|
9
|
-
"devDependencies" : { "async": "
|
|
10
|
-
"version" : "0.5.
|
|
8
|
+
"dependencies" : { "vargs": ">=0.1.0" },
|
|
9
|
+
"devDependencies" : { "async": "0.1.x", "request": "2.2.x", "vows": "0.6.x" },
|
|
10
|
+
"version" : "0.5.8",
|
|
11
11
|
"main" : "./lib/cradle",
|
|
12
12
|
"directories" : { "test": "./test" },
|
|
13
13
|
"engines" : { "node": ">=0.3.6" }
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var path = require('path'),
|
|
2
|
-
sys = require('sys'),
|
|
3
2
|
assert = require('assert'),
|
|
4
3
|
events = require('events'),
|
|
5
4
|
vows = require('vows');
|
|
@@ -19,7 +18,7 @@ vows.describe('cradle/Cache').addBatch({
|
|
|
19
18
|
|
|
20
19
|
'should be able to store 8 keys': function (topic) {
|
|
21
20
|
for (var i = 0; i < 8; i++) { topic.save(i.toString(), {}) }
|
|
22
|
-
assert.
|
|
21
|
+
assert.lengthOf (Object.keys(topic.store), 8);
|
|
23
22
|
},
|
|
24
23
|
'if more than 8 keys are set': {
|
|
25
24
|
topic: function (cache) {
|
|
@@ -30,7 +29,7 @@ vows.describe('cradle/Cache').addBatch({
|
|
|
30
29
|
});
|
|
31
30
|
},
|
|
32
31
|
'there should still be 8 keys in the store': function (cache) {
|
|
33
|
-
assert.
|
|
32
|
+
assert.lengthOf (Object.keys(cache.store), 8);
|
|
34
33
|
}
|
|
35
34
|
},
|
|
36
35
|
'if an extra 8 keys are set': {
|
|
@@ -67,10 +66,10 @@ vows.describe('cradle/Cache').addBatch({
|
|
|
67
66
|
}, 10);
|
|
68
67
|
},
|
|
69
68
|
'it should have the 3 accessed ones, with the 5 new ones': function (cache) {
|
|
70
|
-
assert.
|
|
71
|
-
assert.isTrue
|
|
72
|
-
assert.isTrue
|
|
73
|
-
assert.isTrue
|
|
69
|
+
assert.lengthOf (Object.keys(cache.store), 8);
|
|
70
|
+
assert.isTrue (cache.has('2'));
|
|
71
|
+
assert.isTrue (cache.has('5'));
|
|
72
|
+
assert.isTrue (cache.has('1'));
|
|
74
73
|
for (var i = 8; i < 13; i++) { cache.has(i.toString()) }
|
|
75
74
|
}
|
|
76
75
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var path = require('path'),
|
|
2
|
-
sys = require('sys'),
|
|
3
2
|
assert = require('assert'),
|
|
4
3
|
events = require('events'),
|
|
5
4
|
http = require('http'),
|
|
@@ -278,7 +277,7 @@ vows.describe("cradle").addBatch(seed.requireSeed()).addBatch({
|
|
|
278
277
|
"returns a 200": status(200),
|
|
279
278
|
"returns an array of UUIDs": function (uuids) {
|
|
280
279
|
assert.isArray(uuids);
|
|
281
|
-
assert.
|
|
280
|
+
assert.lengthOf(uuids, 42);
|
|
282
281
|
}
|
|
283
282
|
},
|
|
284
283
|
"without count": {
|
|
@@ -287,7 +286,7 @@ vows.describe("cradle").addBatch(seed.requireSeed()).addBatch({
|
|
|
287
286
|
"returns a 200": status(200),
|
|
288
287
|
"returns an array of UUIDs": function (uuids) {
|
|
289
288
|
assert.isArray(uuids);
|
|
290
|
-
assert.
|
|
289
|
+
assert.lengthOf(uuids, 1);
|
|
291
290
|
}
|
|
292
291
|
}
|
|
293
292
|
},
|
|
@@ -497,7 +496,7 @@ vows.describe("cradle").addBatch(seed.requireSeed()).addBatch({
|
|
|
497
496
|
},
|
|
498
497
|
"returns an iterable object with key/val pairs": function (res) {
|
|
499
498
|
assert.isArray(res);
|
|
500
|
-
assert.
|
|
499
|
+
assert.lengthOf(res, 2);
|
|
501
500
|
res.forEach(function (k, v) {
|
|
502
501
|
assert.isObject(v);
|
|
503
502
|
assert.isString(k);
|
|
@@ -528,7 +527,7 @@ vows.describe("cradle").addBatch(seed.requireSeed()).addBatch({
|
|
|
528
527
|
},
|
|
529
528
|
"returns an iterable object with key/val pairs": function (res) {
|
|
530
529
|
assert.isArray(res);
|
|
531
|
-
assert.
|
|
530
|
+
assert.lengthOf(res, 2);
|
|
532
531
|
res.forEach(function (k, v) {
|
|
533
532
|
assert.isObject(v);
|
|
534
533
|
assert.isString(k);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var path = require('path'),
|
|
2
|
-
sys = require('sys'),
|
|
3
2
|
assert = require('assert'),
|
|
4
3
|
events = require('events'),
|
|
5
4
|
http = require('http'),
|
|
@@ -15,7 +14,7 @@ vows.describe('cradle/Response').addBatch({
|
|
|
15
14
|
topic: new(cradle.Response)(document),
|
|
16
15
|
|
|
17
16
|
'should only have the original keys': function (topic) {
|
|
18
|
-
assert.
|
|
17
|
+
assert.lengthOf (Object.keys(topic), 4);
|
|
19
18
|
assert.equal (topic.name, 'buzz');
|
|
20
19
|
assert.equal (topic.age, 99);
|
|
21
20
|
assert.deepEqual (document, topic);
|
|
@@ -29,15 +28,15 @@ vows.describe('cradle/Response').addBatch({
|
|
|
29
28
|
assert.deepEqual (topic.json, document);
|
|
30
29
|
assert.isUndefined (topic.json.json);
|
|
31
30
|
assert.isUndefined (topic.headers);
|
|
32
|
-
assert.
|
|
31
|
+
assert.lengthOf (Object.keys(topic.json), 4);
|
|
33
32
|
},
|
|
34
33
|
'when using a `for .. in` loop, should only return the original keys': function (topic) {
|
|
35
34
|
var keys = [];
|
|
36
35
|
for (var k in topic) { keys.push(k) }
|
|
37
36
|
|
|
38
|
-
assert.
|
|
39
|
-
assert.include
|
|
40
|
-
assert.include
|
|
37
|
+
assert.lengthOf (keys, 4);
|
|
38
|
+
assert.include (keys, 'name');
|
|
39
|
+
assert.include (keys, 'age');
|
|
41
40
|
},
|
|
42
41
|
'should stringify': function (topic) {
|
|
43
42
|
var expected = JSON.stringify(document);
|
|
@@ -1,4 +1,55 @@
|
|
|
1
1
|
|
|
2
|
+
2.5.6 / 2012-01-13
|
|
3
|
+
==================
|
|
4
|
+
|
|
5
|
+
* Updated hamljs dev dep. Closes #953
|
|
6
|
+
|
|
7
|
+
2.5.5 / 2012-01-08
|
|
8
|
+
==================
|
|
9
|
+
|
|
10
|
+
* Fixed: set `filename` on cached templates [matthewleon]
|
|
11
|
+
|
|
12
|
+
2.5.4 / 2012-01-02
|
|
13
|
+
==================
|
|
14
|
+
|
|
15
|
+
* Fixed `express(1)` eol on 0.4.x. Closes #947
|
|
16
|
+
|
|
17
|
+
2.5.3 / 2011-12-30
|
|
18
|
+
==================
|
|
19
|
+
|
|
20
|
+
* Fixed `req.is()` when a charset is present
|
|
21
|
+
|
|
22
|
+
2.5.2 / 2011-12-10
|
|
23
|
+
==================
|
|
24
|
+
|
|
25
|
+
* Fixed: express(1) LF -> CRLF for windows
|
|
26
|
+
|
|
27
|
+
2.5.1 / 2011-11-17
|
|
28
|
+
==================
|
|
29
|
+
|
|
30
|
+
* Changed: updated connect to 1.8.x
|
|
31
|
+
* Removed sass.js support from express(1)
|
|
32
|
+
|
|
33
|
+
2.5.0 / 2011-10-24
|
|
34
|
+
==================
|
|
35
|
+
|
|
36
|
+
* Added ./routes dir for generated app by default
|
|
37
|
+
* Added npm install reminder to express(1) app gen
|
|
38
|
+
* Added 0.5.x support
|
|
39
|
+
* Removed `make test-cov` since it wont work with node 0.5.x
|
|
40
|
+
* Fixed express(1) public dir for windows. Closes #866
|
|
41
|
+
|
|
42
|
+
2.4.7 / 2011-10-05
|
|
43
|
+
==================
|
|
44
|
+
|
|
45
|
+
* Added mkdirp to express(1). Closes #795
|
|
46
|
+
* Added simple _json-config_ example
|
|
47
|
+
* Added shorthand for the parsed request's pathname via `req.path`
|
|
48
|
+
* Changed connect dep to 1.7.x to fix npm issue...
|
|
49
|
+
* Fixed `res.redirect()` __HEAD__ support. [reported by xerox]
|
|
50
|
+
* Fixed `req.flash()`, only escape args
|
|
51
|
+
* Fixed absolute path checking on windows. Closes #829 [reported by andrewpmckenzie]
|
|
52
|
+
|
|
2
53
|
2.4.6 / 2011-08-22
|
|
3
54
|
==================
|
|
4
55
|
|
|
@@ -9,7 +60,8 @@
|
|
|
9
60
|
|
|
10
61
|
* Added support for routes to handle errors. Closes #809
|
|
11
62
|
* Added `app.routes.all()`. Closes #803
|
|
12
|
-
* Added "basepath" setting to work in conjunction with reverse proxies etc.
|
|
63
|
+
* Added "basepath" setting to work in conjunction with reverse proxies etc.
|
|
64
|
+
* Refactored `Route` to use a single array of callbacks
|
|
13
65
|
* Added support for multiple callbacks for `app.param()`. Closes #801
|
|
14
66
|
Closes #805
|
|
15
67
|
* Changed: removed .call(self) for route callbacks
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
DOCS = $(shell find docs/*.md)
|
|
3
|
-
HTMLDOCS
|
|
3
|
+
HTMLDOCS = $(DOCS:.md=.html)
|
|
4
4
|
TESTS = $(shell find test/*.test.js)
|
|
5
5
|
|
|
6
6
|
test:
|
|
7
|
-
@NODE_ENV=test ./node_modules/.bin/expresso
|
|
8
|
-
-I lib \
|
|
9
|
-
$(TESTFLAGS) \
|
|
10
|
-
$(TESTS)
|
|
11
|
-
|
|
12
|
-
test-cov:
|
|
13
|
-
@TESTFLAGS=--cov $(MAKE) test
|
|
7
|
+
@NODE_ENV=test ./node_modules/.bin/expresso $(TESTS)
|
|
14
8
|
|
|
15
9
|
docs: $(HTMLDOCS)
|
|
16
10
|
@ echo "... generating TOC"
|
|
@@ -32,4 +26,4 @@ site:
|
|
|
32
26
|
docclean:
|
|
33
27
|
rm -f docs/*.{1,html}
|
|
34
28
|
|
|
35
|
-
.PHONY: site test
|
|
29
|
+
.PHONY: site test docs docclean
|
|
@@ -95,7 +95,9 @@ The following are the major contributors of Express (in no specific order).
|
|
|
95
95
|
|
|
96
96
|
Express 1.x is compatible with node 0.2.x and connect < 1.0.
|
|
97
97
|
|
|
98
|
-
Express 2.x is compatible with node 0.4.x and connect 1.x
|
|
98
|
+
Express 2.x is compatible with node 0.4.x or 0.6.x, and connect 1.x
|
|
99
|
+
|
|
100
|
+
Express 3.x (master) will be compatible with node 0.6.x and connect 2.x
|
|
99
101
|
|
|
100
102
|
## Viewing Examples
|
|
101
103
|
|