snowball 0.1.21 → 0.1.22

Sign up to get free protection for your applications and to get access to all the features.
Files changed (589) hide show
  1. checksums.yaml +5 -13
  2. data/.gitignore +1 -3
  3. data/{lib/snowball → bin}/roll.js +0 -0
  4. data/lib/snowball/roller.rb +1 -1
  5. data/lib/snowball/version.rb +1 -1
  6. data/node_modules/.bin/browserify +161 -0
  7. data/node_modules/.bin/cake +7 -0
  8. data/node_modules/.bin/coffee +7 -0
  9. data/node_modules/.bin/jade +168 -0
  10. data/node_modules/browserify/.travis.yml +4 -0
  11. data/node_modules/browserify/LICENSE +63 -0
  12. data/node_modules/browserify/README.markdown +172 -0
  13. data/node_modules/browserify/bin/cmd.js +161 -0
  14. data/node_modules/browserify/builtins/__browserify_process.js +55 -0
  15. data/node_modules/browserify/builtins/assert.js +314 -0
  16. data/node_modules/browserify/builtins/child_process.js +2 -0
  17. data/node_modules/browserify/builtins/events.js +178 -0
  18. data/node_modules/browserify/builtins/fs.js +1 -0
  19. data/node_modules/browserify/builtins/https.js +1 -0
  20. data/node_modules/browserify/builtins/net.js +1 -0
  21. data/node_modules/browserify/builtins/path.js +175 -0
  22. data/node_modules/browserify/builtins/querystring.js +250 -0
  23. data/node_modules/browserify/builtins/stream.js +119 -0
  24. data/node_modules/browserify/builtins/string_decoder.js +161 -0
  25. data/node_modules/browserify/builtins/sys.js +1 -0
  26. data/node_modules/browserify/builtins/timers.js +39 -0
  27. data/node_modules/browserify/builtins/tls.js +1 -0
  28. data/node_modules/browserify/builtins/tty.js +2 -0
  29. data/node_modules/browserify/builtins/url.js +604 -0
  30. data/node_modules/browserify/builtins/util.js +351 -0
  31. data/node_modules/browserify/example/debug/browserify.js +219 -0
  32. data/node_modules/browserify/example/debug/build.sh +3 -0
  33. data/node_modules/browserify/example/debug/index.html +7 -0
  34. data/node_modules/browserify/example/debug/js/entry.js +2 -0
  35. data/node_modules/browserify/example/debug/js/thrower.js +3 -0
  36. data/node_modules/browserify/example/debug/server.js +9 -0
  37. data/node_modules/browserify/example/simple-build/browserify.js +368 -0
  38. data/node_modules/browserify/example/simple-build/build.sh +3 -0
  39. data/node_modules/browserify/example/simple-build/index.html +9 -0
  40. data/node_modules/browserify/example/simple-build/js/bar.js +3 -0
  41. data/node_modules/browserify/example/simple-build/js/entry.js +5 -0
  42. data/node_modules/browserify/example/simple-build/js/foo.js +5 -0
  43. data/node_modules/browserify/example/simple-build/server.js +9 -0
  44. data/node_modules/browserify/example/test/b.js +5 -0
  45. data/node_modules/browserify/example/test/bar.js +3 -0
  46. data/node_modules/browserify/example/test/foo.js +3 -0
  47. data/node_modules/browserify/example/test/m.js +3 -0
  48. data/node_modules/browserify/example/test/n.js +3 -0
  49. data/node_modules/browserify/example/using-http/bundle.js +813 -0
  50. data/node_modules/browserify/example/using-http/entry.js +25 -0
  51. data/node_modules/browserify/example/using-http/index.html +9 -0
  52. data/node_modules/browserify/example/using-http/server.js +28 -0
  53. data/node_modules/browserify/index.js +202 -0
  54. data/node_modules/browserify/lib/watch.js +75 -0
  55. data/node_modules/browserify/lib/wrap.js +580 -0
  56. data/node_modules/browserify/lib/wrappers.js +10 -0
  57. data/node_modules/browserify/node_modules/buffer-browserify/.npmignore +1 -0
  58. data/node_modules/browserify/node_modules/buffer-browserify/README.md +11 -0
  59. data/node_modules/browserify/node_modules/buffer-browserify/buffer_ieee754.js +84 -0
  60. data/node_modules/browserify/node_modules/buffer-browserify/index.js +1317 -0
  61. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/README.md +14 -0
  62. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/lib/b64.js +84 -0
  63. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/package.json +30 -0
  64. data/node_modules/browserify/node_modules/buffer-browserify/node_modules/base64-js/test/runner.js +50 -0
  65. data/node_modules/browserify/node_modules/buffer-browserify/package.json +46 -0
  66. data/node_modules/browserify/node_modules/buffer-browserify/test/buffer.js +218 -0
  67. data/node_modules/browserify/node_modules/commondir/README.markdown +45 -0
  68. data/node_modules/browserify/node_modules/commondir/example/base.js +3 -0
  69. data/node_modules/browserify/node_modules/commondir/example/dir.js +3 -0
  70. data/node_modules/browserify/node_modules/commondir/index.js +29 -0
  71. data/node_modules/browserify/node_modules/commondir/package.json +47 -0
  72. data/node_modules/browserify/node_modules/commondir/test/dirs.js +66 -0
  73. data/node_modules/browserify/node_modules/crypto-browserify/.travis.yml +4 -0
  74. data/node_modules/browserify/node_modules/crypto-browserify/example/bundle.js +637 -0
  75. data/node_modules/browserify/node_modules/crypto-browserify/example/index.html +12 -0
  76. data/node_modules/browserify/node_modules/crypto-browserify/example/test.js +4 -0
  77. data/node_modules/browserify/node_modules/crypto-browserify/index.js +74 -0
  78. data/node_modules/browserify/node_modules/crypto-browserify/md5.js +384 -0
  79. data/node_modules/browserify/node_modules/crypto-browserify/package.json +33 -0
  80. data/node_modules/browserify/node_modules/crypto-browserify/readme.markdown +20 -0
  81. data/node_modules/browserify/node_modules/crypto-browserify/rng.js +37 -0
  82. data/node_modules/browserify/node_modules/crypto-browserify/sha.js +210 -0
  83. data/node_modules/browserify/node_modules/crypto-browserify/test/simple.js +35 -0
  84. data/node_modules/browserify/node_modules/deputy/.travis.yml +4 -0
  85. data/node_modules/browserify/node_modules/deputy/README.markdown +55 -0
  86. data/node_modules/browserify/node_modules/deputy/example/cache.js +5 -0
  87. data/node_modules/browserify/node_modules/deputy/index.js +46 -0
  88. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/.npmignore +2 -0
  89. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/.travis.yml +5 -0
  90. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/LICENSE +21 -0
  91. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/examples/pow.js +6 -0
  92. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/index.js +82 -0
  93. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/package.json +34 -0
  94. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/readme.markdown +63 -0
  95. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/chmod.js +38 -0
  96. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/clobber.js +37 -0
  97. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/mkdirp.js +28 -0
  98. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/perm.js +32 -0
  99. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/perm_sync.js +39 -0
  100. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/race.js +41 -0
  101. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/rel.js +32 -0
  102. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/return.js +25 -0
  103. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/return_sync.js +24 -0
  104. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/root.js +18 -0
  105. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/sync.js +32 -0
  106. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/umask.js +28 -0
  107. data/node_modules/browserify/node_modules/deputy/node_modules/mkdirp/test/umask_sync.js +32 -0
  108. data/node_modules/browserify/node_modules/deputy/package.json +47 -0
  109. data/node_modules/browserify/node_modules/deputy/test/cache.js +58 -0
  110. data/node_modules/browserify/node_modules/detective/.travis.yml +4 -0
  111. data/node_modules/browserify/node_modules/detective/README.markdown +66 -0
  112. data/node_modules/browserify/node_modules/detective/example/strings.js +6 -0
  113. data/node_modules/browserify/node_modules/detective/example/strings_src.js +3 -0
  114. data/node_modules/browserify/node_modules/detective/index.js +60 -0
  115. data/node_modules/browserify/node_modules/detective/node_modules/.bin/esparse +42 -0
  116. data/node_modules/browserify/node_modules/detective/node_modules/esprima/.travis.yml +5 -0
  117. data/node_modules/browserify/node_modules/detective/node_modules/esprima/LICENSE.BSD +19 -0
  118. data/node_modules/browserify/node_modules/detective/node_modules/esprima/README.md +74 -0
  119. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/codemirror.css +112 -0
  120. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/codemirror.js +2972 -0
  121. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/codemirror/javascript.js +360 -0
  122. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/json2.js +487 -0
  123. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/style.css +164 -0
  124. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview-min.js +12 -0
  125. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview-sprite.gif +0 -0
  126. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/treeview.css +7 -0
  127. data/node_modules/browserify/node_modules/detective/node_modules/esprima/assets/yui/yahoo-dom-event.js +14 -0
  128. data/node_modules/browserify/node_modules/detective/node_modules/esprima/bin/esparse.js +42 -0
  129. data/node_modules/browserify/node_modules/detective/node_modules/esprima/changes +92 -0
  130. data/node_modules/browserify/node_modules/detective/node_modules/esprima/cm +696 -0
  131. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/checkenv.js +42 -0
  132. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/collector.html +82 -0
  133. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/collector.js +170 -0
  134. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/functiontrace.html +106 -0
  135. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/functiontrace.js +123 -0
  136. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/parse.css +82 -0
  137. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/parse.html +352 -0
  138. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/precedence.html +225 -0
  139. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/rewrite.html +120 -0
  140. data/node_modules/browserify/node_modules/detective/node_modules/esprima/demo/rewrite.js +71 -0
  141. data/node_modules/browserify/node_modules/detective/node_modules/esprima/esprima.js +3577 -0
  142. data/node_modules/browserify/node_modules/detective/node_modules/esprima/index.html +103 -0
  143. data/node_modules/browserify/node_modules/detective/node_modules/esprima/package.json +42 -0
  144. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/Tokenizer.js +646 -0
  145. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/XMLHttpRequest.js +509 -0
  146. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ZeParser.js +2185 -0
  147. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/backbone-0.5.3.js +1158 -0
  148. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/benchmark.js +3261 -0
  149. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/escodegen.js +906 -0
  150. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/esmorph.js +240 -0
  151. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ext-core-3.0.0.js +6579 -0
  152. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/ext-core-3.1.0.js +10255 -0
  153. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery-1.6.4.js +9046 -0
  154. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery-1.7.1.js +9266 -0
  155. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jquery.mobile-1.0.js +6951 -0
  156. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jsdefs.js +731 -0
  157. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jslex.js +588 -0
  158. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/jsparse.js +1921 -0
  159. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/mootools-1.3.2.js +5952 -0
  160. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/mootools-1.4.1.js +6297 -0
  161. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/parse-js.js +1342 -0
  162. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/platform.js +878 -0
  163. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/prototype-1.6.1.js +4874 -0
  164. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/prototype-1.7.0.0.js +6082 -0
  165. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/3rdparty/underscore-1.2.3.js +981 -0
  166. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/benchmarks.html +58 -0
  167. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/benchmarks.js +328 -0
  168. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compare.html +140 -0
  169. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compare.js +270 -0
  170. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compat.html +40 -0
  171. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/compat.js +239 -0
  172. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.footer.html +3 -0
  173. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.header.html +37 -0
  174. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/coverage.html +3617 -0
  175. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/index.html +36 -0
  176. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/reflect.js +403 -0
  177. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/run.js +66 -0
  178. data/node_modules/browserify/node_modules/detective/node_modules/esprima/test/test.js +16659 -0
  179. data/node_modules/browserify/node_modules/detective/node_modules/esprima/tools/generate-unicode-regex.py +164 -0
  180. data/node_modules/browserify/node_modules/detective/node_modules/esprima/tools/update-coverage.sh +28 -0
  181. data/node_modules/browserify/node_modules/detective/package.json +47 -0
  182. data/node_modules/browserify/node_modules/detective/test/both.js +11 -0
  183. data/node_modules/browserify/node_modules/detective/test/chained.js +9 -0
  184. data/node_modules/browserify/node_modules/detective/test/files/both.js +4 -0
  185. data/node_modules/browserify/node_modules/detective/test/files/chained.js +5 -0
  186. data/node_modules/browserify/node_modules/detective/test/files/nested.js +22 -0
  187. data/node_modules/browserify/node_modules/detective/test/files/skip.js +7 -0
  188. data/node_modules/browserify/node_modules/detective/test/files/strings.js +13 -0
  189. data/node_modules/browserify/node_modules/detective/test/files/word.js +13 -0
  190. data/node_modules/browserify/node_modules/detective/test/nested.js +9 -0
  191. data/node_modules/browserify/node_modules/detective/test/skip.js +9 -0
  192. data/node_modules/browserify/node_modules/detective/test/strings.js +9 -0
  193. data/node_modules/browserify/node_modules/detective/test/word.js +12 -0
  194. data/node_modules/browserify/node_modules/http-browserify/.npmignore +1 -0
  195. data/node_modules/browserify/node_modules/http-browserify/example/get/index.html +9 -0
  196. data/node_modules/browserify/node_modules/http-browserify/example/get/main.js +14 -0
  197. data/node_modules/browserify/node_modules/http-browserify/example/get/server.js +12 -0
  198. data/node_modules/browserify/node_modules/http-browserify/example/headers/index.html +9 -0
  199. data/node_modules/browserify/node_modules/http-browserify/example/headers/main.js +18 -0
  200. data/node_modules/browserify/node_modules/http-browserify/example/headers/server.js +15 -0
  201. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/data.json +139 -0
  202. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/index.html +9 -0
  203. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/main.js +13 -0
  204. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/.npmignore +2 -0
  205. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/.travis.yml +4 -0
  206. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/LICENSE.APACHE2 +15 -0
  207. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/LICENSE.MIT +24 -0
  208. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/examples/all_docs.js +13 -0
  209. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/index.js +189 -0
  210. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/LICENSE +24 -0
  211. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/README.markdown +11 -0
  212. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/bench.js +26 -0
  213. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/examples/twitterfeed.js +30 -0
  214. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/jsonparse.js +379 -0
  215. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/package.json +36 -0
  216. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/samplejson/basic.json +167 -0
  217. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/samplejson/basic2.json +180 -0
  218. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/test/primitives.js +54 -0
  219. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/node_modules/jsonparse/test/utf8.js +38 -0
  220. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/package.json +40 -0
  221. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/readme.markdown +145 -0
  222. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/bool.js +41 -0
  223. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/destroy_missing.js +22 -0
  224. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/empty.js +44 -0
  225. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/fixtures/all_npm.json +4030 -0
  226. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/fn.js +39 -0
  227. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/memory.js +69 -0
  228. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/multiple_objects.js +42 -0
  229. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/multiple_objects_error.js +35 -0
  230. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/parsejson.js +28 -0
  231. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/stringify.js +41 -0
  232. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/stringify_object.js +47 -0
  233. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/test.js +35 -0
  234. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/test2.js +29 -0
  235. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/node_modules/JSONStream/test/two-ways.js +41 -0
  236. data/node_modules/browserify/node_modules/http-browserify/example/json-stream/server.js +10 -0
  237. data/node_modules/browserify/node_modules/http-browserify/example/post/index.html +9 -0
  238. data/node_modules/browserify/node_modules/http-browserify/example/post/main.js +16 -0
  239. data/node_modules/browserify/node_modules/http-browserify/example/post/server.js +19 -0
  240. data/node_modules/browserify/node_modules/http-browserify/example/streaming/index.html +9 -0
  241. data/node_modules/browserify/node_modules/http-browserify/example/streaming/main.js +16 -0
  242. data/node_modules/browserify/node_modules/http-browserify/example/streaming/server.js +21 -0
  243. data/node_modules/browserify/node_modules/http-browserify/index.js +59 -0
  244. data/node_modules/browserify/node_modules/http-browserify/lib/request.js +128 -0
  245. data/node_modules/browserify/node_modules/http-browserify/lib/response.js +119 -0
  246. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/index.js +48 -0
  247. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/package.json +30 -0
  248. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/readme.md +31 -0
  249. data/node_modules/browserify/node_modules/http-browserify/node_modules/concat-stream/test.js +34 -0
  250. data/node_modules/browserify/node_modules/http-browserify/package.json +46 -0
  251. data/node_modules/browserify/node_modules/http-browserify/readme.markdown +128 -0
  252. data/node_modules/browserify/node_modules/nub/README.markdown +23 -0
  253. data/node_modules/browserify/node_modules/nub/index.js +64 -0
  254. data/node_modules/browserify/node_modules/nub/package.json +46 -0
  255. data/node_modules/browserify/node_modules/nub/test/by.js +51 -0
  256. data/node_modules/browserify/node_modules/nub/test/nub.js +46 -0
  257. data/node_modules/browserify/node_modules/resolve/.travis.yml +4 -0
  258. data/node_modules/browserify/node_modules/resolve/LICENSE +18 -0
  259. data/node_modules/browserify/node_modules/resolve/README.markdown +47 -0
  260. data/node_modules/browserify/node_modules/resolve/index.js +106 -0
  261. data/node_modules/browserify/node_modules/resolve/package.json +45 -0
  262. data/node_modules/browserify/node_modules/resolve/test/core.js +12 -0
  263. data/node_modules/browserify/node_modules/resolve/test/filter.js +15 -0
  264. data/node_modules/browserify/node_modules/resolve/test/mock.js +64 -0
  265. data/node_modules/browserify/node_modules/resolve/test/resolver.js +157 -0
  266. data/node_modules/browserify/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js +1 -0
  267. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  268. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/package.json +3 -0
  269. data/node_modules/browserify/node_modules/resolve/test/resolver/baz/quux.js +1 -0
  270. data/node_modules/browserify/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js +1 -0
  271. data/node_modules/browserify/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js +1 -0
  272. data/node_modules/browserify/node_modules/resolve/test/resolver/cup.coffee +1 -0
  273. data/node_modules/browserify/node_modules/resolve/test/resolver/foo.js +1 -0
  274. data/node_modules/browserify/node_modules/resolve/test/resolver/mug.coffee +0 -0
  275. data/node_modules/browserify/node_modules/resolve/test/resolver/mug.js +0 -0
  276. data/node_modules/browserify/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  277. data/node_modules/browserify/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  278. data/node_modules/browserify/node_modules/syntax-error/.travis.yml +4 -0
  279. data/node_modules/browserify/node_modules/syntax-error/LICENSE +18 -0
  280. data/node_modules/browserify/node_modules/syntax-error/example/check.js +12 -0
  281. data/node_modules/browserify/node_modules/syntax-error/example/src.js +9 -0
  282. data/node_modules/browserify/node_modules/syntax-error/index.js +54 -0
  283. data/node_modules/browserify/node_modules/syntax-error/node_modules/.bin/esparse +42 -0
  284. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/.travis.yml +5 -0
  285. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/LICENSE.BSD +19 -0
  286. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/README.md +74 -0
  287. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/codemirror.css +112 -0
  288. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/codemirror.js +2972 -0
  289. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/codemirror/javascript.js +360 -0
  290. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/json2.js +487 -0
  291. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/style.css +164 -0
  292. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview-min.js +12 -0
  293. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview-sprite.gif +0 -0
  294. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/treeview.css +7 -0
  295. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/assets/yui/yahoo-dom-event.js +14 -0
  296. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/bin/esparse.js +42 -0
  297. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/changes +92 -0
  298. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/cm +696 -0
  299. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/checkenv.js +42 -0
  300. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/collector.html +82 -0
  301. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/collector.js +170 -0
  302. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/functiontrace.html +106 -0
  303. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/functiontrace.js +123 -0
  304. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/parse.css +82 -0
  305. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/parse.html +352 -0
  306. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/precedence.html +225 -0
  307. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/rewrite.html +120 -0
  308. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/demo/rewrite.js +71 -0
  309. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/esprima.js +3577 -0
  310. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/index.html +103 -0
  311. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/package.json +42 -0
  312. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/Tokenizer.js +646 -0
  313. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/XMLHttpRequest.js +509 -0
  314. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ZeParser.js +2185 -0
  315. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/backbone-0.5.3.js +1158 -0
  316. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/benchmark.js +3261 -0
  317. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/escodegen.js +906 -0
  318. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/esmorph.js +240 -0
  319. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ext-core-3.0.0.js +6579 -0
  320. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/ext-core-3.1.0.js +10255 -0
  321. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery-1.6.4.js +9046 -0
  322. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery-1.7.1.js +9266 -0
  323. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jquery.mobile-1.0.js +6951 -0
  324. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jsdefs.js +731 -0
  325. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jslex.js +588 -0
  326. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/jsparse.js +1921 -0
  327. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/mootools-1.3.2.js +5952 -0
  328. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/mootools-1.4.1.js +6297 -0
  329. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/parse-js.js +1342 -0
  330. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/platform.js +878 -0
  331. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/prototype-1.6.1.js +4874 -0
  332. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/prototype-1.7.0.0.js +6082 -0
  333. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/3rdparty/underscore-1.2.3.js +981 -0
  334. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/benchmarks.html +58 -0
  335. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/benchmarks.js +328 -0
  336. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compare.html +140 -0
  337. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compare.js +270 -0
  338. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compat.html +40 -0
  339. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/compat.js +239 -0
  340. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.footer.html +3 -0
  341. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.header.html +37 -0
  342. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/coverage.html +3617 -0
  343. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/index.html +36 -0
  344. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/reflect.js +403 -0
  345. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/run.js +66 -0
  346. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/test/test.js +16659 -0
  347. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/tools/generate-unicode-regex.py +164 -0
  348. data/node_modules/browserify/node_modules/syntax-error/node_modules/esprima/tools/update-coverage.sh +28 -0
  349. data/node_modules/browserify/node_modules/syntax-error/package.json +49 -0
  350. data/node_modules/browserify/node_modules/syntax-error/readme.markdown +87 -0
  351. data/node_modules/browserify/node_modules/syntax-error/test/check.js +17 -0
  352. data/node_modules/browserify/node_modules/syntax-error/test/sources/check.js +9 -0
  353. data/node_modules/browserify/node_modules/vm-browserify/README.markdown +103 -0
  354. data/node_modules/browserify/node_modules/vm-browserify/example/run/bundle.js +473 -0
  355. data/node_modules/browserify/node_modules/vm-browserify/example/run/entry.js +6 -0
  356. data/node_modules/browserify/node_modules/vm-browserify/example/run/index.html +9 -0
  357. data/node_modules/browserify/node_modules/vm-browserify/example/run/server.js +6 -0
  358. data/node_modules/browserify/node_modules/vm-browserify/index.js +85 -0
  359. data/node_modules/browserify/node_modules/vm-browserify/package.json +43 -0
  360. data/node_modules/browserify/node_modules/vm-browserify/testling/run.js +22 -0
  361. data/node_modules/browserify/node_modules/vm-browserify/testling/test.sh +11 -0
  362. data/node_modules/browserify/package.json +78 -0
  363. data/node_modules/browserify/test/alias.js +58 -0
  364. data/node_modules/browserify/test/backbone.js +21 -0
  365. data/node_modules/browserify/test/bin.js +39 -0
  366. data/node_modules/browserify/test/buffer.js +99 -0
  367. data/node_modules/browserify/test/bundle.js +32 -0
  368. data/node_modules/browserify/test/cache.js +28 -0
  369. data/node_modules/browserify/test/coffee.js +39 -0
  370. data/node_modules/browserify/test/coffee/bar.js +1 -0
  371. data/node_modules/browserify/test/coffee/baz.coffee +1 -0
  372. data/node_modules/browserify/test/coffee/entry.coffee +1 -0
  373. data/node_modules/browserify/test/coffee/foo.coffee +1 -0
  374. data/node_modules/browserify/test/coffee/index.coffee +5 -0
  375. data/node_modules/browserify/test/coffee/nested/nested.coffee +2 -0
  376. data/node_modules/browserify/test/comment.js +17 -0
  377. data/node_modules/browserify/test/comment/main.js +2 -0
  378. data/node_modules/browserify/test/crypto.js +37 -0
  379. data/node_modules/browserify/test/dnode.js +27 -0
  380. data/node_modules/browserify/test/dollar.js +19 -0
  381. data/node_modules/browserify/test/dollar/dollar/index.js +7 -0
  382. data/node_modules/browserify/test/entry.js +36 -0
  383. data/node_modules/browserify/test/entry/main.js +1 -0
  384. data/node_modules/browserify/test/entry/one.js +1 -0
  385. data/node_modules/browserify/test/entry/two.js +1 -0
  386. data/node_modules/browserify/test/error_code.js +24 -0
  387. data/node_modules/browserify/test/error_code/src.js +2 -0
  388. data/node_modules/browserify/test/export.js +52 -0
  389. data/node_modules/browserify/test/export/entry.js +1 -0
  390. data/node_modules/browserify/test/field.js +64 -0
  391. data/node_modules/browserify/test/field/miss.js +1 -0
  392. data/node_modules/browserify/test/field/node_modules/z-miss/browser.js +1 -0
  393. data/node_modules/browserify/test/field/node_modules/z-miss/main.js +1 -0
  394. data/node_modules/browserify/test/field/node_modules/z-miss/package.json +4 -0
  395. data/node_modules/browserify/test/field/node_modules/z-object/browser.js +1 -0
  396. data/node_modules/browserify/test/field/node_modules/z-object/main.js +1 -0
  397. data/node_modules/browserify/test/field/node_modules/z-object/package.json +6 -0
  398. data/node_modules/browserify/test/field/node_modules/z-string/browser.js +1 -0
  399. data/node_modules/browserify/test/field/node_modules/z-string/main.js +1 -0
  400. data/node_modules/browserify/test/field/node_modules/z-string/package.json +4 -0
  401. data/node_modules/browserify/test/field/node_modules/z-sub/browser/a.js +1 -0
  402. data/node_modules/browserify/test/field/node_modules/z-sub/browser/b.js +1 -0
  403. data/node_modules/browserify/test/field/node_modules/z-sub/main.js +1 -0
  404. data/node_modules/browserify/test/field/node_modules/z-sub/package.json +4 -0
  405. data/node_modules/browserify/test/field/object.js +1 -0
  406. data/node_modules/browserify/test/field/string.js +1 -0
  407. data/node_modules/browserify/test/field/sub.js +1 -0
  408. data/node_modules/browserify/test/global.js +19 -0
  409. data/node_modules/browserify/test/global/main.js +2 -0
  410. data/node_modules/browserify/test/jade.js +35 -0
  411. data/node_modules/browserify/test/json.js +17 -0
  412. data/node_modules/browserify/test/json/beep.json +4 -0
  413. data/node_modules/browserify/test/json/main.js +1 -0
  414. data/node_modules/browserify/test/maxlisteners.js +8 -0
  415. data/node_modules/browserify/test/module.js +22 -0
  416. data/node_modules/browserify/test/multi_entry.js +20 -0
  417. data/node_modules/browserify/test/multi_entry/a.js +2 -0
  418. data/node_modules/browserify/test/multi_entry/b.js +2 -0
  419. data/node_modules/browserify/test/multi_entry/c.js +3 -0
  420. data/node_modules/browserify/test/multi_ignore.js +23 -0
  421. data/node_modules/browserify/test/node_modules/beep/index.js +1 -0
  422. data/node_modules/browserify/test/require_cache.js +18 -0
  423. data/node_modules/browserify/test/retarget.js +27 -0
  424. data/node_modules/browserify/test/seq.js +47 -0
  425. data/node_modules/browserify/test/subdep.js +26 -0
  426. data/node_modules/browserify/test/subdep/index.js +1 -0
  427. data/node_modules/browserify/test/subdep/package.json +6 -0
  428. data/node_modules/browserify/test/util.js +48 -0
  429. data/node_modules/browserify/test/watch.js +91 -0
  430. data/node_modules/browserify/test/watch/a.js +1 -0
  431. data/node_modules/browserify/test/wrap.js +43 -0
  432. data/node_modules/browserify/test/wrap/a.js +2 -0
  433. data/node_modules/browserify/test/wrap/c.js +1 -0
  434. data/node_modules/browserify/test/wrap/node_modules/b/main.js +1 -0
  435. data/node_modules/browserify/test/wrap/node_modules/b/package.json +3 -0
  436. data/node_modules/browserify/test/wrap/node_modules/skipmetoo/index.js +1 -0
  437. data/node_modules/browserify/test/wrap/skipme.js +1 -0
  438. data/node_modules/browserify/test/wrap/x.js +0 -0
  439. data/node_modules/browserify/testling/README.markdown +29 -0
  440. data/node_modules/browserify/testling/test.sh +37 -0
  441. data/node_modules/browserify/testling/tick.js +9 -0
  442. data/node_modules/browserify/testling/timers.js +50 -0
  443. data/node_modules/browserify/testling/util.js +24 -0
  444. data/node_modules/browserify/v2.markdown +41 -0
  445. data/node_modules/browserify/wrappers/alias.js +1 -0
  446. data/node_modules/browserify/wrappers/body.js +2 -0
  447. data/node_modules/browserify/wrappers/body_debug.js +2 -0
  448. data/node_modules/browserify/wrappers/entry.js +3 -0
  449. data/node_modules/browserify/wrappers/entry_debug.js +3 -0
  450. data/node_modules/browserify/wrappers/package.js +3 -0
  451. data/node_modules/browserify/wrappers/prelude.js +196 -0
  452. data/node_modules/coffee-script/.npmignore +11 -0
  453. data/node_modules/coffee-script/CNAME +1 -0
  454. data/node_modules/coffee-script/CONTRIBUTING.md +9 -0
  455. data/node_modules/coffee-script/LICENSE +22 -0
  456. data/node_modules/coffee-script/README +51 -0
  457. data/node_modules/coffee-script/Rakefile +78 -0
  458. data/node_modules/coffee-script/bin/cake +7 -0
  459. data/node_modules/coffee-script/bin/coffee +7 -0
  460. data/node_modules/coffee-script/extras/jsl.conf +44 -0
  461. data/node_modules/coffee-script/lib/coffee-script/browser.js +92 -0
  462. data/node_modules/coffee-script/lib/coffee-script/cake.js +113 -0
  463. data/node_modules/coffee-script/lib/coffee-script/coffee-script.js +171 -0
  464. data/node_modules/coffee-script/lib/coffee-script/command.js +502 -0
  465. data/node_modules/coffee-script/lib/coffee-script/grammar.js +606 -0
  466. data/node_modules/coffee-script/lib/coffee-script/helpers.js +88 -0
  467. data/node_modules/coffee-script/lib/coffee-script/index.js +11 -0
  468. data/node_modules/coffee-script/lib/coffee-script/lexer.js +788 -0
  469. data/node_modules/coffee-script/lib/coffee-script/nodes.js +2971 -0
  470. data/node_modules/coffee-script/lib/coffee-script/optparse.js +138 -0
  471. data/node_modules/coffee-script/lib/coffee-script/parser.js +683 -0
  472. data/node_modules/coffee-script/lib/coffee-script/repl.js +276 -0
  473. data/node_modules/coffee-script/lib/coffee-script/rewriter.js +349 -0
  474. data/node_modules/coffee-script/lib/coffee-script/scope.js +146 -0
  475. data/node_modules/coffee-script/package.json +50 -0
  476. data/node_modules/jade-runtime/.npmignore +15 -0
  477. data/node_modules/jade-runtime/README.md +8 -0
  478. data/node_modules/jade-runtime/globals.js +32 -0
  479. data/node_modules/jade-runtime/index.js +2 -0
  480. data/node_modules/jade-runtime/jade-runtime.js +181 -0
  481. data/node_modules/jade-runtime/package.json +18 -0
  482. data/node_modules/jade/.npmignore +14 -0
  483. data/node_modules/jade/LICENSE +22 -0
  484. data/node_modules/jade/Readme.md +1299 -0
  485. data/node_modules/jade/bin/jade +168 -0
  486. data/node_modules/jade/index.js +4 -0
  487. data/node_modules/jade/jade.js +3586 -0
  488. data/node_modules/jade/jade.md +510 -0
  489. data/node_modules/jade/jade.min.js +2 -0
  490. data/node_modules/jade/lib/compiler.js +654 -0
  491. data/node_modules/jade/lib/doctypes.js +18 -0
  492. data/node_modules/jade/lib/filters.js +97 -0
  493. data/node_modules/jade/lib/inline-tags.js +28 -0
  494. data/node_modules/jade/lib/jade.js +253 -0
  495. data/node_modules/jade/lib/lexer.js +774 -0
  496. data/node_modules/jade/lib/nodes/attrs.js +77 -0
  497. data/node_modules/jade/lib/nodes/block-comment.js +33 -0
  498. data/node_modules/jade/lib/nodes/block.js +122 -0
  499. data/node_modules/jade/lib/nodes/case.js +43 -0
  500. data/node_modules/jade/lib/nodes/code.js +35 -0
  501. data/node_modules/jade/lib/nodes/comment.js +32 -0
  502. data/node_modules/jade/lib/nodes/doctype.js +29 -0
  503. data/node_modules/jade/lib/nodes/each.js +35 -0
  504. data/node_modules/jade/lib/nodes/filter.js +35 -0
  505. data/node_modules/jade/lib/nodes/index.js +20 -0
  506. data/node_modules/jade/lib/nodes/literal.js +32 -0
  507. data/node_modules/jade/lib/nodes/mixin.js +36 -0
  508. data/node_modules/jade/lib/nodes/node.js +25 -0
  509. data/node_modules/jade/lib/nodes/tag.js +95 -0
  510. data/node_modules/jade/lib/nodes/text.js +36 -0
  511. data/node_modules/jade/lib/parser.js +714 -0
  512. data/node_modules/jade/lib/runtime.js +174 -0
  513. data/node_modules/jade/lib/self-closing.js +19 -0
  514. data/node_modules/jade/lib/utils.js +49 -0
  515. data/node_modules/jade/node_modules/commander/.npmignore +4 -0
  516. data/node_modules/jade/node_modules/commander/.travis.yml +4 -0
  517. data/node_modules/jade/node_modules/commander/History.md +107 -0
  518. data/node_modules/jade/node_modules/commander/Makefile +7 -0
  519. data/node_modules/jade/node_modules/commander/Readme.md +262 -0
  520. data/node_modules/jade/node_modules/commander/index.js +2 -0
  521. data/node_modules/jade/node_modules/commander/lib/commander.js +1026 -0
  522. data/node_modules/jade/node_modules/commander/package.json +39 -0
  523. data/node_modules/jade/node_modules/mkdirp/.npmignore +2 -0
  524. data/node_modules/jade/node_modules/mkdirp/.travis.yml +4 -0
  525. data/node_modules/jade/node_modules/mkdirp/LICENSE +21 -0
  526. data/node_modules/jade/node_modules/mkdirp/README.markdown +61 -0
  527. data/node_modules/jade/node_modules/mkdirp/examples/pow.js +6 -0
  528. data/node_modules/jade/node_modules/mkdirp/index.js +82 -0
  529. data/node_modules/jade/node_modules/mkdirp/package.json +37 -0
  530. data/node_modules/jade/node_modules/mkdirp/test/chmod.js +38 -0
  531. data/node_modules/jade/node_modules/mkdirp/test/clobber.js +37 -0
  532. data/node_modules/jade/node_modules/mkdirp/test/mkdirp.js +28 -0
  533. data/node_modules/jade/node_modules/mkdirp/test/perm.js +32 -0
  534. data/node_modules/jade/node_modules/mkdirp/test/perm_sync.js +39 -0
  535. data/node_modules/jade/node_modules/mkdirp/test/race.js +41 -0
  536. data/node_modules/jade/node_modules/mkdirp/test/rel.js +32 -0
  537. data/node_modules/jade/node_modules/mkdirp/test/return.js +25 -0
  538. data/node_modules/jade/node_modules/mkdirp/test/return_sync.js +24 -0
  539. data/node_modules/jade/node_modules/mkdirp/test/root.js +18 -0
  540. data/node_modules/jade/node_modules/mkdirp/test/sync.js +32 -0
  541. data/node_modules/jade/node_modules/mkdirp/test/umask.js +28 -0
  542. data/node_modules/jade/node_modules/mkdirp/test/umask_sync.js +32 -0
  543. data/node_modules/jade/package.json +53 -0
  544. data/node_modules/jade/runtime.js +179 -0
  545. data/node_modules/jade/runtime.min.js +1 -0
  546. data/node_modules/jade/test.jade +7 -0
  547. data/node_modules/jade/testing/head.jade +5 -0
  548. data/node_modules/jade/testing/index.jade +1 -0
  549. data/node_modules/jade/testing/index.js +14 -0
  550. data/node_modules/jade/testing/layout.jade +10 -0
  551. data/node_modules/jade/testing/user.jade +7 -0
  552. data/node_modules/jade/testing/user.js +27 -0
  553. data/node_modules/optimist/.travis.yml +4 -0
  554. data/node_modules/optimist/LICENSE +21 -0
  555. data/node_modules/optimist/README.markdown +487 -0
  556. data/node_modules/optimist/example/bool.js +10 -0
  557. data/node_modules/optimist/example/boolean_double.js +7 -0
  558. data/node_modules/optimist/example/boolean_single.js +7 -0
  559. data/node_modules/optimist/example/default_hash.js +8 -0
  560. data/node_modules/optimist/example/default_singles.js +7 -0
  561. data/node_modules/optimist/example/divide.js +8 -0
  562. data/node_modules/optimist/example/line_count.js +20 -0
  563. data/node_modules/optimist/example/line_count_options.js +29 -0
  564. data/node_modules/optimist/example/line_count_wrap.js +29 -0
  565. data/node_modules/optimist/example/nonopt.js +4 -0
  566. data/node_modules/optimist/example/reflect.js +2 -0
  567. data/node_modules/optimist/example/short.js +3 -0
  568. data/node_modules/optimist/example/string.js +11 -0
  569. data/node_modules/optimist/example/usage-options.js +19 -0
  570. data/node_modules/optimist/example/xup.js +10 -0
  571. data/node_modules/optimist/index.js +475 -0
  572. data/node_modules/optimist/node_modules/wordwrap/.npmignore +1 -0
  573. data/node_modules/optimist/node_modules/wordwrap/README.markdown +70 -0
  574. data/node_modules/optimist/node_modules/wordwrap/example/center.js +10 -0
  575. data/node_modules/optimist/node_modules/wordwrap/example/meat.js +3 -0
  576. data/node_modules/optimist/node_modules/wordwrap/index.js +76 -0
  577. data/node_modules/optimist/node_modules/wordwrap/package.json +45 -0
  578. data/node_modules/optimist/node_modules/wordwrap/test/break.js +30 -0
  579. data/node_modules/optimist/node_modules/wordwrap/test/idleness.txt +63 -0
  580. data/node_modules/optimist/node_modules/wordwrap/test/wrap.js +31 -0
  581. data/node_modules/optimist/package.json +55 -0
  582. data/node_modules/optimist/test/_.js +71 -0
  583. data/node_modules/optimist/test/_/argv.js +2 -0
  584. data/node_modules/optimist/test/_/bin.js +3 -0
  585. data/node_modules/optimist/test/parse.js +420 -0
  586. data/node_modules/optimist/test/usage.js +292 -0
  587. data/snowball.gemspec +1 -2
  588. metadata +601 -21
  589. data/extconf.rb +0 -9
