freezerwatch 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/CODE_OF_CONDUCT.md +13 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +21 -0
  6. data/README.md +40 -0
  7. data/Rakefile +1 -0
  8. data/bin/console +14 -0
  9. data/bin/freezerwatch +9 -0
  10. data/bin/setup +7 -0
  11. data/freezerwatch.gemspec +23 -0
  12. data/lib/freezerwatch.rb +5 -0
  13. data/lib/freezerwatch/version.rb +3 -0
  14. data/node_modules/.bin/freezerwatch +139 -0
  15. data/node_modules/freezerwatch/.npmignore +3 -0
  16. data/node_modules/freezerwatch/.ruby-version +1 -0
  17. data/node_modules/freezerwatch/Gemfile +4 -0
  18. data/node_modules/freezerwatch/Gemfile.lock +79 -0
  19. data/node_modules/freezerwatch/LICENSE +23 -0
  20. data/node_modules/freezerwatch/README.md +41 -0
  21. data/node_modules/freezerwatch/Rakefile +13 -0
  22. data/node_modules/freezerwatch/freezerwatch.js +139 -0
  23. data/node_modules/freezerwatch/metrics/bigfiles_high_water_mark +1 -0
  24. data/node_modules/freezerwatch/metrics/cane_high_water_mark +1 -0
  25. data/node_modules/freezerwatch/metrics/flay_high_water_mark +1 -0
  26. data/node_modules/freezerwatch/metrics/flog_high_water_mark +1 -0
  27. data/node_modules/freezerwatch/metrics/punchlist_high_water_mark +2 -0
  28. data/node_modules/freezerwatch/metrics/reek_high_water_mark +1 -0
  29. data/node_modules/freezerwatch/metrics/rubocop_high_water_mark +1 -0
  30. data/node_modules/freezerwatch/node_modules/async/.jshintrc +25 -0
  31. data/node_modules/freezerwatch/node_modules/async/.travis.yml +6 -0
  32. data/node_modules/freezerwatch/node_modules/async/CHANGELOG.md +65 -0
  33. data/node_modules/freezerwatch/node_modules/async/LICENSE +19 -0
  34. data/node_modules/freezerwatch/node_modules/async/README.md +1803 -0
  35. data/node_modules/freezerwatch/node_modules/async/bower.json +43 -0
  36. data/node_modules/freezerwatch/node_modules/async/component.json +17 -0
  37. data/node_modules/freezerwatch/node_modules/async/coverage/base.css +182 -0
  38. data/node_modules/freezerwatch/node_modules/async/coverage/index.html +73 -0
  39. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/base.css +182 -0
  40. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/index.html +73 -0
  41. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/async.js.html +3900 -0
  42. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/lib/index.html +73 -0
  43. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.css +1 -0
  44. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/prettify.js +1 -0
  45. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  46. data/node_modules/freezerwatch/node_modules/async/coverage/lcov-report/sorter.js +156 -0
  47. data/node_modules/freezerwatch/node_modules/async/coverage/lcov.info +1452 -0
  48. data/node_modules/freezerwatch/node_modules/async/coverage/lib/async.js.html +3597 -0
  49. data/node_modules/freezerwatch/node_modules/async/coverage/lib/index.html +73 -0
  50. data/node_modules/freezerwatch/node_modules/async/coverage/prettify.css +1 -0
  51. data/node_modules/freezerwatch/node_modules/async/coverage/prettify.js +1 -0
  52. data/node_modules/freezerwatch/node_modules/async/coverage/sort-arrow-sprite.png +0 -0
  53. data/node_modules/freezerwatch/node_modules/async/coverage/sorter.js +156 -0
  54. data/node_modules/freezerwatch/node_modules/async/lib/async.js +1191 -0
  55. data/node_modules/freezerwatch/node_modules/async/nyc_output/5074.json +1 -0
  56. data/node_modules/freezerwatch/node_modules/async/package.json +96 -0
  57. data/node_modules/freezerwatch/node_modules/async/support/sync-package-managers.js +53 -0
  58. data/node_modules/freezerwatch/node_modules/lacrosse/.npmignore +15 -0
  59. data/node_modules/freezerwatch/node_modules/lacrosse/Client.js +60 -0
  60. data/node_modules/freezerwatch/node_modules/lacrosse/Device.js +38 -0
  61. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceRawReadStream.js +36 -0
  62. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceSingleRawReadStream.js +29 -0
  63. data/node_modules/freezerwatch/node_modules/lacrosse/DeviceStream.js +35 -0
  64. data/node_modules/freezerwatch/node_modules/lacrosse/LICENSE +23 -0
  65. data/node_modules/freezerwatch/node_modules/lacrosse/README.md +25 -0
  66. data/node_modules/freezerwatch/node_modules/lacrosse/index.js +1 -0
  67. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.npmignore +2 -0
  68. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/.travis.yml +12 -0
  69. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/LICENSE +55 -0
  70. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/README.md +364 -0
  71. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/index.js +156 -0
  72. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/copy.js +8 -0
  73. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/debug.js +7 -0
  74. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/getSafe.js +34 -0
  75. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/lib/optional.js +5 -0
  76. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/.bin/uuid +26 -0
  77. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/LICENSE +55 -0
  78. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/README.md +4 -0
  79. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/index.js +202 -0
  80. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/aws-sign2/package.json +46 -0
  81. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/LICENSE +55 -0
  82. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/README.md +4 -0
  83. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/index.js +119 -0
  84. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/forever-agent/package.json +45 -0
  85. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/License +19 -0
  86. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/Readme.md +175 -0
  87. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/lib/form_data.js +351 -0
  88. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/.travis.yml +5 -0
  89. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/LICENSE +19 -0
  90. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/README.md +1647 -0
  91. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/bower.json +38 -0
  92. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/component.json +16 -0
  93. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +1123 -0
  94. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/package.json +84 -0
  95. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +53 -0
  96. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/License +19 -0
  97. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md +132 -0
  98. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js +188 -0
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +60 -0
  116. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/form-data/package.json +80 -0
  117. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.npmignore +18 -0
  118. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/.travis.yml +5 -0
  119. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/LICENSE +24 -0
  120. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/Makefile +10 -0
  121. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/README.md +627 -0
  122. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/example/usage.js +78 -0
  123. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/hawk.png +0 -0
  124. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/images/logo.png +0 -0
  125. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/index.js +1 -0
  126. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/browser.js +485 -0
  127. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/client.js +367 -0
  128. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/crypto.js +111 -0
  129. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/index.js +15 -0
  130. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/server.js +524 -0
  131. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/lib/utils.js +183 -0
  132. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +18 -0
  133. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +5 -0
  134. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE +24 -0
  135. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/Makefile +11 -0
  136. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/README.md +6 -0
  137. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/images/boom.png +0 -0
  138. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/index.js +1 -0
  139. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +207 -0
  140. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/package.json +64 -0
  141. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +245 -0
  142. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -0
  143. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +5 -0
  144. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE +24 -0
  145. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +11 -0
  146. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +6 -0
  147. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +1 -0
  148. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +68 -0
  149. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +65 -0
  150. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +101 -0
  151. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore +18 -0
  152. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +5 -0
  153. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +33 -0
  154. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +10 -0
  155. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +436 -0
  156. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
  157. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +1 -0
  158. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +132 -0
  159. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +585 -0
  160. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +70 -0
  161. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +86 -0
  162. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +1078 -0
  163. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +1 -0
  164. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +1 -0
  165. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +1 -0
  166. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +18 -0
  167. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +5 -0
  168. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE +24 -0
  169. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +11 -0
  170. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +68 -0
  171. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +16 -0
  172. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +25 -0
  173. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/index.js +1 -0
  174. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js +409 -0
  175. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +65 -0
  176. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +359 -0
  177. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/package.json +70 -0
  178. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/browser.js +771 -0
  179. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/client.js +206 -0
  180. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/crypto.js +86 -0
  181. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/index.js +316 -0
  182. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/message.js +246 -0
  183. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/readme.js +98 -0
  184. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/server.js +686 -0
  185. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/uri.js +456 -0
  186. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/hawk/test/utils.js +120 -0
  187. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.dir-locals.el +6 -0
  188. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/.npmignore +7 -0
  189. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/LICENSE +18 -0
  190. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/README.md +79 -0
  191. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/http_signing.md +296 -0
  192. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/index.js +26 -0
  193. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/parser.js +304 -0
  194. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/signer.js +178 -0
  195. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/util.js +304 -0
  196. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/lib/verify.js +42 -0
  197. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore +2 -0
  198. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE +19 -0
  199. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md +50 -0
  200. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js +13 -0
  201. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js +27 -0
  202. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js +267 -0
  203. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js +36 -0
  204. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js +317 -0
  205. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js +20 -0
  206. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +63 -0
  207. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js +172 -0
  208. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js +296 -0
  209. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md +126 -0
  210. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js +245 -0
  211. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +45 -0
  212. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/.npmignore +1 -0
  213. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG +78 -0
  214. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE +24 -0
  215. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README +82 -0
  216. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old +298 -0
  217. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js +245 -0
  218. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js +1485 -0
  219. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js +944 -0
  220. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype +241 -0
  221. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +42 -0
  222. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf +129 -0
  223. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle +839 -0
  224. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/http-signature/package.json +72 -0
  225. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/.npmignore +1 -0
  226. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
  227. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/LICENSE +15 -0
  228. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/Makefile +35 -0
  229. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/README.md +52 -0
  230. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/package.json +68 -0
  231. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/stringify.js +27 -0
  232. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts +2 -0
  233. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
  234. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/LICENSE +19 -0
  235. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/README.md +66 -0
  236. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/mime.js +114 -0
  237. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/package.json +57 -0
  238. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/test.js +84 -0
  239. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/mime.types +1588 -0
  240. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/mime/types/node.types +77 -0
  241. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/.npmignore +2 -0
  242. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/LICENSE.md +21 -0
  243. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/README.md +243 -0
  244. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/README.md +53 -0
  245. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +174 -0
  246. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/bench.sh +34 -0
  247. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c +34 -0
  248. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js +84 -0
  249. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bin/uuid +26 -0
  250. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/bower.json +23 -0
  251. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/component.json +18 -0
  252. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/package.json +65 -0
  253. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/compare_v1.js +63 -0
  254. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.html +17 -0
  255. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/test/test.js +228 -0
  256. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/node-uuid/uuid.js +247 -0
  257. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/LICENSE +55 -0
  258. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/README.md +4 -0
  259. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/index.js +43 -0
  260. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/package.json +48 -0
  261. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/oauth-sign/test.js +49 -0
  262. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.gitmodules +6 -0
  263. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/.npmignore +7 -0
  264. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/Readme.md +58 -0
  265. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/index.js +366 -0
  266. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/qs/package.json +55 -0
  267. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.jshintrc +72 -0
  268. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/.npmignore +3 -0
  269. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/LICENSE +78 -0
  270. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/README.md +380 -0
  271. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +230 -0
  272. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/cookie.js +947 -0
  273. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/memstore.js +102 -0
  274. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +69 -0
  275. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/LICENSE-MIT.txt +20 -0
  276. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/README.md +176 -0
  277. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/package.json +81 -0
  278. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/node_modules/punycode/punycode.js +530 -0
  279. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/package.json +63 -0
  280. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/public-suffix.txt +5229 -0
  281. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tough-cookie/test.js +1340 -0
  282. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/LICENSE +55 -0
  283. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/README.md +4 -0
  284. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/index.js +227 -0
  285. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/node_modules/tunnel-agent/package.json +45 -0
  286. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/package.json +74 -0
  287. data/node_modules/freezerwatch/node_modules/lacrosse/node_modules/request/request.js +1244 -0
  288. data/node_modules/freezerwatch/node_modules/lacrosse/package.json +34 -0
  289. data/node_modules/freezerwatch/node_modules/optparse/README.md +163 -0
  290. data/node_modules/freezerwatch/node_modules/optparse/TODO +1 -0
  291. data/node_modules/freezerwatch/node_modules/optparse/examples/browser-test.html +75 -0
  292. data/node_modules/freezerwatch/node_modules/optparse/examples/nodejs-test.js +86 -0
  293. data/node_modules/freezerwatch/node_modules/optparse/lib/optparse.js +309 -0
  294. data/node_modules/freezerwatch/node_modules/optparse/package.json +46 -0
  295. data/node_modules/freezerwatch/node_modules/optparse/seed.yml +5 -0
  296. data/node_modules/freezerwatch/node_modules/osenv/.npmignore +13 -0
  297. data/node_modules/freezerwatch/node_modules/osenv/.travis.yml +9 -0
  298. data/node_modules/freezerwatch/node_modules/osenv/LICENSE +15 -0
  299. data/node_modules/freezerwatch/node_modules/osenv/README.md +63 -0
  300. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/index.js +24 -0
  301. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/license +21 -0
  302. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/package.json +70 -0
  303. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-homedir/readme.md +33 -0
  304. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/index.js +25 -0
  305. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/license +21 -0
  306. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/package.json +70 -0
  307. data/node_modules/freezerwatch/node_modules/osenv/node_modules/os-tmpdir/readme.md +36 -0
  308. data/node_modules/freezerwatch/node_modules/osenv/osenv.js +72 -0
  309. data/node_modules/freezerwatch/node_modules/osenv/package.json +76 -0
  310. data/node_modules/freezerwatch/node_modules/osenv/test/unix.js +71 -0
  311. data/node_modules/freezerwatch/node_modules/osenv/test/windows.js +74 -0
  312. data/node_modules/freezerwatch/node_modules/osenv/x.tap +39 -0
  313. data/node_modules/freezerwatch/package.json +37 -0
  314. metadata +384 -0
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "cryptiles",
3
+ "description": "General purpose crypto utilities",
4
+ "version": "0.2.2",
5
+ "author": {
6
+ "name": "Eran Hammer",
7
+ "email": "eran@hueniverse.com",
8
+ "url": "http://hueniverse.com"
9
+ },
10
+ "contributors": [],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git://github.com/hueniverse/cryptiles.git"
14
+ },
15
+ "main": "index",
16
+ "keywords": [
17
+ "cryptography",
18
+ "security",
19
+ "utilites"
20
+ ],
21
+ "engines": {
22
+ "node": ">=0.8.0"
23
+ },
24
+ "dependencies": {
25
+ "boom": "0.4.x"
26
+ },
27
+ "devDependencies": {
28
+ "lab": "0.1.x",
29
+ "complexity-report": "0.x.x"
30
+ },
31
+ "scripts": {
32
+ "test": "make test-cov"
33
+ },
34
+ "licenses": [
35
+ {
36
+ "type": "BSD",
37
+ "url": "http://github.com/hueniverse/cryptiles/raw/master/LICENSE"
38
+ }
39
+ ],
40
+ "bugs": {
41
+ "url": "https://github.com/hueniverse/cryptiles/issues"
42
+ },
43
+ "_id": "cryptiles@0.2.2",
44
+ "dist": {
45
+ "shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c",
46
+ "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz"
47
+ },
48
+ "_from": "cryptiles@>=0.2.0 <0.3.0",
49
+ "_npmVersion": "1.2.24",
50
+ "_npmUser": {
51
+ "name": "hueniverse",
52
+ "email": "eran@hueniverse.com"
53
+ },
54
+ "maintainers": [
55
+ {
56
+ "name": "hueniverse",
57
+ "email": "eran@hueniverse.com"
58
+ }
59
+ ],
60
+ "directories": {},
61
+ "_shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c",
62
+ "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz",
63
+ "readme": "ERROR: No README data found!",
64
+ "homepage": "https://github.com/hueniverse/cryptiles#readme"
65
+ }
@@ -0,0 +1,101 @@
1
+ // Load modules
2
+
3
+ var Lab = require('lab');
4
+ var Cryptiles = require('../lib');
5
+
6
+
7
+ // Declare internals
8
+
9
+ var internals = {};
10
+
11
+
12
+ // Test shortcuts
13
+
14
+ var expect = Lab.expect;
15
+ var before = Lab.before;
16
+ var after = Lab.after;
17
+ var describe = Lab.experiment;
18
+ var it = Lab.test;
19
+
20
+
21
+ describe('Cryptiles', function () {
22
+
23
+ describe('#randomString', function () {
24
+
25
+ it('should generate the right length string', function (done) {
26
+
27
+ for (var i = 1; i <= 1000; ++i) {
28
+ expect(Cryptiles.randomString(i).length).to.equal(i);
29
+ }
30
+
31
+ done();
32
+ });
33
+
34
+ it('returns an error on invalid bits size', function (done) {
35
+
36
+ expect(Cryptiles.randomString(99999999999999999999).message).to.equal('Failed generating random bits: Argument #1 must be number > 0');
37
+ done();
38
+ });
39
+ });
40
+
41
+ describe('#randomBits', function () {
42
+
43
+ it('returns an error on invalid input', function (done) {
44
+
45
+ expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count');
46
+ done();
47
+ });
48
+ });
49
+
50
+ describe('#fixedTimeComparison', function () {
51
+
52
+ var a = Cryptiles.randomString(50000);
53
+ var b = Cryptiles.randomString(150000);
54
+
55
+ it('should take the same amount of time comparing different string sizes', function (done) {
56
+
57
+ var now = Date.now();
58
+ Cryptiles.fixedTimeComparison(b, a);
59
+ var t1 = Date.now() - now;
60
+
61
+ now = Date.now();
62
+ Cryptiles.fixedTimeComparison(b, b);
63
+ var t2 = Date.now() - now;
64
+
65
+ expect(t2 - t1).to.be.within(-20, 20);
66
+ done();
67
+ });
68
+
69
+ it('should return true for equal strings', function (done) {
70
+
71
+ expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true);
72
+ done();
73
+ });
74
+
75
+ it('should return false for different strings (size, a < b)', function (done) {
76
+
77
+ expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false);
78
+ done();
79
+ });
80
+
81
+ it('should return false for different strings (size, a > b)', function (done) {
82
+
83
+ expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false);
84
+ done();
85
+ });
86
+
87
+ it('should return false for different strings (size, a = b)', function (done) {
88
+
89
+ expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false);
90
+ done();
91
+ });
92
+
93
+ it('should return false when not a string', function (done) {
94
+
95
+ expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false);
96
+ done();
97
+ });
98
+ });
99
+ });
100
+
101
+
@@ -0,0 +1,18 @@
1
+ .idea
2
+ *.iml
3
+ npm-debug.log
4
+ dump.rdb
5
+ node_modules
6
+ results.tap
7
+ results.xml
8
+ npm-shrinkwrap.json
9
+ config.json
10
+ .DS_Store
11
+ */.DS_Store
12
+ */*/.DS_Store
13
+ ._*
14
+ */._*
15
+ */*/._*
16
+ coverage.*
17
+ lib-cov
18
+ complexity.md
@@ -0,0 +1,33 @@
1
+ Copyright (c) 2011-2013, Walmart.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+ * Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ * Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+ * Neither the name of Walmart nor the
12
+ names of its contributors may be used to endorse or promote products
13
+ derived from this software without specific prior written permission.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL WALMART BE LIABLE FOR ANY
19
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+
27
+ * * *
28
+
29
+
30
+ Portions of this project were initially based on Postmile, Copyright (c) 2011, Yahoo Inc.
31
+ Postmile is published at https://github.com/yahoo/postmile and its licensing terms are
32
+ published at https://github.com/yahoo/postmile/blob/master/LICENSE.
33
+
@@ -0,0 +1,10 @@
1
+ test:
2
+ @node node_modules/lab/bin/lab
3
+ test-cov:
4
+ @node node_modules/lab/bin/lab -r threshold -t 100
5
+ test-cov-html:
6
+ @node node_modules/lab/bin/lab -r html -o coverage.html
7
+ complexity:
8
+ @node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib
9
+
10
+ .PHONY: test test-cov test-cov-html complexity
@@ -0,0 +1,436 @@
1
+ <a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
2
+ ![hoek Logo](https://raw.github.com/spumko/hoek/master/images/hoek.png)
3
+
4
+ General purpose node utilities
5
+
6
+ [![Build Status](https://secure.travis-ci.org/spumko/hoek.png)](http://travis-ci.org/spumko/hoek)
7
+
8
+ # Table of Contents
9
+
10
+ * [Introduction](#introduction "Introduction")
11
+ * [Object](#object "Object")
12
+ * [clone](#cloneobj "clone")
13
+ * [merge](#mergetarget-source-isnulloverride-ismergearrays "merge")
14
+ * [applyToDefaults](#applytodefaultsdefaults-options "applyToDefaults")
15
+ * [unique](#uniquearray-key "unique")
16
+ * [mapToObject](#maptoobjectarray-key "mapToObject")
17
+ * [intersect](#intersectarray1-array2 "intersect")
18
+ * [matchKeys](#matchkeysobj-keys "matchKeys")
19
+ * [flatten](#flattenarray-target "flatten")
20
+ * [removeKeys](#removekeysobject-keys "removeKeys")
21
+ * [reach](#reachobj-chain "reach")
22
+ * [inheritAsync](#inheritasyncself-obj-keys "inheritAsync")
23
+ * [rename](#renameobj-from-to "rename")
24
+ * [Timer](#timer "Timer")
25
+ * [Binary Encoding/Decoding](#binary "Binary Encoding/Decoding")
26
+ * [base64urlEncode](#binary64urlEncodevalue "binary64urlEncode")
27
+ * [base64urlDecode](#binary64urlDecodevalue "binary64urlDecode")
28
+ * [Escaping Characters](#escaped "Escaping Characters")
29
+ * [escapeHtml](#escapeHtmlstring "escapeHtml")
30
+ * [escapeHeaderAttribute](#escapeHeaderAttributeattribute "escapeHeaderAttribute")
31
+ * [escapeRegex](#escapeRegexstring "escapeRegex")
32
+ * [Errors](#errors "Errors")
33
+ * [assert](#assertmessage "assert")
34
+ * [abort](#abortmessage "abort")
35
+ * [displayStack](#displayStackslice "displayStack")
36
+ * [callStack](#callStackslice "callStack")
37
+ * [toss](#tosscondition "toss")
38
+ * [Load files](#load-files "Load Files")
39
+ * [loadPackage](#loadPackagedir "loadpackage")
40
+ * [loadDirModules](#loadDirModulespath-excludefiles-target "loaddirmodules")
41
+
42
+
43
+
44
+ # Introduction
45
+
46
+ The *Hoek* general purpose node utilities library is used to aid in a variety of manners. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.
47
+
48
+ For example, to use Hoek to set configuration with default options:
49
+ ```javascript
50
+ var Hoek = require('hoek');
51
+
52
+ var default = {url : "www.github.com", port : "8000", debug : true}
53
+
54
+ var config = Hoek.applyToDefaults(default, {port : "3000", admin : true});
55
+
56
+ // In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }
57
+ ```
58
+
59
+ Under each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the var Hoek = require('hoek') is omitted for brevity.
60
+
61
+ ## Object
62
+
63
+ Hoek provides several helpful methods for objects and arrays.
64
+
65
+ ### clone(obj)
66
+
67
+ This method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects).
68
+
69
+ ```javascript
70
+
71
+ var nestedObj = {
72
+ w: /^something$/ig,
73
+ x: {
74
+ a: [1, 2, 3],
75
+ b: 123456,
76
+ c: new Date()
77
+ },
78
+ y: 'y',
79
+ z: new Date()
80
+ };
81
+
82
+ var copy = Hoek.clone(nestedObj);
83
+
84
+ copy.x.b = 100;
85
+
86
+ console.log(copy.y) // results in 'y'
87
+ console.log(nestedObj.x.b) // results in 123456
88
+ console.log(copy.x.b) // results in 100
89
+ ```
90
+
91
+ ### merge(target, source, isNullOverride, isMergeArrays)
92
+ isNullOverride, isMergeArrays default to true
93
+
94
+ Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied
95
+
96
+
97
+ ```javascript
98
+
99
+ var target = {a: 1, b : 2}
100
+ var source = {a: 0, c: 5}
101
+ var source2 = {a: null, c: 5}
102
+
103
+ var targetArray = [1, 2, 3];
104
+ var sourceArray = [4, 5];
105
+
106
+ var newTarget = Hoek.merge(target, source); // results in {a: 0, b: 2, c: 5}
107
+ newTarget = Hoek.merge(target, source2); // results in {a: null, b: 2, c: 5}
108
+ newTarget = Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}
109
+
110
+ newTarget = Hoek.merge(targetArray, sourceArray) // results in [1, 2, 3, 4, 5]
111
+ newTarget = Hoek.merge(targetArray, sourceArray, true, false) // results in [4, 5]
112
+
113
+
114
+
115
+
116
+ ```
117
+
118
+ ### applyToDefaults(defaults, options)
119
+
120
+ Apply options to a copy of the defaults
121
+
122
+ ```javascript
123
+
124
+ var defaults = {host: "localhost", port: 8000};
125
+ var options = {port: 8080};
126
+
127
+ var config = Hoek.applyToDefaults(defaults, options); // results in {host: "localhost", port: 8080};
128
+
129
+
130
+ ```
131
+
132
+ ### unique(array, key)
133
+
134
+ Remove duplicate items from Array
135
+
136
+ ```javascript
137
+
138
+ var array = [1, 2, 2, 3, 3, 4, 5, 6];
139
+
140
+ var newArray = Hoek.unique(array); // results in [1,2,3,4,5,6];
141
+
142
+ array = [{id: 1}, {id: 1}, {id: 2}];
143
+
144
+ newArray = Hoek.unique(array, "id") // results in [{id: 1}, {id: 2}]
145
+
146
+ ```
147
+
148
+ ### mapToObject(array, key)
149
+
150
+ Convert an Array into an Object
151
+
152
+ ```javascript
153
+
154
+ var array = [1,2,3];
155
+ var newObject = Hoek.mapToObject(array); // results in [{"1": true}, {"2": true}, {"3": true}]
156
+
157
+ array = [{id: 1}, {id: 2}];
158
+ newObject = Hoek.mapToObject(array, "id") // results in [{"id": 1}, {"id": 2}]
159
+
160
+ ```
161
+ ### intersect(array1, array2)
162
+
163
+ Find the common unique items in two arrays
164
+
165
+ ```javascript
166
+
167
+ var array1 = [1, 2, 3];
168
+ var array2 = [1, 4, 5];
169
+
170
+ var newArray = Hoek.intersect(array1, array2) // results in [1]
171
+
172
+ ```
173
+
174
+ ### matchKeys(obj, keys)
175
+
176
+ Find which keys are present
177
+
178
+ ```javascript
179
+
180
+ var obj = {a: 1, b: 2, c: 3};
181
+ var keys = ["a", "e"];
182
+
183
+ Hoek.matchKeys(obj, keys) // returns ["a"]
184
+
185
+ ```
186
+
187
+ ### flatten(array, target)
188
+
189
+ Flatten an array
190
+
191
+ ```javascript
192
+
193
+ var array = [1, 2, 3];
194
+ var target = [4, 5];
195
+
196
+ var flattenedArray = Hoek.flatten(array, target) // results in [4, 5, 1, 2, 3];
197
+
198
+ ```
199
+
200
+ ### removeKeys(object, keys)
201
+
202
+ Remove keys
203
+
204
+ ```javascript
205
+
206
+ var object = {a: 1, b: 2, c: 3, d: 4};
207
+
208
+ var keys = ["a", "b"];
209
+
210
+ Hoek.removeKeys(object, keys) // object is now {c: 3, d: 4}
211
+
212
+ ```
213
+
214
+ ### reach(obj, chain)
215
+
216
+ Converts an object key chain string to reference
217
+
218
+ ```javascript
219
+
220
+ var chain = 'a.b.c';
221
+ var obj = {a : {b : { c : 1}}};
222
+
223
+ Hoek.reach(obj, chain) // returns 1
224
+
225
+ ```
226
+
227
+ ### inheritAsync(self, obj, keys)
228
+
229
+ Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors
230
+
231
+ ```javascript
232
+
233
+ var targetFunc = function () { };
234
+
235
+ var proto = {
236
+ a: function () {
237
+ return 'a!';
238
+ },
239
+ b: function () {
240
+ return 'b!';
241
+ },
242
+ c: function () {
243
+ throw new Error('c!');
244
+ }
245
+ };
246
+
247
+ var keys = ['a', 'c'];
248
+
249
+ Hoek.inheritAsync(targetFunc, proto, ['a', 'c']);
250
+
251
+ var target = new targetFunc();
252
+
253
+ target.a(function(err, result){console.log(result)} // returns 'a!'
254
+
255
+ target.c(function(err, result){console.log(result)} // returns undefined
256
+
257
+ target.b(function(err, result){console.log(result)} // gives error: Object [object Object] has no method 'b'
258
+
259
+ ```
260
+
261
+ ### rename(obj, from, to)
262
+
263
+ Rename a key of an object
264
+
265
+ ```javascript
266
+
267
+ var obj = {a : 1, b : 2};
268
+
269
+ Hoek.rename(obj, "a", "c"); // obj is now {c : 1, b : 2}
270
+
271
+ ```
272
+
273
+
274
+ # Timer
275
+
276
+ A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
277
+
278
+ ```javascript
279
+
280
+
281
+ example :
282
+
283
+
284
+ var timerObj = new Hoek.Timer();
285
+ console.log("Time is now: " + timerObj.ts)
286
+ console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds')
287
+
288
+ ```
289
+
290
+ # Binary Encoding/Decoding
291
+
292
+ ### base64urlEncode(value)
293
+
294
+ Encodes value in Base64 or URL encoding
295
+
296
+ ### base64urlDecode(value)
297
+
298
+ Decodes data in Base64 or URL encoding.
299
+ # Escaping Characters
300
+
301
+ Hoek provides convenient methods for escaping html characters. The escaped characters are as followed:
302
+
303
+ ```javascript
304
+
305
+ internals.htmlEscaped = {
306
+ '&': '&amp;',
307
+ '<': '&lt;',
308
+ '>': '&gt;',
309
+ '"': '&quot;',
310
+ "'": '&#x27;',
311
+ '`': '&#x60;'
312
+ };
313
+
314
+ ```
315
+
316
+ ### escapeHtml(string)
317
+
318
+ ```javascript
319
+
320
+ var string = '<html> hey </html>';
321
+ var escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;
322
+
323
+ ```
324
+
325
+ ### escapeHeaderAttribute(attribute)
326
+
327
+ Escape attribute value for use in HTTP header
328
+
329
+ ```javascript
330
+
331
+ var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"'); //returns I said \"go w\\o me\"
332
+
333
+
334
+ ```
335
+
336
+
337
+ ### escapeRegex(string)
338
+
339
+ Escape string for Regex construction
340
+
341
+ ```javascript
342
+
343
+ var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\,
344
+
345
+
346
+
347
+ ```
348
+
349
+ # Errors
350
+
351
+ ### assert(message)
352
+
353
+ ```javascript
354
+
355
+ var a = 1, b =2;
356
+
357
+ Hoek.assert(a === b, 'a should equal b'); // ABORT: a should equal b
358
+
359
+ ```
360
+
361
+ ### abort(message)
362
+
363
+ First checks if process.env.NODE_ENV === 'test', and if so, throws error message. Otherwise,
364
+ displays most recent stack and then exits process.
365
+
366
+
367
+
368
+ ### displayStack(slice)
369
+
370
+ Displays the trace stack
371
+
372
+ ```javascript
373
+
374
+ var stack = Hoek.displayStack();
375
+ console.log(stack) // returns something like:
376
+
377
+ [ 'null (/Users/user/Desktop/hoek/test.js:4:18)',
378
+ 'Module._compile (module.js:449:26)',
379
+ 'Module._extensions..js (module.js:467:10)',
380
+ 'Module.load (module.js:356:32)',
381
+ 'Module._load (module.js:312:12)',
382
+ 'Module.runMain (module.js:492:10)',
383
+ 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]
384
+
385
+ ```
386
+
387
+ ### callStack(slice)
388
+
389
+ Returns a trace stack array.
390
+
391
+ ```javascript
392
+
393
+ var stack = Hoek.callStack();
394
+ console.log(stack) // returns something like:
395
+
396
+ [ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],
397
+ [ 'module.js', 449, 26, 'Module._compile', false ],
398
+ [ 'module.js', 467, 10, 'Module._extensions..js', false ],
399
+ [ 'module.js', 356, 32, 'Module.load', false ],
400
+ [ 'module.js', 312, 12, 'Module._load', false ],
401
+ [ 'module.js', 492, 10, 'Module.runMain', false ],
402
+ [ 'node.js',
403
+ 244,
404
+ 9,
405
+ 'startup.processNextTick.process._tickCallback',
406
+ false ] ]
407
+
408
+
409
+ ```
410
+
411
+ ### toss(condition)
412
+
413
+ toss(condition /*, [message], callback */)
414
+
415
+ Return an error as first argument of a callback
416
+
417
+
418
+ # Load Files
419
+
420
+ ### loadPackage(dir)
421
+
422
+ Load and parse package.json process root or given directory
423
+
424
+ ```javascript
425
+
426
+ var pack = Hoek.loadPackage(); // pack.name === 'hoek'
427
+
428
+ ```
429
+
430
+ ### loadDirModules(path, excludeFiles, target)
431
+
432
+ Loads modules from a given path; option to exclude files (array).
433
+
434
+
435
+
436
+