exercism-analysis 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. checksums.yaml +7 -0
  2. data/exercism-analysis.gemspec +30 -0
  3. data/lib/exercism-analysis.rb +38 -0
  4. data/lib/exercism-analysis/adapters/adapter.rb +23 -0
  5. data/lib/exercism-analysis/adapters/clojure.rb +13 -0
  6. data/lib/exercism-analysis/adapters/go.rb +19 -0
  7. data/lib/exercism-analysis/adapters/javascript.rb +13 -0
  8. data/lib/exercism-analysis/adapters/python.rb +13 -0
  9. data/lib/exercism-analysis/adapters/ruby.rb +19 -0
  10. data/lib/exercism-analysis/analysis.rb +18 -0
  11. data/lib/exercism-analysis/analyzers/analyzer.rb +54 -0
  12. data/lib/exercism-analysis/analyzers/clojure/kibit.rb +25 -0
  13. data/lib/exercism-analysis/analyzers/go/golint.rb +23 -0
  14. data/lib/exercism-analysis/analyzers/javascript/jslint.rb +24 -0
  15. data/lib/exercism-analysis/analyzers/python/pylint.rb +24 -0
  16. data/lib/exercism-analysis/analyzers/ruby/control_flow.rb +21 -0
  17. data/lib/exercism-analysis/analyzers/ruby/enumerable_condition.rb +21 -0
  18. data/lib/exercism-analysis/analyzers/ruby/for_loop.rb +29 -0
  19. data/lib/exercism-analysis/analyzers/ruby/indentation.rb +21 -0
  20. data/lib/exercism-analysis/analyzers/ruby/iter_mutation.rb +37 -0
  21. data/lib/exercism-analysis/analyzers/ruby/output.rb +20 -0
  22. data/lib/exercism-analysis/analyzers/ruby/range.rb +28 -0
  23. data/lib/exercism-analysis/analyzers/ruby/roodi.rb +19 -0
  24. data/lib/exercism-analysis/analyzers/ruby/send.rb +25 -0
  25. data/lib/exercism-analysis/analyzers/ruby/shebang.rb +23 -0
  26. data/lib/exercism-analysis/analyzers/ruby/tab.rb +38 -0
  27. data/lib/exercism-analysis/processors/call_processor.rb +39 -0
  28. data/lib/exercism-analysis/processors/control_flow_processor.rb +27 -0
  29. data/lib/exercism-analysis/processors/enumerable_condition_processor.rb +31 -0
  30. data/lib/exercism-analysis/processors/for_loop_processor.rb +21 -0
  31. data/lib/exercism-analysis/processors/indentation_processor.rb +69 -0
  32. data/lib/exercism-analysis/processors/iter_mutation_processor.rb +50 -0
  33. data/lib/exercism-analysis/processors/processor.rb +34 -0
  34. data/lib/exercism-analysis/processors/range_processor.rb +23 -0
  35. data/lib/exercism-analysis/processors/send_processor.rb +23 -0
  36. data/lib/exercism-analysis/templates/each_to_map.rb +29 -0
  37. data/lib/exercism-analysis/templates/each_to_select.rb +31 -0
  38. data/lib/exercism-analysis/templates/range_exclusive.rb +19 -0
  39. data/lib/exercism-analysis/templates/template.rb +29 -0
  40. data/vendor/clojure/kibit-runner/LICENSE +214 -0
  41. data/vendor/clojure/kibit-runner/project.clj +10 -0
  42. data/vendor/clojure/kibit-runner/src/kibit_runner/core.clj +17 -0
  43. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT-standalone.jar +0 -0
  44. data/vendor/clojure/kibit-runner/target/kibit-runner-0.1.0-SNAPSHOT.jar +0 -0
  45. data/vendor/clojure/kibit-runner/target/stale/extract-native.dependencies +1 -0
  46. data/vendor/go/src/github.com/golang/lint/LICENSE +27 -0
  47. data/vendor/go/src/github.com/golang/lint/README +59 -0
  48. data/vendor/go/src/github.com/golang/lint/golint/golint.go +67 -0
  49. data/vendor/go/src/github.com/golang/lint/lint.go +1061 -0
  50. data/vendor/go/src/runner/golint_runner.go +23 -0
  51. data/vendor/javascript/jshint_runner.js +6 -0
  52. data/vendor/javascript/node_modules/jshint/README.md +47 -0
  53. data/vendor/javascript/node_modules/jshint/bin/apply +6 -0
  54. data/vendor/javascript/node_modules/jshint/bin/build +36 -0
  55. data/vendor/javascript/node_modules/jshint/bin/changelog +36 -0
  56. data/vendor/javascript/node_modules/jshint/bin/jshint +3 -0
  57. data/vendor/javascript/node_modules/jshint/bin/land +34 -0
  58. data/vendor/javascript/node_modules/jshint/data/ascii-identifier-data.js +22 -0
  59. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-part-only.js +1570 -0
  60. data/vendor/javascript/node_modules/jshint/data/non-ascii-identifier-start.js +48477 -0
  61. data/vendor/javascript/node_modules/jshint/dist/jshint-rhino.js +60642 -0
  62. data/vendor/javascript/node_modules/jshint/dist/jshint.js +60525 -0
  63. data/vendor/javascript/node_modules/jshint/node_modules/cli/README.md +196 -0
  64. data/vendor/javascript/node_modules/jshint/node_modules/cli/cli.js +1139 -0
  65. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/cat.js +17 -0
  66. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/command.js +16 -0
  67. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/echo.js +54 -0
  68. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/glob.js +6 -0
  69. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/long_desc.js +20 -0
  70. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/progress.js +11 -0
  71. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/sort.js +18 -0
  72. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/spinner.js +9 -0
  73. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.coffee +27 -0
  74. data/vendor/javascript/node_modules/jshint/node_modules/cli/examples/static.js +25 -0
  75. data/vendor/javascript/node_modules/jshint/node_modules/cli/index.js +1 -0
  76. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/LICENSE +27 -0
  77. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/README.md +250 -0
  78. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/g.js +9 -0
  79. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/examples/usr-local.js +9 -0
  80. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/glob.js +728 -0
  81. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  82. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/README.md +42 -0
  83. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  84. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  85. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/package.json +51 -0
  86. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/node_modules/inherits/test.js +25 -0
  87. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/package.json +58 -0
  88. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/00-setup.js +176 -0
  89. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-comparison.js +63 -0
  90. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/bash-results.json +351 -0
  91. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/cwd-test.js +55 -0
  92. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/globstar-match.js +19 -0
  93. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/mark.js +118 -0
  94. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/new-glob-optional-options.js +10 -0
  95. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/nocase-nomagic.js +113 -0
  96. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/pause-resume.js +73 -0
  97. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/readme-issue.js +36 -0
  98. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root-nomount.js +39 -0
  99. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/root.js +46 -0
  100. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/stat.js +32 -0
  101. data/vendor/javascript/node_modules/jshint/node_modules/cli/node_modules/glob/test/zz-cleanup.js +11 -0
  102. data/vendor/javascript/node_modules/jshint/node_modules/cli/package.json +70 -0
  103. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/LICENCE +19 -0
  104. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/README.md +33 -0
  105. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/index.js +86 -0
  106. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/LICENCE +19 -0
  107. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/README.md +45 -0
  108. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/index.js +5 -0
  109. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/package.json +89 -0
  110. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/seed.js +16 -0
  111. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/index.js +28 -0
  112. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/node_modules/date-now/test/static/index.html +10 -0
  113. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/package.json +88 -0
  114. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/index.js +67 -0
  115. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/index.html +12 -0
  116. data/vendor/javascript/node_modules/jshint/node_modules/console-browserify/test/static/test-adapter.js +53 -0
  117. data/vendor/javascript/node_modules/jshint/node_modules/exit/Gruntfile.js +48 -0
  118. data/vendor/javascript/node_modules/jshint/node_modules/exit/LICENSE-MIT +22 -0
  119. data/vendor/javascript/node_modules/jshint/node_modules/exit/README.md +75 -0
  120. data/vendor/javascript/node_modules/jshint/node_modules/exit/lib/exit.js +41 -0
  121. data/vendor/javascript/node_modules/jshint/node_modules/exit/package.json +69 -0
  122. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/exit_test.js +121 -0
  123. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
  124. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
  125. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
  126. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
  127. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
  128. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
  129. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
  130. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
  131. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
  132. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/create-files.sh +8 -0
  133. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log-broken.js +23 -0
  134. data/vendor/javascript/node_modules/jshint/node_modules/exit/test/fixtures/log.js +25 -0
  135. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/LICENSE +18 -0
  136. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/README.md +83 -0
  137. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/CollectingHandler.js +55 -0
  138. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/FeedHandler.js +95 -0
  139. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Parser.js +337 -0
  140. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/ProxyHandler.js +27 -0
  141. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Stream.js +35 -0
  142. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/Tokenizer.js +891 -0
  143. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/WritableStream.js +21 -0
  144. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/lib/index.js +68 -0
  145. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/LICENSE +11 -0
  146. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/index.js +14 -0
  147. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/package.json +40 -0
  148. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domelementtype/readme.md +1 -0
  149. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/LICENSE +11 -0
  150. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/index.js +211 -0
  151. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/package.json +68 -0
  152. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/readme.md +102 -0
  153. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/01-basic.json +57 -0
  154. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/02-single_tag_1.json +21 -0
  155. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/03-single_tag_2.json +21 -0
  156. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/04-unescaped_in_script.json +27 -0
  157. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/05-tags_in_comment.json +18 -0
  158. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/06-comment_in_script.json +18 -0
  159. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/07-unescaped_in_style.json +20 -0
  160. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/08-extra_spaces_in_tag.json +20 -0
  161. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/09-unquoted_attrib.json +20 -0
  162. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/10-singular_attribute.json +15 -0
  163. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/11-text_outside_tags.json +40 -0
  164. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/12-text_only.json +11 -0
  165. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/13-comment_in_text.json +19 -0
  166. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/14-comment_in_text_in_script.json +18 -0
  167. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/15-non-verbose.json +22 -0
  168. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/16-normalize_whitespace.json +47 -0
  169. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/17-xml_namespace.json +18 -0
  170. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/18-enforce_empty_tags.json +16 -0
  171. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/19-ignore_empty_tags.json +20 -0
  172. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/20-template_script_tags.json +20 -0
  173. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/21-conditional_comments.json +15 -0
  174. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/22-lowercase_tags.json +41 -0
  175. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/cases/23-dom-lvl1.json +121 -0
  176. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domhandler/test/tests.js +58 -0
  177. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/LICENSE +11 -0
  178. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/index.js +14 -0
  179. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/helpers.js +141 -0
  180. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/legacy.js +87 -0
  181. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/manipulation.js +77 -0
  182. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/querying.js +94 -0
  183. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/stringify.js +93 -0
  184. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/lib/traversal.js +24 -0
  185. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/package.json +71 -0
  186. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/readme.md +1 -0
  187. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/fixture.js +6 -0
  188. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/helpers.js +89 -0
  189. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/tests/legacy.js +119 -0
  190. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/domutils/test/utils.js +9 -0
  191. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/LICENSE +11 -0
  192. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/index.js +31 -0
  193. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode.js +72 -0
  194. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/decode_codepoint.js +26 -0
  195. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/lib/encode.js +48 -0
  196. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/decode.json +1 -0
  197. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/entities.json +1 -0
  198. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/legacy.json +1 -0
  199. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/maps/xml.json +1 -0
  200. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/package.json +79 -0
  201. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/readme.md +31 -0
  202. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/mocha.opts +2 -0
  203. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/entities/test/test.js +150 -0
  204. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/LICENSE +18 -0
  205. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/README.md +15 -0
  206. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/duplex.js +1 -0
  207. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/float.patch +923 -0
  208. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
  209. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
  210. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_readable.js +944 -0
  211. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_transform.js +209 -0
  212. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/lib/_stream_writable.js +472 -0
  213. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/README.md +3 -0
  214. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/float.patch +604 -0
  215. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +107 -0
  216. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/package.json +53 -0
  217. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/core-util-is/util.js +106 -0
  218. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/LICENSE +16 -0
  219. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/README.md +42 -0
  220. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits.js +1 -0
  221. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +23 -0
  222. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/package.json +51 -0
  223. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/inherits/test.js +25 -0
  224. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/README.md +54 -0
  225. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/build/build.js +209 -0
  226. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
  227. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/index.js +3 -0
  228. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/isarray/package.json +54 -0
  229. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +20 -0
  230. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/README.md +7 -0
  231. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/index.js +200 -0
  232. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/node_modules/string_decoder/package.json +53 -0
  233. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/package.json +68 -0
  234. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/passthrough.js +1 -0
  235. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/readable.js +7 -0
  236. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/transform.js +1 -0
  237. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/node_modules/readable-stream/writable.js +1 -0
  238. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/package.json +90 -0
  239. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/01-events.js +9 -0
  240. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/02-stream.js +23 -0
  241. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/03-feed.js +19 -0
  242. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Atom_Example.xml +25 -0
  243. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Attributes.html +16 -0
  244. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/Basic.html +1 -0
  245. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RDF_Example.xml +63 -0
  246. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Documents/RSS_Example.xml +48 -0
  247. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/01-simple.json +44 -0
  248. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/02-template.json +63 -0
  249. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/03-lowercase_tags.json +46 -0
  250. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/04-cdata.json +50 -0
  251. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/05-cdata-special.json +35 -0
  252. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/06-leading-lt.json +16 -0
  253. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/07-self-closing.json +67 -0
  254. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/08-implicit-close-tags.json +59 -0
  255. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/09-attributes.json +68 -0
  256. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/10-crazy-attrib.json +52 -0
  257. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/11-script_in_script.json +54 -0
  258. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/12-long-comment-end.json +20 -0
  259. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/13-long-cdata-end.json +22 -0
  260. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/14-implicit-open-tags.json +27 -0
  261. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/15-lt-whitespace.json +16 -0
  262. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/16-double_attribs.json +45 -0
  263. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/17-numeric_entities.json +16 -0
  264. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/18-legacy_entities.json +16 -0
  265. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/19-named_entities.json +16 -0
  266. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/20-xml_entities.json +16 -0
  267. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/21-entity_in_attribute.json +38 -0
  268. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/22-double_brackets.json +41 -0
  269. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/23-legacy_entity_fail.json +16 -0
  270. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/24-special_special.json +133 -0
  271. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/25-empty_tag_name.json +13 -0
  272. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/26-not-quite-closed.json +35 -0
  273. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/27-entities_in_attributes.json +62 -0
  274. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/28-cdata_in_html.json +9 -0
  275. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/29-comment_edge-cases.json +18 -0
  276. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Events/30-cdata_edge-cases.json +22 -0
  277. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/01-rss.js +34 -0
  278. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/02-atom.js +18 -0
  279. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Feeds/03-rdf.js +20 -0
  280. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/01-basic.json +83 -0
  281. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/02-RSS.json +1093 -0
  282. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/03-Atom.json +644 -0
  283. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/04-RDF.json +1399 -0
  284. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/Stream/05-Attributes.json +354 -0
  285. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/api.js +63 -0
  286. data/vendor/javascript/node_modules/jshint/node_modules/htmlparser2/test/test-helper.js +83 -0
  287. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/LICENSE +23 -0
  288. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/README.md +218 -0
  289. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/minimatch.js +1061 -0
  290. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  291. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  292. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  293. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  294. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/package.json +50 -0
  295. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  296. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  297. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  298. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  299. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  300. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  301. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/package.json +58 -0
  302. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  303. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  304. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/package.json +57 -0
  305. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/basic.js +399 -0
  306. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/brace-expand.js +33 -0
  307. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/caching.js +14 -0
  308. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/defaults.js +274 -0
  309. data/vendor/javascript/node_modules/jshint/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  310. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/LICENSE +26 -0
  311. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/README.md +569 -0
  312. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/bin/shjs +51 -0
  313. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/global.js +3 -0
  314. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/make.js +47 -0
  315. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/package.json +61 -0
  316. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/generate-docs.js +21 -0
  317. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/scripts/run-tests.js +50 -0
  318. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/shell.js +157 -0
  319. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cat.js +43 -0
  320. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cd.js +19 -0
  321. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/chmod.js +208 -0
  322. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/common.js +203 -0
  323. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/cp.js +201 -0
  324. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/dirs.js +191 -0
  325. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/echo.js +20 -0
  326. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/error.js +10 -0
  327. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/exec.js +181 -0
  328. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/find.js +51 -0
  329. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/grep.js +52 -0
  330. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ln.js +53 -0
  331. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/ls.js +126 -0
  332. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mkdir.js +68 -0
  333. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/mv.js +80 -0
  334. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/popd.js +1 -0
  335. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pushd.js +1 -0
  336. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/pwd.js +11 -0
  337. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/rm.js +145 -0
  338. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/sed.js +43 -0
  339. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/tempdir.js +56 -0
  340. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/test.js +85 -0
  341. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/to.js +29 -0
  342. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/toEnd.js +29 -0
  343. data/vendor/javascript/node_modules/jshint/node_modules/shelljs/src/which.js +83 -0
  344. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/cli.js +41 -0
  345. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/package.json +76 -0
  346. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/readme.md +74 -0
  347. data/vendor/javascript/node_modules/jshint/node_modules/strip-json-comments/strip-json-comments.js +64 -0
  348. data/vendor/javascript/node_modules/jshint/node_modules/underscore/LICENSE +23 -0
  349. data/vendor/javascript/node_modules/jshint/node_modules/underscore/README.md +22 -0
  350. data/vendor/javascript/node_modules/jshint/node_modules/underscore/package.json +66 -0
  351. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore-min.js +6 -0
  352. data/vendor/javascript/node_modules/jshint/node_modules/underscore/underscore.js +1343 -0
  353. data/vendor/javascript/node_modules/jshint/package.json +80 -0
  354. data/vendor/javascript/node_modules/jshint/src/cli.js +731 -0
  355. data/vendor/javascript/node_modules/jshint/src/jshint.js +5023 -0
  356. data/vendor/javascript/node_modules/jshint/src/lex.js +1650 -0
  357. data/vendor/javascript/node_modules/jshint/src/messages.js +223 -0
  358. data/vendor/javascript/node_modules/jshint/src/platforms/rhino.js +115 -0
  359. data/vendor/javascript/node_modules/jshint/src/reg.js +38 -0
  360. data/vendor/javascript/node_modules/jshint/src/reporters/checkstyle.js +81 -0
  361. data/vendor/javascript/node_modules/jshint/src/reporters/default.js +34 -0
  362. data/vendor/javascript/node_modules/jshint/src/reporters/jslint_xml.js +57 -0
  363. data/vendor/javascript/node_modules/jshint/src/reporters/non_error.js +52 -0
  364. data/vendor/javascript/node_modules/jshint/src/state.js +28 -0
  365. data/vendor/javascript/node_modules/jshint/src/style.js +143 -0
  366. data/vendor/javascript/node_modules/jshint/src/vars.js +658 -0
  367. data/vendor/python/astroid/COPYING +339 -0
  368. data/vendor/python/astroid/COPYING.LESSER +510 -0
  369. data/vendor/python/astroid/ChangeLog +574 -0
  370. data/vendor/python/astroid/MANIFEST.in +9 -0
  371. data/vendor/python/astroid/README +56 -0
  372. data/vendor/python/astroid/README.Python3 +26 -0
  373. data/vendor/python/astroid/__init__.py +118 -0
  374. data/vendor/python/astroid/__init__.pyc +0 -0
  375. data/vendor/python/astroid/__pkginfo__.py +48 -0
  376. data/vendor/python/astroid/__pkginfo__.pyc +0 -0
  377. data/vendor/python/astroid/announce.txt +23 -0
  378. data/vendor/python/astroid/as_string.py +496 -0
  379. data/vendor/python/astroid/as_string.pyc +0 -0
  380. data/vendor/python/astroid/bases.py +618 -0
  381. data/vendor/python/astroid/bases.pyc +0 -0
  382. data/vendor/python/astroid/brain/py2gi.py +159 -0
  383. data/vendor/python/astroid/brain/py2gi.pyc +0 -0
  384. data/vendor/python/astroid/brain/py2mechanize.py +20 -0
  385. data/vendor/python/astroid/brain/py2mechanize.pyc +0 -0
  386. data/vendor/python/astroid/brain/py2qt4.py +25 -0
  387. data/vendor/python/astroid/brain/py2qt4.pyc +0 -0
  388. data/vendor/python/astroid/brain/py2stdlib.py +252 -0
  389. data/vendor/python/astroid/brain/py2stdlib.pyc +0 -0
  390. data/vendor/python/astroid/builder.py +238 -0
  391. data/vendor/python/astroid/builder.pyc +0 -0
  392. data/vendor/python/astroid/exceptions.py +51 -0
  393. data/vendor/python/astroid/exceptions.pyc +0 -0
  394. data/vendor/python/astroid/inference.py +393 -0
  395. data/vendor/python/astroid/inference.pyc +0 -0
  396. data/vendor/python/astroid/inspector.py +275 -0
  397. data/vendor/python/astroid/manager.py +336 -0
  398. data/vendor/python/astroid/manager.pyc +0 -0
  399. data/vendor/python/astroid/mixins.py +122 -0
  400. data/vendor/python/astroid/mixins.pyc +0 -0
  401. data/vendor/python/astroid/node_classes.py +928 -0
  402. data/vendor/python/astroid/node_classes.pyc +0 -0
  403. data/vendor/python/astroid/nodes.py +73 -0
  404. data/vendor/python/astroid/nodes.pyc +0 -0
  405. data/vendor/python/astroid/protocols.py +322 -0
  406. data/vendor/python/astroid/protocols.pyc +0 -0
  407. data/vendor/python/astroid/raw_building.py +361 -0
  408. data/vendor/python/astroid/raw_building.pyc +0 -0
  409. data/vendor/python/astroid/rebuilder.py +954 -0
  410. data/vendor/python/astroid/rebuilder.pyc +0 -0
  411. data/vendor/python/astroid/scoped_nodes.py +1118 -0
  412. data/vendor/python/astroid/scoped_nodes.pyc +0 -0
  413. data/vendor/python/astroid/setup.py +184 -0
  414. data/vendor/python/astroid/tox.ini +10 -0
  415. data/vendor/python/astroid/utils.py +236 -0
  416. data/vendor/python/astroid/utils.pyc +0 -0
  417. data/vendor/python/logilab/__init__.py +0 -0
  418. data/vendor/python/logilab/__init__.pyc +0 -0
  419. data/vendor/python/logilab/common/COPYING +339 -0
  420. data/vendor/python/logilab/common/COPYING.LESSER +510 -0
  421. data/vendor/python/logilab/common/ChangeLog +1517 -0
  422. data/vendor/python/logilab/common/MANIFEST.in +13 -0
  423. data/vendor/python/logilab/common/README +185 -0
  424. data/vendor/python/logilab/common/README.Python3 +29 -0
  425. data/vendor/python/logilab/common/__init__.py +171 -0
  426. data/vendor/python/logilab/common/__init__.pyc +0 -0
  427. data/vendor/python/logilab/common/__pkginfo__.py +53 -0
  428. data/vendor/python/logilab/common/__pkginfo__.pyc +0 -0
  429. data/vendor/python/logilab/common/announce.txt +25 -0
  430. data/vendor/python/logilab/common/bin/pytest +7 -0
  431. data/vendor/python/logilab/common/bin/pytest.bat +17 -0
  432. data/vendor/python/logilab/common/cache.py +114 -0
  433. data/vendor/python/logilab/common/changelog.py +236 -0
  434. data/vendor/python/logilab/common/changelog.pyc +0 -0
  435. data/vendor/python/logilab/common/clcommands.py +332 -0
  436. data/vendor/python/logilab/common/cli.py +208 -0
  437. data/vendor/python/logilab/common/compat.py +243 -0
  438. data/vendor/python/logilab/common/compat.pyc +0 -0
  439. data/vendor/python/logilab/common/configuration.py +1094 -0
  440. data/vendor/python/logilab/common/configuration.pyc +0 -0
  441. data/vendor/python/logilab/common/contexts.py +5 -0
  442. data/vendor/python/logilab/common/corbautils.py +117 -0
  443. data/vendor/python/logilab/common/daemon.py +100 -0
  444. data/vendor/python/logilab/common/date.py +333 -0
  445. data/vendor/python/logilab/common/dbf.py +229 -0
  446. data/vendor/python/logilab/common/debugger.py +210 -0
  447. data/vendor/python/logilab/common/decorators.py +281 -0
  448. data/vendor/python/logilab/common/decorators.pyc +0 -0
  449. data/vendor/python/logilab/common/deprecation.py +188 -0
  450. data/vendor/python/logilab/common/deprecation.pyc +0 -0
  451. data/vendor/python/logilab/common/fileutils.py +402 -0
  452. data/vendor/python/logilab/common/graph.py +276 -0
  453. data/vendor/python/logilab/common/graph.pyc +0 -0
  454. data/vendor/python/logilab/common/hg.py +130 -0
  455. data/vendor/python/logilab/common/interface.py +71 -0
  456. data/vendor/python/logilab/common/interface.pyc +0 -0
  457. data/vendor/python/logilab/common/logging_ext.py +193 -0
  458. data/vendor/python/logilab/common/modutils.py +695 -0
  459. data/vendor/python/logilab/common/modutils.pyc +0 -0
  460. data/vendor/python/logilab/common/optik_ext.py +391 -0
  461. data/vendor/python/logilab/common/optik_ext.pyc +0 -0
  462. data/vendor/python/logilab/common/optparser.py +90 -0
  463. data/vendor/python/logilab/common/proc.py +277 -0
  464. data/vendor/python/logilab/common/pyro_ext.py +180 -0
  465. data/vendor/python/logilab/common/pytest.py +1177 -0
  466. data/vendor/python/logilab/common/python-logilab-common.spec +184 -0
  467. data/vendor/python/logilab/common/registry.py +1113 -0
  468. data/vendor/python/logilab/common/setup.cfg +3 -0
  469. data/vendor/python/logilab/common/setup.py +189 -0
  470. data/vendor/python/logilab/common/shellutils.py +455 -0
  471. data/vendor/python/logilab/common/sphinx_ext.py +87 -0
  472. data/vendor/python/logilab/common/sphinxutils.py +122 -0
  473. data/vendor/python/logilab/common/table.py +925 -0
  474. data/vendor/python/logilab/common/tasksqueue.py +100 -0
  475. data/vendor/python/logilab/common/textutils.py +534 -0
  476. data/vendor/python/logilab/common/textutils.pyc +0 -0
  477. data/vendor/python/logilab/common/tree.py +369 -0
  478. data/vendor/python/logilab/common/tree.pyc +0 -0
  479. data/vendor/python/logilab/common/umessage.py +190 -0
  480. data/vendor/python/logilab/common/ureports/__init__.py +174 -0
  481. data/vendor/python/logilab/common/ureports/__init__.pyc +0 -0
  482. data/vendor/python/logilab/common/ureports/docbook_writer.py +139 -0
  483. data/vendor/python/logilab/common/ureports/html_writer.py +131 -0
  484. data/vendor/python/logilab/common/ureports/html_writer.pyc +0 -0
  485. data/vendor/python/logilab/common/ureports/nodes.py +201 -0
  486. data/vendor/python/logilab/common/ureports/nodes.pyc +0 -0
  487. data/vendor/python/logilab/common/ureports/text_writer.py +140 -0
  488. data/vendor/python/logilab/common/ureports/text_writer.pyc +0 -0
  489. data/vendor/python/logilab/common/urllib2ext.py +87 -0
  490. data/vendor/python/logilab/common/vcgutils.py +216 -0
  491. data/vendor/python/logilab/common/visitor.py +107 -0
  492. data/vendor/python/logilab/common/visitor.pyc +0 -0
  493. data/vendor/python/logilab/common/xmlrpcutils.py +131 -0
  494. data/vendor/python/logilab/common/xmlutils.py +61 -0
  495. data/vendor/python/pylint/CONTRIBUTORS.txt +38 -0
  496. data/vendor/python/pylint/COPYING +340 -0
  497. data/vendor/python/pylint/ChangeLog +1437 -0
  498. data/vendor/python/pylint/DEPENDS +3 -0
  499. data/vendor/python/pylint/MANIFEST.in +14 -0
  500. data/vendor/python/pylint/README +50 -0
  501. data/vendor/python/pylint/README.Python3 +37 -0
  502. data/vendor/python/pylint/__init__.py +44 -0
  503. data/vendor/python/pylint/__init__.pyc +0 -0
  504. data/vendor/python/pylint/__main__.py +3 -0
  505. data/vendor/python/pylint/__pkginfo__.py +74 -0
  506. data/vendor/python/pylint/__pkginfo__.pyc +0 -0
  507. data/vendor/python/pylint/bin/epylint +3 -0
  508. data/vendor/python/pylint/bin/epylint.bat +5 -0
  509. data/vendor/python/pylint/bin/pylint +3 -0
  510. data/vendor/python/pylint/bin/pylint-gui +3 -0
  511. data/vendor/python/pylint/bin/pylint-gui.bat +5 -0
  512. data/vendor/python/pylint/bin/pylint.bat +5 -0
  513. data/vendor/python/pylint/bin/pyreverse +3 -0
  514. data/vendor/python/pylint/bin/pyreverse.bat +5 -0
  515. data/vendor/python/pylint/bin/symilar +3 -0
  516. data/vendor/python/pylint/bin/symilar.bat +5 -0
  517. data/vendor/python/pylint/checkers/__init__.py +145 -0
  518. data/vendor/python/pylint/checkers/__init__.pyc +0 -0
  519. data/vendor/python/pylint/checkers/base.py +1141 -0
  520. data/vendor/python/pylint/checkers/base.pyc +0 -0
  521. data/vendor/python/pylint/checkers/classes.py +792 -0
  522. data/vendor/python/pylint/checkers/classes.pyc +0 -0
  523. data/vendor/python/pylint/checkers/design_analysis.py +367 -0
  524. data/vendor/python/pylint/checkers/design_analysis.pyc +0 -0
  525. data/vendor/python/pylint/checkers/exceptions.py +306 -0
  526. data/vendor/python/pylint/checkers/exceptions.pyc +0 -0
  527. data/vendor/python/pylint/checkers/format.py +943 -0
  528. data/vendor/python/pylint/checkers/format.pyc +0 -0
  529. data/vendor/python/pylint/checkers/imports.py +394 -0
  530. data/vendor/python/pylint/checkers/imports.pyc +0 -0
  531. data/vendor/python/pylint/checkers/logging.py +213 -0
  532. data/vendor/python/pylint/checkers/logging.pyc +0 -0
  533. data/vendor/python/pylint/checkers/misc.py +90 -0
  534. data/vendor/python/pylint/checkers/misc.pyc +0 -0
  535. data/vendor/python/pylint/checkers/newstyle.py +151 -0
  536. data/vendor/python/pylint/checkers/newstyle.pyc +0 -0
  537. data/vendor/python/pylint/checkers/raw_metrics.py +129 -0
  538. data/vendor/python/pylint/checkers/raw_metrics.pyc +0 -0
  539. data/vendor/python/pylint/checkers/similar.py +365 -0
  540. data/vendor/python/pylint/checkers/similar.pyc +0 -0
  541. data/vendor/python/pylint/checkers/stdlib.py +69 -0
  542. data/vendor/python/pylint/checkers/stdlib.pyc +0 -0
  543. data/vendor/python/pylint/checkers/strings.py +304 -0
  544. data/vendor/python/pylint/checkers/strings.pyc +0 -0
  545. data/vendor/python/pylint/checkers/typecheck.py +451 -0
  546. data/vendor/python/pylint/checkers/typecheck.pyc +0 -0
  547. data/vendor/python/pylint/checkers/utils.py +416 -0
  548. data/vendor/python/pylint/checkers/utils.pyc +0 -0
  549. data/vendor/python/pylint/checkers/variables.py +741 -0
  550. data/vendor/python/pylint/checkers/variables.pyc +0 -0
  551. data/vendor/python/pylint/config.py +156 -0
  552. data/vendor/python/pylint/config.pyc +0 -0
  553. data/vendor/python/pylint/epylint.py +175 -0
  554. data/vendor/python/pylint/gui.py +508 -0
  555. data/vendor/python/pylint/interfaces.py +72 -0
  556. data/vendor/python/pylint/interfaces.pyc +0 -0
  557. data/vendor/python/pylint/lint.py +1106 -0
  558. data/vendor/python/pylint/lint.pyc +0 -0
  559. data/vendor/python/pylint/pyreverse/__init__.py +5 -0
  560. data/vendor/python/pylint/pyreverse/diadefslib.py +233 -0
  561. data/vendor/python/pylint/pyreverse/diagrams.py +247 -0
  562. data/vendor/python/pylint/pyreverse/main.py +124 -0
  563. data/vendor/python/pylint/pyreverse/utils.py +131 -0
  564. data/vendor/python/pylint/pyreverse/writer.py +199 -0
  565. data/vendor/python/pylint/reporters/__init__.py +138 -0
  566. data/vendor/python/pylint/reporters/__init__.pyc +0 -0
  567. data/vendor/python/pylint/reporters/guireporter.py +28 -0
  568. data/vendor/python/pylint/reporters/guireporter.pyc +0 -0
  569. data/vendor/python/pylint/reporters/html.py +70 -0
  570. data/vendor/python/pylint/reporters/html.pyc +0 -0
  571. data/vendor/python/pylint/reporters/text.py +143 -0
  572. data/vendor/python/pylint/reporters/text.pyc +0 -0
  573. data/vendor/python/pylint/setup.cfg +3 -0
  574. data/vendor/python/pylint/setup.py +203 -0
  575. data/vendor/python/pylint/tox.ini +10 -0
  576. data/vendor/python/pylint/utils.py +744 -0
  577. data/vendor/python/pylint/utils.pyc +0 -0
  578. data/vendor/python/pylint_runner.py +22 -0
  579. metadata +675 -0