@@ -0,0 +1,2 @@
1
+
2
+ module.exports = require('./lib/commander');
@@ -0,0 +1,1026 @@
1
+
2
+ /*!
3
+ * commander
4
+ * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
5
+ * MIT Licensed
6
+ */
7
+
8
+ /**
9
+ * Module dependencies.
10
+ */
11
+
12
+ var EventEmitter = require('events').EventEmitter
13
+ , path = require('path')
14
+ , tty = require('tty')
15
+ , basename = path.basename;
16
+
17
+ /**
18
+ * Expose the root command.
19
+ */
20
+
21
+ exports = module.exports = new Command;
22
+
23
+ /**
24
+ * Expose `Command`.
25
+ */
26
+
27
+ exports.Command = Command;
28
+
29
+ /**
30
+ * Expose `Option`.
31
+ */
32
+
33
+ exports.Option = Option;
34
+
35
+ /**
36
+ * Initialize a new `Option` with the given `flags` and `description`.
37
+ *
38
+ * @param {String} flags
39
+ * @param {String} description
40
+ * @api public
41
+ */
42
+
43
+ function Option(flags, description) {
44
+ this.flags = flags;
45
+ this.required = ~flags.indexOf('<');
46
+ this.optional = ~flags.indexOf('[');
47
+ this.bool = !~flags.indexOf('-no-');
48
+ flags = flags.split(/[ ,|]+/);
49
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
50
+ this.long = flags.shift();
51
+ this.description = description;
52
+ }
53
+
54
+ /**
55
+ * Return option name.
56
+ *
57
+ * @return {String}
58
+ * @api private
59
+ */
60
+
61
+ Option.prototype.name = function(){
62
+ return this.long
63
+ .replace('--', '')
64
+ .replace('no-', '');
65
+ };
66
+
67
+ /**
68
+ * Check if `arg` matches the short or long flag.
69
+ *
70
+ * @param {String} arg
71
+ * @return {Boolean}
72
+ * @api private
73
+ */
74
+
75
+ Option.prototype.is = function(arg){
76
+ return arg == this.short
77
+ || arg == this.long;
78
+ };
79
+
80
+ /**
81
+ * Initialize a new `Command`.
82
+ *
83
+ * @param {String} name
84
+ * @api public
85
+ */
86
+
87
+ function Command(name) {
88
+ this.commands = [];
89
+ this.options = [];
90
+ this.args = [];
91
+ this.name = name;
92
+ }
93
+
94
+ /**
95
+ * Inherit from `EventEmitter.prototype`.
96
+ */
97
+
98
+ Command.prototype.__proto__ = EventEmitter.prototype;
99
+
100
+ /**
101
+ * Add command `name`.
102
+ *
103
+ * The `.action()` callback is invoked when the
104
+ * command `name` is specified via __ARGV__,
105
+ * and the remaining arguments are applied to the
106
+ * function for access.
107
+ *
108
+ * When the `name` is "*" an un-matched command
109
+ * will be passed as the first arg, followed by
110
+ * the rest of __ARGV__ remaining.
111
+ *
112
+ * Examples:
113
+ *
114
+ * program
115
+ * .version('0.0.1')
116
+ * .option('-C, --chdir <path>', 'change the working directory')
117
+ * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
118
+ * .option('-T, --no-tests', 'ignore test hook')
119
+ *
120
+ * program
121
+ * .command('setup')
122
+ * .description('run remote setup commands')
123
+ * .action(function(){
124
+ * console.log('setup');
125
+ * });
126
+ *
127
+ * program
128
+ * .command('exec <cmd>')
129
+ * .description('run the given remote command')
130
+ * .action(function(cmd){
131
+ * console.log('exec "%s"', cmd);
132
+ * });
133
+ *
134
+ * program
135
+ * .command('*')
136
+ * .description('deploy the given env')
137
+ * .action(function(env){
138
+ * console.log('deploying "%s"', env);
139
+ * });
140
+ *
141
+ * program.parse(process.argv);
142
+ *
143
+ * @param {String} name
144
+ * @return {Command} the new command
145
+ * @api public
146
+ */
147
+
148
+ Command.prototype.command = function(name){
149
+ var args = name.split(/ +/);
150
+ var cmd = new Command(args.shift());
151
+ this.commands.push(cmd);
152
+ cmd.parseExpectedArgs(args);
153
+ cmd.parent = this;
154
+ return cmd;
155
+ };
156
+
157
+ /**
158
+ * Parse expected `args`.
159
+ *
160
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
161
+ *
162
+ * @param {Array} args
163
+ * @return {Command} for chaining
164
+ * @api public
165
+ */
166
+
167
+ Command.prototype.parseExpectedArgs = function(args){
168
+ if (!args.length) return;
169
+ var self = this;
170
+ args.forEach(function(arg){
171
+ switch (arg[0]) {
172
+ case '<':
173
+ self.args.push({ required: true, name: arg.slice(1, -1) });
174
+ break;
175
+ case '[':
176
+ self.args.push({ required: false, name: arg.slice(1, -1) });
177
+ break;
178
+ }
179
+ });
180
+ return this;
181
+ };
182
+
183
+ /**
184
+ * Register callback `fn` for the command.
185
+ *
186
+ * Examples:
187
+ *
188
+ * program
189
+ * .command('help')
190
+ * .description('display verbose help')
191
+ * .action(function(){
192
+ * // output help here
193
+ * });
194
+ *
195
+ * @param {Function} fn
196
+ * @return {Command} for chaining
197
+ * @api public
198
+ */
199
+
200
+ Command.prototype.action = function(fn){
201
+ var self = this;
202
+ this.parent.on(this.name, function(args, unknown){
203
+ // Parse any so-far unknown options
204
+ unknown = unknown || [];
205
+ var parsed = self.parseOptions(unknown);
206
+
207
+ // Output help if necessary
208
+ outputHelpIfNecessary(self, parsed.unknown);
209
+
210
+ // If there are still any unknown options, then we simply
211
+ // die, unless someone asked for help, in which case we give it
212
+ // to them, and then we die.
213
+ if (parsed.unknown.length > 0) {
214
+ self.unknownOption(parsed.unknown[0]);
215
+ }
216
+
217
+ self.args.forEach(function(arg, i){
218
+ if (arg.required && null == args[i]) {
219
+ self.missingArgument(arg.name);
220
+ }
221
+ });
222
+
223
+ // Always append ourselves to the end of the arguments,
224
+ // to make sure we match the number of arguments the user
225
+ // expects
226
+ if (self.args.length) {
227
+ args[self.args.length] = self;
228
+ } else {
229
+ args.push(self);
230
+ }
231
+
232
+ fn.apply(this, args);
233
+ });
234
+ return this;
235
+ };
236
+
237
+ /**
238
+ * Define option with `flags`, `description` and optional
239
+ * coercion `fn`.
240
+ *
241
+ * The `flags` string should contain both the short and long flags,
242
+ * separated by comma, a pipe or space. The following are all valid
243
+ * all will output this way when `--help` is used.
244
+ *
245
+ * "-p, --pepper"
246
+ * "-p|--pepper"
247
+ * "-p --pepper"
248
+ *
249
+ * Examples:
250
+ *
251
+ * // simple boolean defaulting to false
252
+ * program.option('-p, --pepper', 'add pepper');
253
+ *
254
+ * --pepper
255
+ * program.pepper
256
+ * // => Boolean
257
+ *
258
+ * // simple boolean defaulting to false
259
+ * program.option('-C, --no-cheese', 'remove cheese');
260
+ *
261
+ * program.cheese
262
+ * // => true
263
+ *
264
+ * --no-cheese
265
+ * program.cheese
266
+ * // => true
267
+ *
268
+ * // required argument
269
+ * program.option('-C, --chdir <path>', 'change the working directory');
270
+ *
271
+ * --chdir /tmp
272
+ * program.chdir
273
+ * // => "/tmp"
274
+ *
275
+ * // optional argument
276
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
277
+ *
278
+ * @param {String} flags
279
+ * @param {String} description
280
+ * @param {Function|Mixed} fn or default
281
+ * @param {Mixed} defaultValue
282
+ * @return {Command} for chaining
283
+ * @api public
284
+ */
285
+
286
+ Command.prototype.option = function(flags, description, fn, defaultValue){
287
+ var self = this
288
+ , option = new Option(flags, description)
289
+ , oname = option.name()
290
+ , name = camelcase(oname);
291
+
292
+ // default as 3rd arg
293
+ if ('function' != typeof fn) defaultValue = fn, fn = null;
294
+
295
+ // preassign default value only for --no-*, [optional], or <required>
296
+ if (false == option.bool || option.optional || option.required) {
297
+ // when --no-* we make sure default is true
298
+ if (false == option.bool) defaultValue = true;
299
+ // preassign only if we have a default
300
+ if (undefined !== defaultValue) self[name] = defaultValue;
301
+ }
302
+
303
+ // register the option
304
+ this.options.push(option);
305
+
306
+ // when it's passed assign the value
307
+ // and conditionally invoke the callback
308
+ this.on(oname, function(val){
309
+ // coercion
310
+ if (null != val && fn) val = fn(val);
311
+
312
+ // unassigned or bool
313
+ if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
314
+ // if no value, bool true, and we have a default, then use it!
315
+ if (null == val) {
316
+ self[name] = option.bool
317
+ ? defaultValue || true
318
+ : false;
319
+ } else {
320
+ self[name] = val;
321
+ }
322
+ } else if (null !== val) {
323
+ // reassign
324
+ self[name] = val;
325
+ }
326
+ });
327
+
328
+ return this;
329
+ };
330
+
331
+ /**
332
+ * Parse `argv`, settings options and invoking commands when defined.
333
+ *
334
+ * @param {Array} argv
335
+ * @return {Command} for chaining
336
+ * @api public
337
+ */
338
+
339
+ Command.prototype.parse = function(argv){
340
+ // store raw args
341
+ this.rawArgs = argv;
342
+
343
+ // guess name
344
+ if (!this.name) this.name = basename(argv[1]);
345
+
346
+ // process argv
347
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
348
+ this.args = parsed.args;
349
+ return this.parseArgs(this.args, parsed.unknown);
350
+ };
351
+
352
+ /**
353
+ * Normalize `args`, splitting joined short flags. For example
354
+ * the arg "-abc" is equivalent to "-a -b -c".
355
+ *
356
+ * @param {Array} args
357
+ * @return {Array}
358
+ * @api private
359
+ */
360
+
361
+ Command.prototype.normalize = function(args){
362
+ var ret = []
363
+ , arg;
364
+
365
+ for (var i = 0, len = args.length; i < len; ++i) {
366
+ arg = args[i];
367
+ if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
368
+ arg.slice(1).split('').forEach(function(c){
369
+ ret.push('-' + c);
370
+ });
371
+ } else {
372
+ ret.push(arg);
373
+ }
374
+ }
375
+
376
+ return ret;
377
+ };
378
+
379
+ /**
380
+ * Parse command `args`.
381
+ *
382
+ * When listener(s) are available those
383
+ * callbacks are invoked, otherwise the "*"
384
+ * event is emitted and those actions are invoked.
385
+ *
386
+ * @param {Array} args
387
+ * @return {Command} for chaining
388
+ * @api private
389
+ */
390
+
391
+ Command.prototype.parseArgs = function(args, unknown){
392
+ var cmds = this.commands
393
+ , len = cmds.length
394
+ , name;
395
+
396
+ if (args.length) {
397
+ name = args[0];
398
+ if (this.listeners(name).length) {
399
+ this.emit(args.shift(), args, unknown);
400
+ } else {
401
+ this.emit('*', args);
402
+ }
403
+ } else {
404
+ outputHelpIfNecessary(this, unknown);
405
+
406
+ // If there were no args and we have unknown options,
407
+ // then they are extraneous and we need to error.
408
+ if (unknown.length > 0) {
409
+ this.unknownOption(unknown[0]);
410
+ }
411
+ }
412
+
413
+ return this;
414
+ };
415
+
416
+ /**
417
+ * Return an option matching `arg` if any.
418
+ *
419
+ * @param {String} arg
420
+ * @return {Option}
421
+ * @api private
422
+ */
423
+
424
+ Command.prototype.optionFor = function(arg){
425
+ for (var i = 0, len = this.options.length; i < len; ++i) {
426
+ if (this.options[i].is(arg)) {
427
+ return this.options[i];
428
+ }
429
+ }
430
+ };
431
+
432
+ /**
433
+ * Parse options from `argv` returning `argv`
434
+ * void of these options.
435
+ *
436
+ * @param {Array} argv
437
+ * @return {Array}
438
+ * @api public
439
+ */
440
+
441
+ Command.prototype.parseOptions = function(argv){
442
+ var args = []
443
+ , len = argv.length
444
+ , literal
445
+ , option
446
+ , arg;
447
+
448
+ var unknownOptions = [];
449
+
450
+ // parse options
451
+ for (var i = 0; i < len; ++i) {
452
+ arg = argv[i];
453
+
454
+ // literal args after --
455
+ if ('--' == arg) {
456
+ literal = true;
457
+ continue;
458
+ }
459
+
460
+ if (literal) {
461
+ args.push(arg);
462
+ continue;
463
+ }
464
+
465
+ // find matching Option
466
+ option = this.optionFor(arg);
467
+
468
+ // option is defined
469
+ if (option) {
470
+ // requires arg
471
+ if (option.required) {
472
+ arg = argv[++i];
473
+ if (null == arg) return this.optionMissingArgument(option);
474
+ if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
475
+ this.emit(option.name(), arg);
476
+ // optional arg
477
+ } else if (option.optional) {
478
+ arg = argv[i+1];
479
+ if (null == arg || '-' == arg[0]) {
480
+ arg = null;
481
+ } else {
482
+ ++i;
483
+ }
484
+ this.emit(option.name(), arg);
485
+ // bool
486
+ } else {
487
+ this.emit(option.name());
488
+ }
489
+ continue;
490
+ }
491
+
492
+ // looks like an option
493
+ if (arg.length > 1 && '-' == arg[0]) {
494
+ unknownOptions.push(arg);
495
+
496
+ // If the next argument looks like it might be
497
+ // an argument for this option, we pass it on.
498
+ // If it isn't, then it'll simply be ignored
499
+ if (argv[i+1] && '-' != argv[i+1][0]) {
500
+ unknownOptions.push(argv[++i]);
501
+ }
502
+ continue;
503
+ }
504
+
505
+ // arg
506
+ args.push(arg);
507
+ }
508
+
509
+ return { args: args, unknown: unknownOptions };
510
+ };
511
+
512
+ /**
513
+ * Argument `name` is missing.
514
+ *
515
+ * @param {String} name
516
+ * @api private
517
+ */
518
+
519
+ Command.prototype.missingArgument = function(name){
520
+ console.error();
521
+ console.error(" error: missing required argument `%s'", name);
522
+ console.error();
523
+ process.exit(1);
524
+ };
525
+
526
+ /**
527
+ * `Option` is missing an argument, but received `flag` or nothing.
528
+ *
529
+ * @param {String} option
530
+ * @param {String} flag
531
+ * @api private
532
+ */
533
+
534
+ Command.prototype.optionMissingArgument = function(option, flag){
535
+ console.error();
536
+ if (flag) {
537
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
538
+ } else {
539
+ console.error(" error: option `%s' argument missing", option.flags);
540
+ }
541
+ console.error();
542
+ process.exit(1);
543
+ };
544
+
545
+ /**
546
+ * Unknown option `flag`.
547
+ *
548
+ * @param {String} flag
549
+ * @api private
550
+ */
551
+
552
+ Command.prototype.unknownOption = function(flag){
553
+ console.error();
554
+ console.error(" error: unknown option `%s'", flag);
555
+ console.error();
556
+ process.exit(1);
557
+ };
558
+
559
+ /**
560
+ * Set the program version to `str`.
561
+ *
562
+ * This method auto-registers the "-V, --version" flag
563
+ * which will print the version number when passed.
564
+ *
565
+ * @param {String} str
566
+ * @param {String} flags
567
+ * @return {Command} for chaining
568
+ * @api public
569
+ */
570
+
571
+ Command.prototype.version = function(str, flags){
572
+ if (0 == arguments.length) return this._version;
573
+ this._version = str;
574
+ flags = flags || '-V, --version';
575
+ this.option(flags, 'output the version number');
576
+ this.on('version', function(){
577
+ console.log(str);
578
+ process.exit(0);
579
+ });
580
+ return this;
581
+ };
582
+
583
+ /**
584
+ * Set the description `str`.
585
+ *
586
+ * @param {String} str
587
+ * @return {String|Command}
588
+ * @api public
589
+ */
590
+
591
+ Command.prototype.description = function(str){
592
+ if (0 == arguments.length) return this._description;
593
+ this._description = str;
594
+ return this;
595
+ };
596
+
597
+ /**
598
+ * Set / get the command usage `str`.
599
+ *
600
+ * @param {String} str
601
+ * @return {String|Command}
602
+ * @api public
603
+ */
604
+
605
+ Command.prototype.usage = function(str){
606
+ var args = this.args.map(function(arg){
607
+ return arg.required
608
+ ? '<' + arg.name + '>'
609
+ : '[' + arg.name + ']';
610
+ });
611
+
612
+ var usage = '[options'
613
+ + (this.commands.length ? '] [command' : '')
614
+ + ']'
615
+ + (this.args.length ? ' ' + args : '');
616
+ if (0 == arguments.length) return this._usage || usage;
617
+ this._usage = str;
618
+
619
+ return this;
620
+ };
621
+
622
+ /**
623
+ * Return the largest option length.
624
+ *
625
+ * @return {Number}
626
+ * @api private
627
+ */
628
+
629
+ Command.prototype.largestOptionLength = function(){
630
+ return this.options.reduce(function(max, option){
631
+ return Math.max(max, option.flags.length);
632
+ }, 0);
633
+ };
634
+
635
+ /**
636
+ * Return help for options.
637
+ *
638
+ * @return {String}
639
+ * @api private
640
+ */
641
+
642
+ Command.prototype.optionHelp = function(){
643
+ var width = this.largestOptionLength();
644
+
645
+ // Prepend the help information
646
+ return [pad('-h, --help', width) + ' ' + 'output usage information']
647
+ .concat(this.options.map(function(option){
648
+ return pad(option.flags, width)
649
+ + ' ' + option.description;
650
+ }))
651
+ .join('\n');
652
+ };
653
+
654
+ /**
655
+ * Return command help documentation.
656
+ *
657
+ * @return {String}
658
+ * @api private
659
+ */
660
+
661
+ Command.prototype.commandHelp = function(){
662
+ if (!this.commands.length) return '';
663
+ return [
664
+ ''
665
+ , ' Commands:'
666
+ , ''
667
+ , this.commands.map(function(cmd){
668
+ var args = cmd.args.map(function(arg){
669
+ return arg.required
670
+ ? '<' + arg.name + '>'
671
+ : '[' + arg.name + ']';
672
+ }).join(' ');
673
+
674
+ return cmd.name
675
+ + (cmd.options.length
676
+ ? ' [options]'
677
+ : '') + ' ' + args
678
+ + (cmd.description()
679
+ ? '\n' + cmd.description()
680
+ : '');
681
+ }).join('\n\n').replace(/^/gm, ' ')
682
+ , ''
683
+ ].join('\n');
684
+ };
685
+
686
+ /**
687
+ * Return program help documentation.
688
+ *
689
+ * @return {String}
690
+ * @api private
691
+ */
692
+
693
+ Command.prototype.helpInformation = function(){
694
+ return [
695
+ ''
696
+ , ' Usage: ' + this.name + ' ' + this.usage()
697
+ , '' + this.commandHelp()
698
+ , ' Options:'
699
+ , ''
700
+ , '' + this.optionHelp().replace(/^/gm, ' ')
701
+ , ''
702
+ , ''
703
+ ].join('\n');
704
+ };
705
+
706
+ /**
707
+ * Prompt for a `Number`.
708
+ *
709
+ * @param {String} str
710
+ * @param {Function} fn
711
+ * @api private
712
+ */
713
+
714
+ Command.prototype.promptForNumber = function(str, fn){
715
+ var self = this;
716
+ this.promptSingleLine(str, function parseNumber(val){
717
+ val = Number(val);
718
+ if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
719
+ fn(val);
720
+ });
721
+ };
722
+
723
+ /**
724
+ * Prompt for a `Date`.
725
+ *
726
+ * @param {String} str
727
+ * @param {Function} fn
728
+ * @api private
729
+ */
730
+
731
+ Command.prototype.promptForDate = function(str, fn){
732
+ var self = this;
733
+ this.promptSingleLine(str, function parseDate(val){
734
+ val = new Date(val);
735
+ if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
736
+ fn(val);
737
+ });
738
+ };
739
+
740
+ /**
741
+ * Single-line prompt.
742
+ *
743
+ * @param {String} str
744
+ * @param {Function} fn
745
+ * @api private
746
+ */
747
+
748
+ Command.prototype.promptSingleLine = function(str, fn){
749
+ if ('function' == typeof arguments[2]) {
750
+ return this['promptFor' + (fn.name || fn)](str, arguments[2]);
751
+ }
752
+
753
+ process.stdout.write(str);
754
+ process.stdin.setEncoding('utf8');
755
+ process.stdin.once('data', function(val){
756
+ fn(val.trim());
757
+ }).resume();
758
+ };
759
+
760
+ /**
761
+ * Multi-line prompt.
762
+ *
763
+ * @param {String} str
764
+ * @param {Function} fn
765
+ * @api private
766
+ */
767
+
768
+ Command.prototype.promptMultiLine = function(str, fn){
769
+ var buf = [];
770
+ console.log(str);
771
+ process.stdin.setEncoding('utf8');
772
+ process.stdin.on('data', function(val){
773
+ if ('\n' == val || '\r\n' == val) {
774
+ process.stdin.removeAllListeners('data');
775
+ fn(buf.join('\n'));
776
+ } else {
777
+ buf.push(val.trimRight());
778
+ }
779
+ }).resume();
780
+ };
781
+
782
+ /**
783
+ * Prompt `str` and callback `fn(val)`
784
+ *
785
+ * Commander supports single-line and multi-line prompts.
786
+ * To issue a single-line prompt simply add white-space
787
+ * to the end of `str`, something like "name: ", whereas
788
+ * for a multi-line prompt omit this "description:".
789
+ *
790
+ *
791
+ * Examples:
792
+ *
793
+ * program.prompt('Username: ', function(name){
794
+ * console.log('hi %s', name);
795
+ * });
796
+ *
797
+ * program.prompt('Description:', function(desc){
798
+ * console.log('description was "%s"', desc.trim());
799
+ * });
800
+ *
801
+ * @param {String|Object} str
802
+ * @param {Function} fn
803
+ * @api public
804
+ */
805
+
806
+ Command.prototype.prompt = function(str, fn){
807
+ var self = this;
808
+
809
+ if ('string' == typeof str) {
810
+ if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
811
+ this.promptMultiLine(str, fn);
812
+ } else {
813
+ var keys = Object.keys(str)
814
+ , obj = {};
815
+
816
+ function next() {
817
+ var key = keys.shift()
818
+ , label = str[key];
819
+
820
+ if (!key) return fn(obj);
821
+ self.prompt(label, function(val){
822
+ obj[key] = val;
823
+ next();
824
+ });
825
+ }
826
+
827
+ next();
828
+ }
829
+ };
830
+
831
+ /**
832
+ * Prompt for password with `str`, `mask` char and callback `fn(val)`.
833
+ *
834
+ * The mask string defaults to '', aka no output is
835
+ * written while typing, you may want to use "*" etc.
836
+ *
837
+ * Examples:
838
+ *
839
+ * program.password('Password: ', function(pass){
840
+ * console.log('got "%s"', pass);
841
+ * process.stdin.destroy();
842
+ * });
843
+ *
844
+ * program.password('Password: ', '*', function(pass){
845
+ * console.log('got "%s"', pass);
846
+ * process.stdin.destroy();
847
+ * });
848
+ *
849
+ * @param {String} str
850
+ * @param {String} mask
851
+ * @param {Function} fn
852
+ * @api public
853
+ */
854
+
855
+ Command.prototype.password = function(str, mask, fn){
856
+ var self = this
857
+ , buf = '';
858
+
859
+ // default mask
860
+ if ('function' == typeof mask) {
861
+ fn = mask;
862
+ mask = '';
863
+ }
864
+
865
+ process.stdin.resume();
866
+ tty.setRawMode(true);
867
+ process.stdout.write(str);
868
+
869
+ // keypress
870
+ process.stdin.on('keypress', function(c, key){
871
+ if (key && 'enter' == key.name) {
872
+ console.log();
873
+ process.stdin.removeAllListeners('keypress');
874
+ tty.setRawMode(false);
875
+ if (!buf.trim().length) return self.password(str, mask, fn);
876
+ fn(buf);
877
+ return;
878
+ }
879
+
880
+ if (key && key.ctrl && 'c' == key.name) {
881
+ console.log('%s', buf);
882
+ process.exit();
883
+ }
884
+
885
+ process.stdout.write(mask);
886
+ buf += c;
887
+ }).resume();
888
+ };
889
+
890
+ /**
891
+ * Confirmation prompt with `str` and callback `fn(bool)`
892
+ *
893
+ * Examples:
894
+ *
895
+ * program.confirm('continue? ', function(ok){
896
+ * console.log(' got %j', ok);
897
+ * process.stdin.destroy();
898
+ * });
899
+ *
900
+ * @param {String} str
901
+ * @param {Function} fn
902
+ * @api public
903
+ */
904
+
905
+
906
+ Command.prototype.confirm = function(str, fn, verbose){
907
+ var self = this;
908
+ this.prompt(str, function(ok){
909
+ if (!ok.trim()) {
910
+ if (!verbose) str += '(yes or no) ';
911
+ return self.confirm(str, fn, true);
912
+ }
913
+ fn(parseBool(ok));
914
+ });
915
+ };
916
+
917
+ /**
918
+ * Choice prompt with `list` of items and callback `fn(index, item)`
919
+ *
920
+ * Examples:
921
+ *
922
+ * var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
923
+ *
924
+ * console.log('Choose the coolest pet:');
925
+ * program.choose(list, function(i){
926
+ * console.log('you chose %d "%s"', i, list[i]);
927
+ * process.stdin.destroy();
928
+ * });
929
+ *
930
+ * @param {Array} list
931
+ * @param {Number|Function} index or fn
932
+ * @param {Function} fn
933
+ * @api public
934
+ */
935
+
936
+ Command.prototype.choose = function(list, index, fn){
937
+ var self = this
938
+ , hasDefault = 'number' == typeof index;
939
+
940
+ if (!hasDefault) {
941
+ fn = index;
942
+ index = null;
943
+ }
944
+
945
+ list.forEach(function(item, i){
946
+ if (hasDefault && i == index) {
947
+ console.log('* %d) %s', i + 1, item);
948
+ } else {
949
+ console.log(' %d) %s', i + 1, item);
950
+ }
951
+ });
952
+
953
+ function again() {
954
+ self.prompt(' : ', function(val){
955
+ val = parseInt(val, 10) - 1;
956
+ if (hasDefault && isNaN(val)) val = index;
957
+
958
+ if (null == list[val]) {
959
+ again();
960
+ } else {
961
+ fn(val, list[val]);
962
+ }
963
+ });
964
+ }
965
+
966
+ again();
967
+ };
968
+
969
+ /**
970
+ * Camel-case the given `flag`
971
+ *
972
+ * @param {String} flag
973
+ * @return {String}
974
+ * @api private
975
+ */
976
+
977
+ function camelcase(flag) {
978
+ return flag.split('-').reduce(function(str, word){
979
+ return str + word[0].toUpperCase() + word.slice(1);
980
+ });
981
+ }
982
+
983
+ /**
984
+ * Parse a boolean `str`.
985
+ *
986
+ * @param {String} str
987
+ * @return {Boolean}
988
+ * @api private
989
+ */
990
+
991
+ function parseBool(str) {
992
+ return /^y|yes|ok|true$/i.test(str);
993
+ }
994
+
995
+ /**
996
+ * Pad `str` to `width`.
997
+ *
998
+ * @param {String} str
999
+ * @param {Number} width
1000
+ * @return {String}
1001
+ * @api private
1002
+ */
1003
+
1004
+ function pad(str, width) {
1005
+ var len = Math.max(0, width - str.length);
1006
+ return str + Array(len + 1).join(' ');
1007
+ }
1008
+
1009
+ /**
1010
+ * Output help information if necessary
1011
+ *
1012
+ * @param {Command} command to output help for
1013
+ * @param {Array} array of options to search for -h or --help
1014
+ * @api private
1015
+ */
1016
+
1017
+ function outputHelpIfNecessary(cmd, options) {
1018
+ options = options || [];
1019
+ for (var i = 0; i < options.length; i++) {
1020
+ if (options[i] == '--help' || options[i] == '-h') {
1021
+ process.stdout.write(cmd.helpInformation());
1022
+ cmd.emit('--help');
1023
+ process.exit(0);
1024
+ }
1025
+ }
1026
+ }