freezerwatch 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +40 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/freezerwatch +9 -0
- data/bin/setup +7 -0
- data/freezerwatch.gemspec +23 -0
- data/lib/freezerwatch.rb +5 -0
- data/lib/freezerwatch/version.rb +3 -0
- data/node_modules/.bin/freezerwatch +139 -0
- data/node_modules/freezerwatch/.npmignore +3 -0
- data/node_modules/freezerwatch/.ruby-version +1 -0
- data/node_modules/freezerwatch/Gemfile +4 -0
- data/node_modules/freezerwatch/Gemfile.lock +79 -0
- data/node_modules/freezerwatch/LICENSE +23 -0
- data/node_modules/freezerwatch/README.md +41 -0
- data/node_modules/freezerwatch/Rakefile +13 -0
- data/node_modules/freezerwatch/freezerwatch.js +139 -0
- data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
- data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
- data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
- data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
- data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
- data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
- data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
- data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
- data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
- data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
- data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
- data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
- data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
- data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md +154 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js +99 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js +38 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
- data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
- data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
- data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
- data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
- data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
- data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
- data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
- data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
- data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
- data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
- data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
- data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
- data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
- data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
- data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
- data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
- data/node_modules/freezerwatch/package.json +37 -0
- metadata +384 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# delayed-stream
|
2
|
+
|
3
|
+
Buffers events from a stream until you are ready to handle them.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
``` bash
|
8
|
+
npm install delayed-stream
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
The following example shows how to write a http echo server that delays its
|
14
|
+
response by 1000 ms.
|
15
|
+
|
16
|
+
``` javascript
|
17
|
+
var DelayedStream = require('delayed-stream');
|
18
|
+
var http = require('http');
|
19
|
+
|
20
|
+
http.createServer(function(req, res) {
|
21
|
+
var delayed = DelayedStream.create(req);
|
22
|
+
|
23
|
+
setTimeout(function() {
|
24
|
+
res.writeHead(200);
|
25
|
+
delayed.pipe(res);
|
26
|
+
}, 1000);
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
If you are not using `Stream#pipe`, you can also manually release the buffered
|
31
|
+
events by calling `delayedStream.resume()`:
|
32
|
+
|
33
|
+
``` javascript
|
34
|
+
var delayed = DelayedStream.create(req);
|
35
|
+
|
36
|
+
setTimeout(function() {
|
37
|
+
// Emit all buffered events and resume underlaying source
|
38
|
+
delayed.resume();
|
39
|
+
}, 1000);
|
40
|
+
```
|
41
|
+
|
42
|
+
## Implementation
|
43
|
+
|
44
|
+
In order to use this meta stream properly, here are a few things you should
|
45
|
+
know about the implementation.
|
46
|
+
|
47
|
+
### Event Buffering / Proxying
|
48
|
+
|
49
|
+
All events of the `source` stream are hijacked by overwriting the `source.emit`
|
50
|
+
method. Until node implements a catch-all event listener, this is the only way.
|
51
|
+
|
52
|
+
However, delayed-stream still continues to emit all events it captures on the
|
53
|
+
`source`, regardless of whether you have released the delayed stream yet or
|
54
|
+
not.
|
55
|
+
|
56
|
+
Upon creation, delayed-stream captures all `source` events and stores them in
|
57
|
+
an internal event buffer. Once `delayedStream.release()` is called, all
|
58
|
+
buffered events are emitted on the `delayedStream`, and the event buffer is
|
59
|
+
cleared. After that, delayed-stream merely acts as a proxy for the underlaying
|
60
|
+
source.
|
61
|
+
|
62
|
+
### Error handling
|
63
|
+
|
64
|
+
Error events on `source` are buffered / proxied just like any other events.
|
65
|
+
However, `delayedStream.create` attaches a no-op `'error'` listener to the
|
66
|
+
`source`. This way you only have to handle errors on the `delayedStream`
|
67
|
+
object, rather than in two places.
|
68
|
+
|
69
|
+
### Buffer limits
|
70
|
+
|
71
|
+
delayed-stream provides a `maxDataSize` property that can be used to limit
|
72
|
+
the amount of data being buffered. In order to protect you from bad `source`
|
73
|
+
streams that don't react to `source.pause()`, this feature is enabled by
|
74
|
+
default.
|
75
|
+
|
76
|
+
## API
|
77
|
+
|
78
|
+
### DelayedStream.create(source, [options])
|
79
|
+
|
80
|
+
Returns a new `delayedStream`. Available options are:
|
81
|
+
|
82
|
+
* `pauseStream`
|
83
|
+
* `maxDataSize`
|
84
|
+
|
85
|
+
The description for those properties can be found below.
|
86
|
+
|
87
|
+
### delayedStream.source
|
88
|
+
|
89
|
+
The `source` stream managed by this object. This is useful if you are
|
90
|
+
passing your `delayedStream` around, and you still want to access properties
|
91
|
+
on the `source` object.
|
92
|
+
|
93
|
+
### delayedStream.pauseStream = true
|
94
|
+
|
95
|
+
Whether to pause the underlaying `source` when calling
|
96
|
+
`DelayedStream.create()`. Modifying this property afterwards has no effect.
|
97
|
+
|
98
|
+
### delayedStream.maxDataSize = 1024 * 1024
|
99
|
+
|
100
|
+
The amount of data to buffer before emitting an `error`.
|
101
|
+
|
102
|
+
If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
|
103
|
+
refers to bytes.
|
104
|
+
|
105
|
+
If the underlaying source is emitting JavaScript strings, the size refers to
|
106
|
+
characters.
|
107
|
+
|
108
|
+
If you know what you are doing, you can set this property to `Infinity` to
|
109
|
+
disable this feature. You can also modify this property during runtime.
|
110
|
+
|
111
|
+
### delayedStream.maxDataSize = 1024 * 1024
|
112
|
+
|
113
|
+
The amount of data to buffer before emitting an `error`.
|
114
|
+
|
115
|
+
If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
|
116
|
+
refers to bytes.
|
117
|
+
|
118
|
+
If the underlaying source is emitting JavaScript strings, the size refers to
|
119
|
+
characters.
|
120
|
+
|
121
|
+
If you know what you are doing, you can set this property to `Infinity` to
|
122
|
+
disable this feature.
|
123
|
+
|
124
|
+
### delayedStream.dataSize = 0
|
125
|
+
|
126
|
+
The amount of data buffered so far.
|
127
|
+
|
128
|
+
### delayedStream.readable
|
129
|
+
|
130
|
+
An ECMA5 getter that returns the value of `source.readable`.
|
131
|
+
|
132
|
+
### delayedStream.resume()
|
133
|
+
|
134
|
+
If the `delayedStream` has not been released so far, `delayedStream.release()`
|
135
|
+
is called.
|
136
|
+
|
137
|
+
In either case, `source.resume()` is called.
|
138
|
+
|
139
|
+
### delayedStream.pause()
|
140
|
+
|
141
|
+
Calls `source.pause()`.
|
142
|
+
|
143
|
+
### delayedStream.pipe(dest)
|
144
|
+
|
145
|
+
Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
|
146
|
+
|
147
|
+
### delayedStream.release()
|
148
|
+
|
149
|
+
Emits and clears all events that have been buffered up so far. This does not
|
150
|
+
resume the underlaying source, use `delayedStream.resume()` instead.
|
151
|
+
|
152
|
+
## License
|
153
|
+
|
154
|
+
delayed-stream is licensed under the MIT license.
|
@@ -0,0 +1,99 @@
|
|
1
|
+
var Stream = require('stream').Stream;
|
2
|
+
var util = require('util');
|
3
|
+
|
4
|
+
module.exports = DelayedStream;
|
5
|
+
function DelayedStream() {
|
6
|
+
this.source = null;
|
7
|
+
this.dataSize = 0;
|
8
|
+
this.maxDataSize = 1024 * 1024;
|
9
|
+
this.pauseStream = true;
|
10
|
+
|
11
|
+
this._maxDataSizeExceeded = false;
|
12
|
+
this._released = false;
|
13
|
+
this._bufferedEvents = [];
|
14
|
+
}
|
15
|
+
util.inherits(DelayedStream, Stream);
|
16
|
+
|
17
|
+
DelayedStream.create = function(source, options) {
|
18
|
+
var delayedStream = new this();
|
19
|
+
|
20
|
+
options = options || {};
|
21
|
+
for (var option in options) {
|
22
|
+
delayedStream[option] = options[option];
|
23
|
+
}
|
24
|
+
|
25
|
+
delayedStream.source = source;
|
26
|
+
|
27
|
+
var realEmit = source.emit;
|
28
|
+
source.emit = function() {
|
29
|
+
delayedStream._handleEmit(arguments);
|
30
|
+
return realEmit.apply(source, arguments);
|
31
|
+
};
|
32
|
+
|
33
|
+
source.on('error', function() {});
|
34
|
+
if (delayedStream.pauseStream) {
|
35
|
+
source.pause();
|
36
|
+
}
|
37
|
+
|
38
|
+
return delayedStream;
|
39
|
+
};
|
40
|
+
|
41
|
+
DelayedStream.prototype.__defineGetter__('readable', function() {
|
42
|
+
return this.source.readable;
|
43
|
+
});
|
44
|
+
|
45
|
+
DelayedStream.prototype.resume = function() {
|
46
|
+
if (!this._released) {
|
47
|
+
this.release();
|
48
|
+
}
|
49
|
+
|
50
|
+
this.source.resume();
|
51
|
+
};
|
52
|
+
|
53
|
+
DelayedStream.prototype.pause = function() {
|
54
|
+
this.source.pause();
|
55
|
+
};
|
56
|
+
|
57
|
+
DelayedStream.prototype.release = function() {
|
58
|
+
this._released = true;
|
59
|
+
|
60
|
+
this._bufferedEvents.forEach(function(args) {
|
61
|
+
this.emit.apply(this, args);
|
62
|
+
}.bind(this));
|
63
|
+
this._bufferedEvents = [];
|
64
|
+
};
|
65
|
+
|
66
|
+
DelayedStream.prototype.pipe = function() {
|
67
|
+
var r = Stream.prototype.pipe.apply(this, arguments);
|
68
|
+
this.resume();
|
69
|
+
return r;
|
70
|
+
};
|
71
|
+
|
72
|
+
DelayedStream.prototype._handleEmit = function(args) {
|
73
|
+
if (this._released) {
|
74
|
+
this.emit.apply(this, args);
|
75
|
+
return;
|
76
|
+
}
|
77
|
+
|
78
|
+
if (args[0] === 'data') {
|
79
|
+
this.dataSize += args[1].length;
|
80
|
+
this._checkIfMaxDataSizeExceeded();
|
81
|
+
}
|
82
|
+
|
83
|
+
this._bufferedEvents.push(args);
|
84
|
+
};
|
85
|
+
|
86
|
+
DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
|
87
|
+
if (this._maxDataSizeExceeded) {
|
88
|
+
return;
|
89
|
+
}
|
90
|
+
|
91
|
+
if (this.dataSize <= this.maxDataSize) {
|
92
|
+
return;
|
93
|
+
}
|
94
|
+
|
95
|
+
this._maxDataSizeExceeded = true;
|
96
|
+
var message =
|
97
|
+
'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
|
98
|
+
this.emit('error', new Error(message));
|
99
|
+
};
|
@@ -0,0 +1,42 @@
|
|
1
|
+
{
|
2
|
+
"author": {
|
3
|
+
"name": "Felix Geisendörfer",
|
4
|
+
"email": "felix@debuggable.com",
|
5
|
+
"url": "http://debuggable.com/"
|
6
|
+
},
|
7
|
+
"name": "delayed-stream",
|
8
|
+
"description": "Buffers events from a stream until you are ready to handle them.",
|
9
|
+
"version": "0.0.5",
|
10
|
+
"homepage": "https://github.com/felixge/node-delayed-stream",
|
11
|
+
"repository": {
|
12
|
+
"type": "git",
|
13
|
+
"url": "git://github.com/felixge/node-delayed-stream.git"
|
14
|
+
},
|
15
|
+
"main": "./lib/delayed_stream",
|
16
|
+
"engines": {
|
17
|
+
"node": ">=0.4.0"
|
18
|
+
},
|
19
|
+
"dependencies": {},
|
20
|
+
"devDependencies": {
|
21
|
+
"fake": "0.2.0",
|
22
|
+
"far": "0.0.1"
|
23
|
+
},
|
24
|
+
"_id": "delayed-stream@0.0.5",
|
25
|
+
"_engineSupported": true,
|
26
|
+
"_npmVersion": "1.0.3",
|
27
|
+
"_nodeVersion": "v0.4.9-pre",
|
28
|
+
"_defaultsLoaded": true,
|
29
|
+
"dist": {
|
30
|
+
"shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
|
31
|
+
"tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
|
32
|
+
},
|
33
|
+
"scripts": {},
|
34
|
+
"directories": {},
|
35
|
+
"_shasum": "d4b1f43a93e8296dfe02694f4680bc37a313c73f",
|
36
|
+
"_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz",
|
37
|
+
"_from": "delayed-stream@0.0.5",
|
38
|
+
"bugs": {
|
39
|
+
"url": "https://github.com/felixge/node-delayed-stream/issues"
|
40
|
+
},
|
41
|
+
"readme": "ERROR: No README data found!"
|
42
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
var common = require('../common');
|
2
|
+
var assert = common.assert;
|
3
|
+
var DelayedStream = common.DelayedStream;
|
4
|
+
var http = require('http');
|
5
|
+
|
6
|
+
var UPLOAD = new Buffer(10 * 1024 * 1024);
|
7
|
+
|
8
|
+
var server = http.createServer(function(req, res) {
|
9
|
+
var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length});
|
10
|
+
|
11
|
+
setTimeout(function() {
|
12
|
+
res.writeHead(200);
|
13
|
+
delayed.pipe(res);
|
14
|
+
}, 10);
|
15
|
+
});
|
16
|
+
server.listen(common.PORT, function() {
|
17
|
+
var request = http.request({
|
18
|
+
method: 'POST',
|
19
|
+
port: common.PORT,
|
20
|
+
});
|
21
|
+
|
22
|
+
request.write(UPLOAD);
|
23
|
+
request.end();
|
24
|
+
|
25
|
+
request.on('response', function(res) {
|
26
|
+
var received = 0;
|
27
|
+
res
|
28
|
+
.on('data', function(chunk) {
|
29
|
+
received += chunk.length;
|
30
|
+
})
|
31
|
+
.on('end', function() {
|
32
|
+
assert.equal(received, UPLOAD.length);
|
33
|
+
server.close();
|
34
|
+
});
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
var common = require('../common');
|
2
|
+
var assert = common.assert;
|
3
|
+
var fake = common.fake.create();
|
4
|
+
var DelayedStream = common.DelayedStream;
|
5
|
+
var Stream = require('stream').Stream;
|
6
|
+
|
7
|
+
(function testAutoPause() {
|
8
|
+
var source = new Stream();
|
9
|
+
|
10
|
+
fake.expect(source, 'pause', 1);
|
11
|
+
var delayedStream = DelayedStream.create(source);
|
12
|
+
fake.verify();
|
13
|
+
})();
|
14
|
+
|
15
|
+
(function testDisableAutoPause() {
|
16
|
+
var source = new Stream();
|
17
|
+
fake.expect(source, 'pause', 0);
|
18
|
+
|
19
|
+
var delayedStream = DelayedStream.create(source, {pauseStream: false});
|
20
|
+
fake.verify();
|
21
|
+
})();
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var common = require('../common');
|
2
|
+
var assert = common.assert;
|
3
|
+
var fake = common.fake.create();
|
4
|
+
var DelayedStream = common.DelayedStream;
|
5
|
+
var Stream = require('stream').Stream;
|
6
|
+
|
7
|
+
(function testDelayEventsUntilResume() {
|
8
|
+
var source = new Stream();
|
9
|
+
var delayedStream = DelayedStream.create(source, {pauseStream: false});
|
10
|
+
|
11
|
+
fake.expect(source, 'pause');
|
12
|
+
delayedStream.pause();
|
13
|
+
fake.verify();
|
14
|
+
})();
|
@@ -0,0 +1,48 @@
|
|
1
|
+
var common = require('../common');
|
2
|
+
var assert = common.assert;
|
3
|
+
var fake = common.fake.create();
|
4
|
+
var DelayedStream = common.DelayedStream;
|
5
|
+
var Stream = require('stream').Stream;
|
6
|
+
|
7
|
+
(function testDelayEventsUntilResume() {
|
8
|
+
var source = new Stream();
|
9
|
+
var delayedStream = DelayedStream.create(source, {pauseStream: false});
|
10
|
+
|
11
|
+
// delayedStream must not emit until we resume
|
12
|
+
fake.expect(delayedStream, 'emit', 0);
|
13
|
+
|
14
|
+
// but our original source must emit
|
15
|
+
var params = [];
|
16
|
+
source.on('foo', function(param) {
|
17
|
+
params.push(param);
|
18
|
+
});
|
19
|
+
|
20
|
+
source.emit('foo', 1);
|
21
|
+
source.emit('foo', 2);
|
22
|
+
|
23
|
+
// Make sure delayedStream did not emit, and source did
|
24
|
+
assert.deepEqual(params, [1, 2]);
|
25
|
+
fake.verify();
|
26
|
+
|
27
|
+
// After resume, delayedStream must playback all events
|
28
|
+
fake
|
29
|
+
.stub(delayedStream, 'emit')
|
30
|
+
.times(Infinity)
|
31
|
+
.withArg(1, 'newListener');
|
32
|
+
fake.expect(delayedStream, 'emit', ['foo', 1]);
|
33
|
+
fake.expect(delayedStream, 'emit', ['foo', 2]);
|
34
|
+
fake.expect(source, 'resume');
|
35
|
+
|
36
|
+
delayedStream.resume();
|
37
|
+
fake.verify();
|
38
|
+
|
39
|
+
// Calling resume again will delegate to source
|
40
|
+
fake.expect(source, 'resume');
|
41
|
+
delayedStream.resume();
|
42
|
+
fake.verify();
|
43
|
+
|
44
|
+
// Emitting more events directly leads to them being emitted
|
45
|
+
fake.expect(delayedStream, 'emit', ['foo', 3]);
|
46
|
+
source.emit('foo', 3);
|
47
|
+
fake.verify();
|
48
|
+
})();
|