@@ -0,0 +1,89 @@
1
+ // Copyright Joyent, Inc. and other Node contributors.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a
4
+ // copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the
9
+ // following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included
12
+ // in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ // a duplex stream is just a stream that is both readable and writable.
23
+ // Since JS doesn't have multiple prototypal inheritance, this class
24
+ // prototypally inherits from Readable, and then parasitically from
25
+ // Writable.
26
+
27
+ module.exports = Duplex;
28
+
29
+ /*<replacement>*/
30
+ var objectKeys = Object.keys || function (obj) {
31
+ var keys = [];
32
+ for (var key in obj) keys.push(key);
33
+ return keys;
34
+ }
35
+ /*</replacement>*/
36
+
37
+
38
+ /*<replacement>*/
39
+ var util = require('core-util-is');
40
+ util.inherits = require('inherits');
41
+ /*</replacement>*/
42
+
43
+ var Readable = require('./_stream_readable');
44
+ var Writable = require('./_stream_writable');
45
+
46
+ util.inherits(Duplex, Readable);
47
+
48
+ forEach(objectKeys(Writable.prototype), function(method) {
49
+ if (!Duplex.prototype[method])
50
+ Duplex.prototype[method] = Writable.prototype[method];
51
+ });
52
+
53
+ function Duplex(options) {
54
+ if (!(this instanceof Duplex))
55
+ return new Duplex(options);
56
+
57
+ Readable.call(this, options);
58
+ Writable.call(this, options);
59
+
60
+ if (options && options.readable === false)
61
+ this.readable = false;
62
+
63
+ if (options && options.writable === false)
64
+ this.writable = false;
65
+
66
+ this.allowHalfOpen = true;
67
+ if (options && options.allowHalfOpen === false)
68
+ this.allowHalfOpen = false;
69
+
70
+ this.once('end', onend);
71
+ }
72
+
73
+ // the no-half-open enforcer
74
+ function onend() {
75
+ // if we allow half-open state, or if the writable side ended,
76
+ // then we're ok.
77
+ if (this.allowHalfOpen || this._writableState.ended)
78
+ return;
79
+
80
+ // no more data can be written.
81
+ // But allow more writes to happen in this tick.
82
+ process.nextTick(this.end.bind(this));
83
+ }
84
+
85
+ function forEach (xs, f) {
86
+ for (var i = 0, l = xs.length; i < l; i++) {
87
+ f(xs[i], i);
88
+ }
89
+ }
@@ -0,0 +1,46 @@
1
+ // Copyright Joyent, Inc. and other Node contributors.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a
4
+ // copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the
9
+ // following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included
12
+ // in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ // a passthrough stream.
23
+ // basically just the most minimal sort of Transform stream.
24
+ // Every written chunk gets output as-is.
25
+
26
+ module.exports = PassThrough;
27
+
28
+ var Transform = require('./_stream_transform');
29
+
30
+ /*<replacement>*/
31
+ var util = require('core-util-is');
32
+ util.inherits = require('inherits');
33
+ /*</replacement>*/
34
+
35
+ util.inherits(PassThrough, Transform);
36
+
37
+ function PassThrough(options) {
38
+ if (!(this instanceof PassThrough))
39
+ return new PassThrough(options);
40
+
41
+ Transform.call(this, options);
42
+ }
43
+
44
+ PassThrough.prototype._transform = function(chunk, encoding, cb) {
45
+ cb(null, chunk);
46
+ };
@@ -0,0 +1,944 @@
1
+ // Copyright Joyent, Inc. and other Node contributors.
2
+ //
3
+ // Permission is hereby granted, free of charge, to any person obtaining a
4
+ // copy of this software and associated documentation files (the
5
+ // "Software"), to deal in the Software without restriction, including
6
+ // without limitation the rights to use, copy, modify, merge, publish,
7
+ // distribute, sublicense, and/or sell copies of the Software, and to permit
8
+ // persons to whom the Software is furnished to do so, subject to the
9
+ // following conditions:
10
+ //
11
+ // The above copyright notice and this permission notice shall be included
12
+ // in all copies or substantial portions of the Software.
13
+ //
14
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+ // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+ // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+ // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module.exports = Readable;
23
+
24
+ /*<replacement>*/
25
+ var isArray = require('isarray');
26
+ /*</replacement>*/
27
+
28
+
29
+ /*<replacement>*/
30
+ var Buffer = require('buffer').Buffer;
31
+ /*</replacement>*/
32
+
33
+ Readable.ReadableState = ReadableState;
34
+
35
+ var EE = require('events').EventEmitter;
36
+
37
+ /*<replacement>*/
38
+ if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
39
+ return emitter.listeners(type).length;
40
+ };
41
+ /*</replacement>*/
42
+
43
+ var Stream = require('stream');
44
+
45
+ /*<replacement>*/
46
+ var util = require('core-util-is');
47
+ util.inherits = require('inherits');
48
+ /*</replacement>*/
49
+
50
+ var StringDecoder;
51
+
52
+
53
+ /*<replacement>*/
54
+ var debug = require('util');
55
+ if (debug && debug.debuglog) {
56
+ debug = debug.debuglog('stream');
57
+ } else {
58
+ debug = function () {};
59
+ }
60
+ /*</replacement>*/
61
+
62
+
63
+ util.inherits(Readable, Stream);
64
+
65
+ function ReadableState(options, stream) {
66
+ options = options || {};
67
+
68
+ // the point at which it stops calling _read() to fill the buffer
69
+ // Note: 0 is a valid value, means "don't call _read preemptively ever"
70
+ var hwm = options.highWaterMark;
71
+ var defaultHwm = options.objectMode ? 16 : 16 * 1024;
72
+ this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;
73
+
74
+ // cast to ints.
75
+ this.highWaterMark = ~~this.highWaterMark;
76
+
77
+ this.buffer = [];
78
+ this.length = 0;
79
+ this.pipes = null;
80
+ this.pipesCount = 0;
81
+ this.flowing = null;
82
+ this.ended = false;
83
+ this.endEmitted = false;
84
+ this.reading = false;
85
+
86
+ // a flag to be able to tell if the onwrite cb is called immediately,
87
+ // or on a later tick. We set this to true at first, because any
88
+ // actions that shouldn't happen until "later" should generally also
89
+ // not happen before the first write call.
90
+ this.sync = true;
91
+
92
+ // whenever we return null, then we set a flag to say
93
+ // that we're awaiting a 'readable' event emission.
94
+ this.needReadable = false;
95
+ this.emittedReadable = false;
96
+ this.readableListening = false;
97
+
98
+
99
+ // object stream flag. Used to make read(n) ignore n and to
100
+ // make all the buffer merging and length checks go away
101
+ this.objectMode = !!options.objectMode;
102
+
103
+ // Crypto is kind of old and crusty. Historically, its default string
104
+ // encoding is 'binary' so we have to make this configurable.
105
+ // Everything else in the universe uses 'utf8', though.
106
+ this.defaultEncoding = options.defaultEncoding || 'utf8';
107
+
108
+ // when piping, we only care about 'readable' events that happen
109
+ // after read()ing all the bytes and not getting any pushback.
110
+ this.ranOut = false;
111
+
112
+ // the number of writers that are awaiting a drain event in .pipe()s
113
+ this.awaitDrain = 0;
114
+
115
+ // if true, a maybeReadMore has been scheduled
116
+ this.readingMore = false;
117
+
118
+ this.decoder = null;
119
+ this.encoding = null;
120
+ if (options.encoding) {
121
+ if (!StringDecoder)
122
+ StringDecoder = require('string_decoder/').StringDecoder;
123
+ this.decoder = new StringDecoder(options.encoding);
124
+ this.encoding = options.encoding;
125
+ }
126
+ }
127
+
128
+ function Readable(options) {
129
+ if (!(this instanceof Readable))
130
+ return new Readable(options);
131
+
132
+ this._readableState = new ReadableState(options, this);
133
+
134
+ // legacy
135
+ this.readable = true;
136
+
137
+ Stream.call(this);
138
+ }
139
+
140
+ // Manually shove something into the read() buffer.
141
+ // This returns true if the highWaterMark has not been hit yet,
142
+ // similar to how Writable.write() returns true if you should
143
+ // write() some more.
144
+ Readable.prototype.push = function(chunk, encoding) {
145
+ var state = this._readableState;
146
+
147
+ if (util.isString(chunk) && !state.objectMode) {
148
+ encoding = encoding || state.defaultEncoding;
149
+ if (encoding !== state.encoding) {
150
+ chunk = new Buffer(chunk, encoding);
151
+ encoding = '';
152
+ }
153
+ }
154
+
155
+ return readableAddChunk(this, state, chunk, encoding, false);
156
+ };
157
+
158
+ // Unshift should *always* be something directly out of read()
159
+ Readable.prototype.unshift = function(chunk) {
160
+ var state = this._readableState;
161
+ return readableAddChunk(this, state, chunk, '', true);
162
+ };
163
+
164
+ function readableAddChunk(stream, state, chunk, encoding, addToFront) {
165
+ var er = chunkInvalid(state, chunk);
166
+ if (er) {
167
+ stream.emit('error', er);
168
+ } else if (util.isNullOrUndefined(chunk)) {
169
+ state.reading = false;
170
+ if (!state.ended)
171
+ onEofChunk(stream, state);
172
+ } else if (state.objectMode || chunk && chunk.length > 0) {
173
+ if (state.ended && !addToFront) {
174
+ var e = new Error('stream.push() after EOF');
175
+ stream.emit('error', e);
176
+ } else if (state.endEmitted && addToFront) {
177
+ var e = new Error('stream.unshift() after end event');
178
+ stream.emit('error', e);
179
+ } else {
180
+ if (state.decoder && !addToFront && !encoding)
181
+ chunk = state.decoder.write(chunk);
182
+
183
+ if (!addToFront)
184
+ state.reading = false;
185
+
186
+ // if we want the data now, just emit it.
187
+ if (state.flowing && state.length === 0 && !state.sync) {
188
+ stream.emit('data', chunk);
189
+ stream.read(0);
190
+ } else {
191
+ // update the buffer info.
192
+ state.length += state.objectMode ? 1 : chunk.length;
193
+ if (addToFront)
194
+ state.buffer.unshift(chunk);
195
+ else
196
+ state.buffer.push(chunk);
197
+
198
+ if (state.needReadable)
199
+ emitReadable(stream);
200
+ }
201
+
202
+ maybeReadMore(stream, state);
203
+ }
204
+ } else if (!addToFront) {
205
+ state.reading = false;
206
+ }
207
+
208
+ return needMoreData(state);
209
+ }
210
+
211
+
212
+
213
+ // if it's past the high water mark, we can push in some more.
214
+ // Also, if we have no data yet, we can stand some
215
+ // more bytes. This is to work around cases where hwm=0,
216
+ // such as the repl. Also, if the push() triggered a
217
+ // readable event, and the user called read(largeNumber) such that
218
+ // needReadable was set, then we ought to push more, so that another
219
+ // 'readable' event will be triggered.
220
+ function needMoreData(state) {
221
+ return !state.ended &&
222
+ (state.needReadable ||
223
+ state.length < state.highWaterMark ||
224
+ state.length === 0);
225
+ }
226
+
227
+ // backwards compatibility.
228
+ Readable.prototype.setEncoding = function(enc) {
229
+ if (!StringDecoder)
230
+ StringDecoder = require('string_decoder/').StringDecoder;
231
+ this._readableState.decoder = new StringDecoder(enc);
232
+ this._readableState.encoding = enc;
233
+ return this;
234
+ };
235
+
236
+ // Don't raise the hwm > 128MB
237
+ var MAX_HWM = 0x800000;
238
+ function roundUpToNextPowerOf2(n) {
239
+ if (n >= MAX_HWM) {
240
+ n = MAX_HWM;
241
+ } else {
242
+ // Get the next highest power of 2
243
+ n--;
244
+ for (var p = 1; p < 32; p <<= 1) n |= n >> p;
245
+ n++;
246
+ }
247
+ return n;
248
+ }
249
+
250
+ function howMuchToRead(n, state) {
251
+ if (state.length === 0 && state.ended)
252
+ return 0;
253
+
254
+ if (state.objectMode)
255
+ return n === 0 ? 0 : 1;
256
+
257
+ if (isNaN(n) || util.isNull(n)) {
258
+ // only flow one buffer at a time
259
+ if (state.flowing && state.buffer.length)
260
+ return state.buffer[0].length;
261
+ else
262
+ return state.length;
263
+ }
264
+
265
+ if (n <= 0)
266
+ return 0;
267
+
268
+ // If we're asking for more than the target buffer level,
269
+ // then raise the water mark. Bump up to the next highest
270
+ // power of 2, to prevent increasing it excessively in tiny
271
+ // amounts.
272
+ if (n > state.highWaterMark)
273
+ state.highWaterMark = roundUpToNextPowerOf2(n);
274
+
275
+ // don't have that much. return null, unless we've ended.
276
+ if (n > state.length) {
277
+ if (!state.ended) {
278
+ state.needReadable = true;
279
+ return 0;
280
+ } else
281
+ return state.length;
282
+ }
283
+
284
+ return n;
285
+ }
286
+
287
+ // you can override either this method, or the async _read(n) below.
288
+ Readable.prototype.read = function(n) {
289
+ debug('read', n);
290
+ var state = this._readableState;
291
+ var nOrig = n;
292
+
293
+ if (!util.isNumber(n) || n > 0)
294
+ state.emittedReadable = false;
295
+
296
+ // if we're doing read(0) to trigger a readable event, but we
297
+ // already have a bunch of data in the buffer, then just trigger
298
+ // the 'readable' event and move on.
299
+ if (n === 0 &&
300
+ state.needReadable &&
301
+ (state.length >= state.highWaterMark || state.ended)) {
302
+ debug('read: emitReadable', state.length, state.ended);
303
+ if (state.length === 0 && state.ended)
304
+ endReadable(this);
305
+ else
306
+ emitReadable(this);
307
+ return null;
308
+ }
309
+
310
+ n = howMuchToRead(n, state);
311
+
312
+ // if we've ended, and we're now clear, then finish it up.
313
+ if (n === 0 && state.ended) {
314
+ if (state.length === 0)
315
+ endReadable(this);
316
+ return null;
317
+ }
318
+
319
+ // All the actual chunk generation logic needs to be
320
+ // *below* the call to _read. The reason is that in certain
321
+ // synthetic stream cases, such as passthrough streams, _read
322
+ // may be a completely synchronous operation which may change
323
+ // the state of the read buffer, providing enough data when
324
+ // before there was *not* enough.
325
+ //
326
+ // So, the steps are:
327
+ // 1. Figure out what the state of things will be after we do
328
+ // a read from the buffer.
329
+ //
330
+ // 2. If that resulting state will trigger a _read, then call _read.
331
+ // Note that this may be asynchronous, or synchronous. Yes, it is
332
+ // deeply ugly to write APIs this way, but that still doesn't mean
333
+ // that the Readable class should behave improperly, as streams are
334
+ // designed to be sync/async agnostic.
335
+ // Take note if the _read call is sync or async (ie, if the read call
336
+ // has returned yet), so that we know whether or not it's safe to emit
337
+ // 'readable' etc.
338
+ //
339
+ // 3. Actually pull the requested chunks out of the buffer and return.
340
+
341
+ // if we need a readable event, then we need to do some reading.
342
+ var doRead = state.needReadable;
343
+ debug('need readable', doRead);
344
+
345
+ // if we currently have less than the highWaterMark, then also read some
346
+ if (state.length === 0 || state.length - n < state.highWaterMark) {
347
+ doRead = true;
348
+ debug('length less than watermark', doRead);
349
+ }
350
+
351
+ // however, if we've ended, then there's no point, and if we're already
352
+ // reading, then it's unnecessary.
353
+ if (state.ended || state.reading) {
354
+ doRead = false;
355
+ debug('reading or ended', doRead);
356
+ }
357
+
358
+ if (doRead) {
359
+ debug('do read');
360
+ state.reading = true;
361
+ state.sync = true;
362
+ // if the length is currently zero, then we *need* a readable event.
363
+ if (state.length === 0)
364
+ state.needReadable = true;
365
+ // call internal read method
366
+ this._read(state.highWaterMark);
367
+ state.sync = false;
368
+ }
369
+
370
+ // If _read pushed data synchronously, then `reading` will be false,
371
+ // and we need to re-evaluate how much data we can return to the user.
372
+ if (doRead && !state.reading)
373
+ n = howMuchToRead(nOrig, state);
374
+
375
+ var ret;
376
+ if (n > 0)
377
+ ret = fromList(n, state);
378
+ else
379
+ ret = null;
380
+
381
+ if (util.isNull(ret)) {
382
+ state.needReadable = true;
383
+ n = 0;
384
+ }
385
+
386
+ state.length -= n;
387
+
388
+ // If we have nothing in the buffer, then we want to know
389
+ // as soon as we *do* get something into the buffer.
390
+ if (state.length === 0 && !state.ended)
391
+ state.needReadable = true;
392
+
393
+ // If we tried to read() past the EOF, then emit end on the next tick.
394
+ if (nOrig !== n && state.ended && state.length === 0)
395
+ endReadable(this);
396
+
397
+ if (!util.isNull(ret))
398
+ this.emit('data', ret);
399
+
400
+ return ret;
401
+ };
402
+
403
+ function chunkInvalid(state, chunk) {
404
+ var er = null;
405
+ if (!util.isBuffer(chunk) &&
406
+ !util.isString(chunk) &&
407
+ !util.isNullOrUndefined(chunk) &&
408
+ !state.objectMode) {
409
+ er = new TypeError('Invalid non-string/buffer chunk');
410
+ }
411
+ return er;
412
+ }
413
+
414
+
415
+ function onEofChunk(stream, state) {
416
+ if (state.decoder && !state.ended) {
417
+ var chunk = state.decoder.end();
418
+ if (chunk && chunk.length) {
419
+ state.buffer.push(chunk);
420
+ state.length += state.objectMode ? 1 : chunk.length;
421
+ }
422
+ }
423
+ state.ended = true;
424
+
425
+ // emit 'readable' now to make sure it gets picked up.
426
+ emitReadable(stream);
427
+ }
428
+
429
+ // Don't emit readable right away in sync mode, because this can trigger
430
+ // another read() call => stack overflow. This way, it might trigger
431
+ // a nextTick recursion warning, but that's not so bad.
432
+ function emitReadable(stream) {
433
+ var state = stream._readableState;
434
+ state.needReadable = false;
435
+ if (!state.emittedReadable) {
436
+ debug('emitReadable', state.flowing);
437
+ state.emittedReadable = true;
438
+ if (state.sync)
439
+ process.nextTick(function() {
440
+ emitReadable_(stream);
441
+ });
442
+ else
443
+ emitReadable_(stream);
444
+ }
445
+ }
446
+
447
+ function emitReadable_(stream) {
448
+ debug('emit readable');
449
+ stream.emit('readable');
450
+ flow(stream);
451
+ }
452
+
453
+
454
+ // at this point, the user has presumably seen the 'readable' event,
455
+ // and called read() to consume some data. that may have triggered
456
+ // in turn another _read(n) call, in which case reading = true if
457
+ // it's in progress.
458
+ // However, if we're not ended, or reading, and the length < hwm,
459
+ // then go ahead and try to read some more preemptively.
460
+ function maybeReadMore(stream, state) {
461
+ if (!state.readingMore) {
462
+ state.readingMore = true;
463
+ process.nextTick(function() {
464
+ maybeReadMore_(stream, state);
465
+ });
466
+ }
467
+ }
468
+
469
+ function maybeReadMore_(stream, state) {
470
+ var len = state.length;
471
+ while (!state.reading && !state.flowing && !state.ended &&
472
+ state.length < state.highWaterMark) {
473
+ debug('maybeReadMore read 0');
474
+ stream.read(0);
475
+ if (len === state.length)
476
+ // didn't get any data, stop spinning.
477
+ break;
478
+ else
479
+ len = state.length;
480
+ }
481
+ state.readingMore = false;
482
+ }
483
+
484
+ // abstract method. to be overridden in specific implementation classes.
485
+ // call cb(er, data) where data is <= n in length.
486
+ // for virtual (non-string, non-buffer) streams, "length" is somewhat
487
+ // arbitrary, and perhaps not very meaningful.
488
+ Readable.prototype._read = function(n) {
489
+ this.emit('error', new Error('not implemented'));
490
+ };
491
+
492
+ Readable.prototype.pipe = function(dest, pipeOpts) {
493
+ var src = this;
494
+ var state = this._readableState;
495
+
496
+ switch (state.pipesCount) {
497
+ case 0:
498
+ state.pipes = dest;
499
+ break;
500
+ case 1:
501
+ state.pipes = [state.pipes, dest];
502
+ break;
503
+ default:
504
+ state.pipes.push(dest);
505
+ break;
506
+ }
507
+ state.pipesCount += 1;
508
+ debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
509
+
510
+ var doEnd = (!pipeOpts || pipeOpts.end !== false) &&
511
+ dest !== process.stdout &&
512
+ dest !== process.stderr;
513
+
514
+ var endFn = doEnd ? onend : cleanup;
515
+ if (state.endEmitted)
516
+ process.nextTick(endFn);
517
+ else
518
+ src.once('end', endFn);
519
+
520
+ dest.on('unpipe', onunpipe);
521
+ function onunpipe(readable) {
522
+ debug('onunpipe');
523
+ if (readable === src) {
524
+ cleanup();
525
+ }
526
+ }
527
+
528
+ function onend() {
529
+ debug('onend');
530
+ dest.end();
531
+ }
532
+
533
+ // when the dest drains, it reduces the awaitDrain counter
534
+ // on the source. This would be more elegant with a .once()
535
+ // handler in flow(), but adding and removing repeatedly is
536
+ // too slow.
537
+ var ondrain = pipeOnDrain(src);
538
+ dest.on('drain', ondrain);
539
+
540
+ function cleanup() {
541
+ debug('cleanup');
542
+ // cleanup event handlers once the pipe is broken
543
+ dest.removeListener('close', onclose);
544
+ dest.removeListener('finish', onfinish);
545
+ dest.removeListener('drain', ondrain);
546
+ dest.removeListener('error', onerror);
547
+ dest.removeListener('unpipe', onunpipe);
548
+ src.removeListener('end', onend);
549
+ src.removeListener('end', cleanup);
550
+ src.removeListener('data', ondata);
551
+
552
+ // if the reader is waiting for a drain event from this
553
+ // specific writer, then it would cause it to never start
554
+ // flowing again.
555
+ // So, if this is awaiting a drain, then we just call it now.
556
+ // If we don't know, then assume that we are waiting for one.
557
+ if (state.awaitDrain &&
558
+ (!dest._writableState || dest._writableState.needDrain))
559
+ ondrain();
560
+ }
561
+
562
+ src.on('data', ondata);
563
+ function ondata(chunk) {
564
+ debug('ondata');
565
+ var ret = dest.write(chunk);
566
+ if (false === ret) {
567
+ debug('false write response, pause',
568
+ src._readableState.awaitDrain);
569
+ src._readableState.awaitDrain++;
570
+ src.pause();
571
+ }
572
+ }
573
+
574
+ // if the dest has an error, then stop piping into it.
575
+ // however, don't suppress the throwing behavior for this.
576
+ function onerror(er) {
577
+ debug('onerror', er);
578
+ unpipe();
579
+ dest.removeListener('error', onerror);
580
+ if (EE.listenerCount(dest, 'error') === 0)
581
+ dest.emit('error', er);
582
+ }
583
+ // This is a brutally ugly hack to make sure that our error handler
584
+ // is attached before any userland ones. NEVER DO THIS.
585
+ if (!dest._events || !dest._events.error)
586
+ dest.on('error', onerror);
587
+ else if (isArray(dest._events.error))
588
+ dest._events.error.unshift(onerror);
589
+ else
590
+ dest._events.error = [onerror, dest._events.error];
591
+
592
+
593
+
594
+ // Both close and finish should trigger unpipe, but only once.
595
+ function onclose() {
596
+ dest.removeListener('finish', onfinish);
597
+ unpipe();
598
+ }
599
+ dest.once('close', onclose);
600
+ function onfinish() {
601
+ debug('onfinish');
602
+ dest.removeListener('close', onclose);
603
+ unpipe();
604
+ }
605
+ dest.once('finish', onfinish);
606
+
607
+ function unpipe() {
608
+ debug('unpipe');
609
+ src.unpipe(dest);
610
+ }
611
+
612
+ // tell the dest that it's being piped to
613
+ dest.emit('pipe', src);
614
+
615
+ // start the flow if it hasn't been started already.
616
+ if (!state.flowing) {
617
+ debug('pipe resume');
618
+ src.resume();
619
+ }
620
+
621
+ return dest;
622
+ };
623
+
624
+ function pipeOnDrain(src) {
625
+ return function() {
626
+ var state = src._readableState;
627
+ debug('pipeOnDrain', state.awaitDrain);
628
+ if (state.awaitDrain)
629
+ state.awaitDrain--;
630
+ if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {
631
+ state.flowing = true;
632
+ flow(src);
633
+ }
634
+ };
635
+ }
636
+
637
+
638
+ Readable.prototype.unpipe = function(dest) {
639
+ var state = this._readableState;
640
+
641
+ // if we're not piping anywhere, then do nothing.
642
+ if (state.pipesCount === 0)
643
+ return this;
644
+
645
+ // just one destination. most common case.
646
+ if (state.pipesCount === 1) {
647
+ // passed in one, but it's not the right one.
648
+ if (dest && dest !== state.pipes)
649
+ return this;
650
+
651
+ if (!dest)
652
+ dest = state.pipes;
653
+
654
+ // got a match.
655
+ state.pipes = null;
656
+ state.pipesCount = 0;
657
+ state.flowing = false;
658
+ if (dest)
659
+ dest.emit('unpipe', this);
660
+ return this;
661
+ }
662
+
663
+ // slow case. multiple pipe destinations.
664
+
665
+ if (!dest) {
666
+ // remove all.
667
+ var dests = state.pipes;
668
+ var len = state.pipesCount;
669
+ state.pipes = null;
670
+ state.pipesCount = 0;
671
+ state.flowing = false;
672
+
673
+ for (var i = 0; i < len; i++)
674
+ dests[i].emit('unpipe', this);
675
+ return this;
676
+ }
677
+
678
+ // try to find the right one.
679
+ var i = indexOf(state.pipes, dest);
680
+ if (i === -1)
681
+ return this;
682
+
683
+ state.pipes.splice(i, 1);
684
+ state.pipesCount -= 1;
685
+ if (state.pipesCount === 1)
686
+ state.pipes = state.pipes[0];
687
+
688
+ dest.emit('unpipe', this);
689
+
690
+ return this;
691
+ };
692
+
693
+ // set up data events if they are asked for
694
+ // Ensure readable listeners eventually get something
695
+ Readable.prototype.on = function(ev, fn) {
696
+ var res = Stream.prototype.on.call(this, ev, fn);
697
+
698
+ // If listening to data, and it has not explicitly been paused,
699
+ // then call resume to start the flow of data on the next tick.
700
+ if (ev === 'data' && false !== this._readableState.flowing) {
701
+ this.resume();
702
+ }
703
+
704
+ if (ev === 'readable' && this.readable) {
705
+ var state = this._readableState;
706
+ if (!state.readableListening) {
707
+ state.readableListening = true;
708
+ state.emittedReadable = false;
709
+ state.needReadable = true;
710
+ if (!state.reading) {
711
+ var self = this;
712
+ process.nextTick(function() {
713
+ debug('readable nexttick read 0');
714
+ self.read(0);
715
+ });
716
+ } else if (state.length) {
717
+ emitReadable(this, state);
718
+ }
719
+ }
720
+ }
721
+
722
+ return res;
723
+ };
724
+ Readable.prototype.addListener = Readable.prototype.on;
725
+
726
+ // pause() and resume() are remnants of the legacy readable stream API
727
+ // If the user uses them, then switch into old mode.
728
+ Readable.prototype.resume = function() {
729
+ var state = this._readableState;
730
+ if (!state.flowing) {
731
+ debug('resume');
732
+ state.flowing = true;
733
+ if (!state.reading) {
734
+ debug('resume read 0');
735
+ this.read(0);
736
+ }
737
+ resume(this, state);
738
+ }
739
+ return this;
740
+ };
741
+
742
+ function resume(stream, state) {
743
+ if (!state.resumeScheduled) {
744
+ state.resumeScheduled = true;
745
+ process.nextTick(function() {
746
+ resume_(stream, state);
747
+ });
748
+ }
749
+ }
750
+
751
+ function resume_(stream, state) {
752
+ state.resumeScheduled = false;
753
+ stream.emit('resume');
754
+ flow(stream);
755
+ if (state.flowing && !state.reading)
756
+ stream.read(0);
757
+ }
758
+
759
+ Readable.prototype.pause = function() {
760
+ debug('call pause flowing=%j', this._readableState.flowing);
761
+ if (false !== this._readableState.flowing) {
762
+ debug('pause');
763
+ this._readableState.flowing = false;
764
+ this.emit('pause');
765
+ }
766
+ return this;
767
+ };
768
+
769
+ function flow(stream) {
770
+ var state = stream._readableState;
771
+ debug('flow', state.flowing);
772
+ if (state.flowing) {
773
+ do {
774
+ var chunk = stream.read();
775
+ } while (null !== chunk && state.flowing);
776
+ }
777
+ }
778
+
779
+ // wrap an old-style stream as the async data source.
780
+ // This is *not* part of the readable stream interface.
781
+ // It is an ugly unfortunate mess of history.
782
+ Readable.prototype.wrap = function(stream) {
783
+ var state = this._readableState;
784
+ var paused = false;
785
+
786
+ var self = this;
787
+ stream.on('end', function() {
788
+ debug('wrapped end');
789
+ if (state.decoder && !state.ended) {
790
+ var chunk = state.decoder.end();
791
+ if (chunk && chunk.length)
792
+ self.push(chunk);
793
+ }
794
+
795
+ self.push(null);
796
+ });
797
+
798
+ stream.on('data', function(chunk) {
799
+ debug('wrapped data');
800
+ if (state.decoder)
801
+ chunk = state.decoder.write(chunk);
802
+ if (!chunk || !state.objectMode && !chunk.length)
803
+ return;
804
+
805
+ var ret = self.push(chunk);
806
+ if (!ret) {
807
+ paused = true;
808
+ stream.pause();
809
+ }
810
+ });
811
+
812
+ // proxy all the other methods.
813
+ // important when wrapping filters and duplexes.
814
+ for (var i in stream) {
815
+ if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {
816
+ this[i] = function(method) { return function() {
817
+ return stream[method].apply(stream, arguments);
818
+ }}(i);
819
+ }
820
+ }
821
+
822
+ // proxy certain important events.
823
+ var events = ['error', 'close', 'destroy', 'pause', 'resume'];
824
+ forEach(events, function(ev) {
825
+ stream.on(ev, self.emit.bind(self, ev));
826
+ });
827
+
828
+ // when we try to consume some more bytes, simply unpause the
829
+ // underlying stream.
830
+ self._read = function(n) {
831
+ debug('wrapped _read', n);
832
+ if (paused) {
833
+ paused = false;
834
+ stream.resume();
835
+ }
836
+ };
837
+
838
+ return self;
839
+ };
840
+
841
+
842
+
843
+ // exposed for testing purposes only.
844
+ Readable._fromList = fromList;
845
+
846
+ // Pluck off n bytes from an array of buffers.
847
+ // Length is the combined lengths of all the buffers in the list.
848
+ function fromList(n, state) {
849
+ var list = state.buffer;
850
+ var length = state.length;
851
+ var stringMode = !!state.decoder;
852
+ var objectMode = !!state.objectMode;
853
+ var ret;
854
+
855
+ // nothing in the list, definitely empty.
856
+ if (list.length === 0)
857
+ return null;
858
+
859
+ if (length === 0)
860
+ ret = null;
861
+ else if (objectMode)
862
+ ret = list.shift();
863
+ else if (!n || n >= length) {
864
+ // read it all, truncate the array.
865
+ if (stringMode)
866
+ ret = list.join('');
867
+ else
868
+ ret = Buffer.concat(list, length);
869
+ list.length = 0;
870
+ } else {
871
+ // read just some of it.
872
+ if (n < list[0].length) {
873
+ // just take a part of the first list item.
874
+ // slice is the same for buffers and strings.
875
+ var buf = list[0];
876
+ ret = buf.slice(0, n);
877
+ list[0] = buf.slice(n);
878
+ } else if (n === list[0].length) {
879
+ // first list is a perfect match
880
+ ret = list.shift();
881
+ } else {
882
+ // complex case.
883
+ // we have enough to cover it, but it spans past the first buffer.
884
+ if (stringMode)
885
+ ret = '';
886
+ else
887
+ ret = new Buffer(n);
888
+
889
+ var c = 0;
890
+ for (var i = 0, l = list.length; i < l && c < n; i++) {
891
+ var buf = list[0];
892
+ var cpy = Math.min(n - c, buf.length);
893
+
894
+ if (stringMode)
895
+ ret += buf.slice(0, cpy);
896
+ else
897
+ buf.copy(ret, c, 0, cpy);
898
+
899
+ if (cpy < buf.length)
900
+ list[0] = buf.slice(cpy);
901
+ else
902
+ list.shift();
903
+
904
+ c += cpy;
905
+ }
906
+ }
907
+ }
908
+
909
+ return ret;
910
+ }
911
+
912
+ function endReadable(stream) {
913
+ var state = stream._readableState;
914
+
915
+ // If we get here before consuming all the bytes, then that is a
916
+ // bug in node. Should never happen.
917
+ if (state.length > 0)
918
+ throw new Error('endReadable called on non-empty stream');
919
+
920
+ if (!state.endEmitted) {
921
+ state.ended = true;
922
+ process.nextTick(function() {
923
+ // Check that we didn't get one last unshift.
924
+ if (!state.endEmitted && state.length === 0) {
925
+ state.endEmitted = true;
926
+ stream.readable = false;
927
+ stream.emit('end');
928
+ }
929
+ });
930
+ }
931
+ }
932
+
933
+ function forEach (xs, f) {
934
+ for (var i = 0, l = xs.length; i < l; i++) {
935
+ f(xs[i], i);
936
+ }
937
+ }
938
+
939
+ function indexOf (xs, x) {
940
+ for (var i = 0, l = xs.length; i < l; i++) {
941
+ if (xs[i] === x) return i;
942
+ }
943
+ return -1;
944
+ }