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,24 @@
1
+ The following license applies to all files unless the file is specified below.
2
+ Each file specified below has its license information embedded in it:
3
+
4
+ tools/jsstyle
5
+
6
+ Copyright 2011, Robert Mustacchi. All rights reserved.
7
+ Copyright 2011, Joyent, Inc. All rights reserved.
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to
10
+ deal in the Software without restriction, including without limitation the
11
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12
+ sell copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in
16
+ all copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24
+ IN THE SOFTWARE.
@@ -0,0 +1,82 @@
1
+ Node-CType is a way to read and write binary data in structured and easy to use
2
+ format. Its name comes from the C header file.
3
+
4
+ To get started, simply clone the repository or use npm to install it. Once it is
5
+ there, simply require it.
6
+
7
+ git clone git://github.com/rmustacc/node-ctype
8
+ npm install ctype
9
+ var mod_ctype = require('ctype')
10
+
11
+
12
+ There are two APIs that you can use, depending on what abstraction you'd like.
13
+ The low level API let's you read and write individual integers and floats from
14
+ buffers. The higher level API let's you read and write structures of these. To
15
+ illustrate this, let's looks look at how we would read and write a binary
16
+ encoded x,y point.
17
+
18
+ In C we would define this structure as follows:
19
+
20
+ typedef struct point {
21
+ uint16_t p_x;
22
+ uint16_t p_y;
23
+ } point_t;
24
+
25
+ To read a binary encoded point from a Buffer, we first need to create a CType
26
+ parser (where we specify the endian and other options) and add the typedef.
27
+
28
+ var parser = new mod_ctype.Parser({ endian: 'big' });
29
+ parser.typedef('point_t', [
30
+ { x: { type: 'uint16_t' } },
31
+ { y: { type: 'uint16_t' } }
32
+ ]);
33
+
34
+ From here, given a buffer buf and an offset into it, we can read a point.
35
+
36
+ var out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);
37
+ console.log(out);
38
+ { point: { x: 23, y: 42 } }
39
+
40
+ Another way to get the same information would be to use the low level methods.
41
+ Note that these require you to manually deal with the offset. Here's how we'd
42
+ get the same values of x and y from the buffer.
43
+
44
+ var x = mod_ctype.ruint16(buf, 'big', 0);
45
+ var y = mod_ctype.ruint16(buf, 'big', 2);
46
+ console.log(x + ', ' + y);
47
+ 23, 42
48
+
49
+ The true power of this API comes from the ability to define and nest typedefs,
50
+ just as you would in C. By default, the following types are defined by default.
51
+ Note that they return a Number, unless indicated otherwise.
52
+
53
+ * int8_t
54
+ * int16_t
55
+ * int32_t
56
+ * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
57
+ * uint8_t
58
+ * uint16_t
59
+ * uint32_t
60
+ * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
61
+ * float
62
+ * double
63
+ * char (either returns a buffer with that character or a uint8_t)
64
+ * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
65
+
66
+
67
+ ctf2json integration:
68
+
69
+ Node-CType supports consuming the output of ctf2json. Once you read in a JSON file,
70
+ all you have to do to add all the definitions it contains is:
71
+
72
+ var data, parser;
73
+ data = JSON.parse(parsedJSONData);
74
+ parser = mod_ctype.parseCTF(data, { endian: 'big' });
75
+
76
+ For more documentation, see the file README.old. Full documentation is in the
77
+ process of being rewritten as a series of manual pages which will be available
78
+ in the repository and online for viewing.
79
+
80
+ To read the ctio manual page simple run, from the root of the workspace:
81
+
82
+ man -Mman -s 3ctype ctio
@@ -0,0 +1,298 @@
1
+ This library provides a way to read and write binary data.
2
+
3
+ Node CType is a way to read and write binary data in structured and easy to use
4
+ formats. It's name comes from the header file, though it does not share as much
5
+ with it as it perhaps should.
6
+
7
+ There are two levels of the API. One is the raw API which everything is built on
8
+ top of, while the other provides a much nicer abstraction and is built entirely
9
+ by using the lower level API. The hope is that the low level API is both clear
10
+ and useful. The low level API gets it's names from stdint.h (a rather
11
+ appropriate source). The lower level API is presented at the end of this
12
+ document.
13
+
14
+ Standard CType API
15
+
16
+ The CType interface is presented as a parser object that controls the
17
+ endianness combined with a series of methods to change that value, parse and
18
+ write out buffers, and a way to provide typedefs. Standard Types
19
+
20
+ The CType parser supports the following basic types which return Numbers except
21
+ as indicated:
22
+
23
+ * int8_t
24
+ * int16_t
25
+ * int32_t
26
+ * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
27
+ * uint8_t
28
+ * uint16_t
29
+ * uint32_t
30
+ * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
31
+ * float
32
+ * double
33
+ * char (returns a buffer with just that single character)
34
+ * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
35
+
36
+ Specifying Structs
37
+
38
+ The CType parser also supports the notion of structs. A struct is an array of
39
+ JSON objects that defines an order of keys which have types and values. One
40
+ would build a struct to represent a point (x,y) as follows:
41
+
42
+ [
43
+ { x: { type: 'int16_t' }},
44
+ { y: { type: 'int16_t' }}
45
+ ]
46
+
47
+ When this is passed into the read routine, it would read the first two bytes
48
+ (as defined by int16_t) to determine the Number to use for X, and then it would
49
+ read the next two bytes to determine the value of Y. When read this could
50
+ return something like:
51
+
52
+ {
53
+ x: 42,
54
+ y: -23
55
+ }
56
+
57
+ When someone wants to write values, we use the same format as above, but with
58
+ additional value field:
59
+
60
+ [
61
+ { x: { type: 'int16_t', value: 42 }},
62
+ { y: { type: 'int16_t', value: -23 }}
63
+ ]
64
+
65
+ Now, the structure above may be optionally annotated with offsets. This tells
66
+ us to rather than read continuously we should read the given value at the
67
+ specified offset. If an offset is provided, it is is effectively the equivalent
68
+ of lseek(offset, SEEK_SET). Thus, subsequent values will be read from that
69
+ offset and incremented by the appropriate value. As an example:
70
+
71
+ [
72
+ { x: { type: 'int16_t' }},
73
+ { y: { type: 'int16_t', offset: 20 }},
74
+ { z: { type: 'int16_t' }}
75
+ ]
76
+
77
+ We would read x from the first starting offset given to us, for the sake of
78
+ example, let's assume that's 0. After reading x, the next offset to read from
79
+ would be 2; however, y specifies an offset, thus we jump directly to that
80
+ offset and read y from byte 20. We would then read z from byte 22.
81
+
82
+ The same offsets may be used when writing values.
83
+
84
+ Typedef
85
+
86
+ The basic set of types while covers the basics, is somewhat limiting. To make
87
+ this richer, there is functionality to typedef something like in C. One can use
88
+ typedef to add a new name to an existing type or to define a name to refer to a
89
+ struct. Thus the following are all examples of a typedef:
90
+
91
+ typedef('size_t', 'uint32_t');
92
+ typedef('ssize_t', 'int32_t');
93
+ typedef('point_t', [
94
+ { x: { type: 'int16_t' }},
95
+ { y: { type: 'int16_t' }}
96
+ ]);
97
+
98
+ Once something has been typedef'd it can be used in any of the definitions
99
+ previously shown.
100
+
101
+ One cannot remove a typedef once created, this is analogous to C.
102
+
103
+ The set of defined types can be printed with lstypes. The format of this output
104
+ is subject to change, but likely will look something like:
105
+
106
+ > lstypes();
107
+ {
108
+ size_t: 'uint32_t',
109
+ ssize_t: 'int32_t',
110
+ point_t: [
111
+ { x: { type: 'int16_t' }},
112
+ { y: { type: 'int16_t' }}
113
+ ]
114
+ }
115
+
116
+ Specifying arrays
117
+
118
+ Arrays can be specified by appending []s to a type. Arrays must have the size
119
+ specified. The size must be specified and it can be done in one of two ways:
120
+
121
+ * An explicit non-zero integer size
122
+ * A name of a previously declared variable in the struct whose value is a
123
+ number.
124
+
125
+ Note, that when using the name of a variable, it should be the string name for
126
+ the key. This is only valid inside structs and the value must be declared
127
+ before the value with the array. The following are examples:
128
+
129
+ [
130
+ { ip_addr4: { type: 'uint8_t[4]' }},
131
+ { len: { type: 'uint32_t' }},
132
+ { data: { type: 'uint8_t[len]' }}
133
+ ]
134
+
135
+ Arrays are permitted in typedefs; however, they must have a declared integer
136
+ size. The following are examples of valid and invalid arrays:
137
+
138
+ typedef('path', 'char[1024]'); /* Good */
139
+ typedef('path', 'char[len]'); /* Bad! */
140
+
141
+ 64 bit values:
142
+
143
+ Unfortunately Javascript represents values with a double, so you lose precision
144
+ and the ability to represent Integers roughly beyond 2^53. To alleviate this, I
145
+ propose the following for returning 64 bit integers when read:
146
+
147
+ value[2]: Each entry is a 32 bit number which can be reconstructed to the
148
+ original by the following formula:
149
+
150
+ value[0] << 32 + value[1] (Note this will not work in Javascript)
151
+
152
+ CTF JSON data:
153
+
154
+ node-ctype can also handle JSON data that mathces the format described in the
155
+ documentation of the tool ctf2json. Given the JSON data which specifies type
156
+ information, it will transform that into a parser that understands all of the
157
+ types defined inside of it. This is useful for more complicated structures that
158
+ have a lot of typedefs.
159
+
160
+ Interface overview
161
+
162
+ The following is the header-file like interface to the parser object:
163
+
164
+ /*
165
+ * Create a new instance of the parser. Each parser has its own store of
166
+ * typedefs and endianness. Conf is an object with the following values:
167
+ *
168
+ * endian Either 'big' or 'little' do determine the endianness we
169
+ * want to read from or write to.
170
+ *
171
+ */
172
+ function CTypeParser(conf);
173
+
174
+ /*
175
+ * Parses the CTF JSON data and creates a parser that understands all of those
176
+ * types.
177
+ *
178
+ * data Parsed JSON data that maches that CTF JSON
179
+ * specification.
180
+ *
181
+ * conf The configuration object to create a new CTypeParser
182
+ * from.
183
+ */
184
+ CTypeParser parseCTF(data, conf);
185
+
186
+ /*
187
+ * This is what we were born to do. We read the data from a buffer and return it
188
+ * in an object whose keys match the values from the object.
189
+ *
190
+ * def The array definition of the data to read in
191
+ *
192
+ * buffer The buffer to read data from
193
+ *
194
+ * offset The offset to start writing to
195
+ *
196
+ * Returns an object where each key corresponds to an entry in def and the value
197
+ * is the read value.
198
+ */
199
+ Object CTypeParser.readData(<Type Definition>, buffer, offset);
200
+
201
+ /*
202
+ * This is the second half of what we were born to do, write out the data
203
+ * itself.
204
+ *
205
+ * def The array definition of the data to write out with
206
+ * values
207
+ *
208
+ * buffer The buffer to write to
209
+ *
210
+ * offset The offset in the buffer to write to
211
+ */
212
+ void CTypeParser.writeData(<Type Definition>, buffer, offset);
213
+
214
+ /*
215
+ * A user has requested to add a type, let us honor their request. Yet, if their
216
+ * request doth spurn us, send them unto the Hells which Dante describes.
217
+ *
218
+ * name The string for the type definition we're adding
219
+ *
220
+ * value Either a string that is a type/array name or an object
221
+ * that describes a struct.
222
+ */
223
+ void CTypeParser.prototype.typedef(name, value);
224
+
225
+ Object CTypeParser.prototype.lstypes();
226
+
227
+ /*
228
+ * Get the endian value for the current parser
229
+ */
230
+ String CTypeParser.prototype.getEndian();
231
+
232
+ /*
233
+ * Sets the current endian value for the Parser. If the value is not valid,
234
+ * throws an Error.
235
+ *
236
+ * endian Either 'big' or 'little' do determine the endianness we
237
+ * want to read from or write to.
238
+ *
239
+ */
240
+ void CTypeParser.protoype.setEndian(String);
241
+
242
+ /*
243
+ * Attempts to convert an array of two integers returned from rsint64 / ruint64
244
+ * into an absolute 64 bit number. If however the value would exceed 2^52 this
245
+ * will instead throw an error. The mantissa in a double is a 52 bit number and
246
+ * rather than potentially give you a value that is an approximation this will
247
+ * error. If you would rather an approximation, please see toApprox64.
248
+ *
249
+ * val An array of two 32-bit integers
250
+ */
251
+ Number function toAbs64(val)
252
+
253
+ /*
254
+ * Will return the 64 bit value as returned in an array from rsint64 / ruint64
255
+ * to a value as close as it can. Note that Javascript stores all numbers as a
256
+ * double and the mantissa only has 52 bits. Thus this version may approximate
257
+ * the value.
258
+ *
259
+ * val An array of two 32-bit integers
260
+ */
261
+ Number function toApprox64(val)
262
+
263
+ Low Level API
264
+
265
+ The following function are provided at the low level:
266
+
267
+ Read unsigned integers from a buffer:
268
+ Number ruint8(buffer, endian, offset);
269
+ Number ruint16(buffer, endian, offset);
270
+ Number ruint32(buffer, endian, offset);
271
+ Number[] ruint64(buffer, endian, offset);
272
+
273
+ Read signed integers from a buffer:
274
+ Number rsint8(buffer, endian, offset);
275
+ Number rsint16(buffer, endian, offset);
276
+ Number rsint32(buffer, endian, offset);
277
+ Number[] rsint64(buffer, endian, offset);
278
+
279
+ Read floating point numbers from a buffer:
280
+ Number rfloat(buffer, endian, offset); /* IEEE-754 Single precision */
281
+ Number rdouble(buffer, endian, offset); /* IEEE-754 Double precision */
282
+
283
+ Write unsigned integers to a buffer:
284
+ void wuint8(Number, endian, buffer, offset);
285
+ void wuint16(Number, endian, buffer, offset);
286
+ void wuint32(Number, endian, buffer, offset);
287
+ void wuint64(Number[], endian, buffer, offset);
288
+
289
+ Write signed integers from a buffer:
290
+ void wsint8(Number, endian, buffer, offset);
291
+ void wsint16(Number, endian, buffer, offset);
292
+ void wsint32(Number, endian, buffer, offset);
293
+ void wsint64(Number[], endian, buffer offset);
294
+
295
+ Write floating point numbers from a buffer:
296
+ void wfloat(Number, buffer, endian, offset); /* IEEE-754 Single precision */
297
+ void wdouble(Number, buffer, endian, offset); /* IEEE-754 Double precision */
298
+
@@ -0,0 +1,245 @@
1
+ /*
2
+ * ctf.js
3
+ *
4
+ * Understand and parse all of the different JSON formats of CTF data and
5
+ * translate that into a series of node-ctype friendly pieces. The reason for
6
+ * the abstraction is to handle different changes in the file format.
7
+ *
8
+ * We have to be careful here that we don't end up using a name that is already
9
+ * a built in type.
10
+ */
11
+ var mod_assert = require('assert');
12
+ var ASSERT = mod_assert.ok;
13
+
14
+ var ctf_versions = [ '1.0' ];
15
+ var ctf_entries = [ 'integer', 'float', 'typedef', 'struct' ];
16
+ var ctf_deftypes = [ 'int8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int32_t',
17
+ 'uint32_t', 'float', 'double' ];
18
+
19
+ function ctfParseInteger(entry, ctype)
20
+ {
21
+ var name, sign, len, type;
22
+
23
+ name = entry['name'];
24
+ if (!('signed' in entry['integer']))
25
+ throw (new Error('Malformed CTF JSON: integer missing ' +
26
+ 'signed value'));
27
+
28
+
29
+ if (!('length' in entry['integer']))
30
+ throw (new Error('Malformed CTF JSON: integer missing ' +
31
+ 'length value'));
32
+
33
+ sign = entry['integer']['signed'];
34
+ len = entry['integer']['length'];
35
+ type = null;
36
+
37
+ if (sign && len == 1)
38
+ type = 'int8_t';
39
+ else if (len == 1)
40
+ type = 'uint8_t';
41
+ else if (sign && len == 2)
42
+ type = 'int16_t';
43
+ else if (len == 2)
44
+ type = 'uint16_t';
45
+ else if (sign && len == 4)
46
+ type = 'int32_t';
47
+ else if (len == 4)
48
+ type = 'uint32_t';
49
+ else if (sign && len == 8)
50
+ type = 'int64_t';
51
+ else if (len == 8)
52
+ type = 'uint64_t';
53
+
54
+ if (type === null)
55
+ throw (new Error('Malformed CTF JSON: integer has ' +
56
+ 'unsupported length and sign - ' + len + '/' + sign));
57
+
58
+ /*
59
+ * This means that this is the same as one of our built in types. If
60
+ * that's the case defining it would be an error. So instead of trying
61
+ * to typedef it, we'll return here.
62
+ */
63
+ if (name == type)
64
+ return;
65
+
66
+ if (name == 'char') {
67
+ ASSERT(type == 'int8_t');
68
+ return;
69
+ }
70
+
71
+ ctype.typedef(name, type);
72
+ }
73
+
74
+ function ctfParseFloat(entry, ctype)
75
+ {
76
+ var name, len;
77
+
78
+ name = entry['name'];
79
+ if (!('length' in entry['float']))
80
+ throw (new Error('Malformed CTF JSON: float missing ' +
81
+ 'length value'));
82
+
83
+ len = entry['float']['length'];
84
+ if (len != 4 && len != 8)
85
+ throw (new Error('Malformed CTF JSON: float has invalid ' +
86
+ 'length value'));
87
+
88
+ if (len == 4) {
89
+ if (name == 'float')
90
+ return;
91
+ ctype.typedef(name, 'float');
92
+ } else if (len == 8) {
93
+ if (name == 'double')
94
+ return;
95
+ ctype.typedef(name, 'double');
96
+ }
97
+ }
98
+
99
+ function ctfParseTypedef(entry, ctype)
100
+ {
101
+ var name, type, ii;
102
+
103
+ name = entry['name'];
104
+ if (typeof (entry['typedef']) != 'string')
105
+ throw (new Error('Malformed CTF JSON: typedef value in not ' +
106
+ 'a string'));
107
+
108
+ type = entry['typedef'];
109
+
110
+ /*
111
+ * We need to ensure that we're not looking at type that's one of our
112
+ * built in types. Traditionally in C a uint32_t would be a typedef to
113
+ * some kind of integer. However, those size types are built ins.
114
+ */
115
+ for (ii = 0; ii < ctf_deftypes.length; ii++) {
116
+ if (name == ctf_deftypes[ii])
117
+ return;
118
+ }
119
+
120
+ ctype.typedef(name, type);
121
+ }
122
+
123
+ function ctfParseStruct(entry, ctype)
124
+ {
125
+ var name, type, ii, val, index, member, push;
126
+
127
+ member = [];
128
+ if (!Array.isArray(entry['struct']))
129
+ throw (new Error('Malformed CTF JSON: struct value is not ' +
130
+ 'an array'));
131
+
132
+ for (ii = 0; ii < entry['struct'].length; ii++) {
133
+ val = entry['struct'][ii];
134
+ if (!('name' in val))
135
+ throw (new Error('Malformed CTF JSON: struct member ' +
136
+ 'missing name'));
137
+
138
+ if (!('type' in val))
139
+ throw (new Error('Malformed CTF JSON: struct member ' +
140
+ 'missing type'));
141
+
142
+ if (typeof (val['name']) != 'string')
143
+ throw (new Error('Malformed CTF JSON: struct member ' +
144
+ 'name isn\'t a string'));
145
+
146
+ if (typeof (val['type']) != 'string')
147
+ throw (new Error('Malformed CTF JSON: struct member ' +
148
+ 'type isn\'t a string'));
149
+
150
+ /*
151
+ * CTF version 2 specifies array names as <type> [<num>] where
152
+ * as node-ctype does this as <type>[<num>].
153
+ */
154
+ name = val['name'];
155
+ type = val['type'];
156
+ index = type.indexOf(' [');
157
+ if (index != -1) {
158
+ type = type.substring(0, index) +
159
+ type.substring(index + 1, type.length);
160
+ }
161
+ push = {};
162
+ push[name] = { 'type': type };
163
+ member.push(push);
164
+ }
165
+
166
+ name = entry['name'];
167
+ ctype.typedef(name, member);
168
+ }
169
+
170
+ function ctfParseEntry(entry, ctype)
171
+ {
172
+ var ii, found;
173
+
174
+ if (!('name' in entry))
175
+ throw (new Error('Malformed CTF JSON: entry missing "name" ' +
176
+ 'section'));
177
+
178
+ for (ii = 0; ii < ctf_entries.length; ii++) {
179
+ if (ctf_entries[ii] in entry)
180
+ found++;
181
+ }
182
+
183
+ if (found === 0)
184
+ throw (new Error('Malformed CTF JSON: found no entries'));
185
+
186
+ if (found >= 2)
187
+ throw (new Error('Malformed CTF JSON: found more than one ' +
188
+ 'entry'));
189
+
190
+ if ('integer' in entry) {
191
+ ctfParseInteger(entry, ctype);
192
+ return;
193
+ }
194
+
195
+ if ('float' in entry) {
196
+ ctfParseFloat(entry, ctype);
197
+ return;
198
+ }
199
+
200
+ if ('typedef' in entry) {
201
+ ctfParseTypedef(entry, ctype);
202
+ return;
203
+ }
204
+
205
+ if ('struct' in entry) {
206
+ ctfParseStruct(entry, ctype);
207
+ return;
208
+ }
209
+
210
+ ASSERT(false, 'shouldn\'t reach here');
211
+ }
212
+
213
+ function ctfParseJson(json, ctype)
214
+ {
215
+ var version, ii;
216
+
217
+ ASSERT(json);
218
+ ASSERT(ctype);
219
+ if (!('metadata' in json))
220
+ throw (new Error('Invalid CTF JSON: missing metadata section'));
221
+
222
+ if (!('ctf2json_version' in json['metadata']))
223
+ throw (new Error('Invalid CTF JSON: missing ctf2json_version'));
224
+
225
+ version = json['metadata']['ctf2json_version'];
226
+ for (ii = 0; ii < ctf_versions.length; ii++) {
227
+ if (ctf_versions[ii] == version)
228
+ break;
229
+ }
230
+
231
+ if (ii == ctf_versions.length)
232
+ throw (new Error('Unsuported ctf2json_version: ' + version));
233
+
234
+ if (!('data' in json))
235
+ throw (new Error('Invalid CTF JSON: missing data section'));
236
+
237
+ if (!Array.isArray(json['data']))
238
+ throw (new Error('Malformed CTF JSON: data section is not ' +
239
+ 'an array'));
240
+
241
+ for (ii = 0; ii < json['data'].length; ii++)
242
+ ctfParseEntry(json['data'][ii], ctype);
243
+ }
244
+
245
+ exports.ctfParseJson = ctfParseJson;