opal 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -1
  3. data/lib/opal/cli.rb +9 -1
  4. data/lib/opal/cli_options.rb +12 -3
  5. data/lib/opal/cli_runners/nodejs.rb +3 -2
  6. data/lib/opal/version.rb +1 -1
  7. data/opal/corelib/kernel.rb +7 -0
  8. data/opal/corelib/runtime.js +4 -0
  9. data/spec/lib/cli_spec.rb +16 -0
  10. data/stdlib/nodejs.rb +1 -2
  11. data/stdlib/nodejs/{process.rb → kernel.rb} +7 -4
  12. data/stdlib/nodejs/node_modules/.bin/js-yaml +140 -0
  13. data/stdlib/nodejs/node_modules/glob/LICENSE +15 -0
  14. data/stdlib/nodejs/node_modules/glob/README.md +357 -0
  15. data/stdlib/nodejs/node_modules/glob/common.js +177 -0
  16. data/stdlib/nodejs/node_modules/glob/glob.js +649 -0
  17. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
  18. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/LICENSE +15 -0
  19. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/README.md +37 -0
  20. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/inflight.js +44 -0
  21. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
  22. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
  23. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +52 -0
  24. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
  25. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
  26. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/package.json +61 -0
  27. data/stdlib/nodejs/node_modules/glob/node_modules/inflight/test.js +97 -0
  28. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  29. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/README.md +42 -0
  30. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  31. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  32. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/package.json +51 -0
  33. data/stdlib/nodejs/node_modules/glob/node_modules/inherits/test.js +25 -0
  34. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
  35. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
  36. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
  37. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/README.md +216 -0
  38. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
  39. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
  40. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
  41. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
  42. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
  43. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
  44. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
  45. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
  46. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
  47. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +4 -0
  48. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
  49. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
  50. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
  51. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
  52. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
  53. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
  54. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +4 -0
  55. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
  56. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
  57. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
  58. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
  59. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
  60. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
  61. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
  62. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
  63. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
  64. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
  65. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
  66. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
  67. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
  68. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
  69. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
  70. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
  71. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
  72. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
  73. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
  74. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/package.json +60 -0
  75. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
  76. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
  77. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
  78. data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  79. data/stdlib/nodejs/node_modules/glob/node_modules/once/LICENSE +27 -0
  80. data/stdlib/nodejs/node_modules/glob/node_modules/once/README.md +51 -0
  81. data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
  82. data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
  83. data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +52 -0
  84. data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
  85. data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
  86. data/stdlib/nodejs/node_modules/glob/node_modules/once/once.js +21 -0
  87. data/stdlib/nodejs/node_modules/glob/node_modules/once/package.json +60 -0
  88. data/stdlib/nodejs/node_modules/glob/node_modules/once/test/once.js +23 -0
  89. data/stdlib/nodejs/node_modules/glob/package.json +72 -0
  90. data/stdlib/nodejs/node_modules/glob/sync.js +409 -0
  91. data/stdlib/nodejs/node_modules/js-yaml/HISTORY.md +277 -0
  92. data/stdlib/nodejs/node_modules/js-yaml/LICENSE +21 -0
  93. data/stdlib/nodejs/node_modules/js-yaml/README.md +288 -0
  94. data/stdlib/nodejs/node_modules/js-yaml/bin/js-yaml.js +140 -0
  95. data/stdlib/nodejs/node_modules/js-yaml/bower.json +23 -0
  96. data/stdlib/nodejs/node_modules/js-yaml/dist/js-yaml.js +3666 -0
  97. data/stdlib/nodejs/node_modules/js-yaml/dist/js-yaml.min.js +3 -0
  98. data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.js +102 -0
  99. data/stdlib/nodejs/node_modules/js-yaml/examples/custom_types.yml +18 -0
  100. data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.js +31 -0
  101. data/stdlib/nodejs/node_modules/js-yaml/examples/dumper.json +22 -0
  102. data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.js +18 -0
  103. data/stdlib/nodejs/node_modules/js-yaml/examples/sample_document.yml +197 -0
  104. data/stdlib/nodejs/node_modules/js-yaml/index.js +7 -0
  105. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml.js +39 -0
  106. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/common.js +62 -0
  107. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/dumper.js +554 -0
  108. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/exception.js +25 -0
  109. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/loader.js +1581 -0
  110. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/mark.js +78 -0
  111. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema.js +103 -0
  112. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  113. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  114. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  115. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  116. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  117. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  118. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/binary.js +133 -0
  119. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/bool.js +37 -0
  120. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/float.js +110 -0
  121. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/int.js +183 -0
  122. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/function.js +85 -0
  123. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +84 -0
  124. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +27 -0
  125. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  126. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  127. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/null.js +36 -0
  128. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/omap.js +56 -0
  129. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/pairs.js +61 -0
  130. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  131. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/set.js +33 -0
  132. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  133. data/stdlib/nodejs/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +98 -0
  134. data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esparse +117 -0
  135. data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esvalidate +177 -0
  136. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/HISTORY.md +115 -0
  137. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/LICENSE +21 -0
  138. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/README.md +239 -0
  139. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +36 -0
  140. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/choice.js +22 -0
  141. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/constants.js +59 -0
  142. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/help.js +13 -0
  143. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +33 -0
  144. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/parents.js +28 -0
  145. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +23 -0
  146. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +49 -0
  147. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/sum.js +35 -0
  148. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +270 -0
  149. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/index.js +1 -0
  150. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action.js +146 -0
  151. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +55 -0
  152. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +47 -0
  153. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +40 -0
  154. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +48 -0
  155. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +50 -0
  156. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +43 -0
  157. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +27 -0
  158. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +26 -0
  159. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +148 -0
  160. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +50 -0
  161. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +481 -0
  162. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +14 -0
  163. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +50 -0
  164. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +54 -0
  165. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +75 -0
  166. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +1168 -0
  167. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/const.js +18 -0
  168. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +88 -0
  169. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +798 -0
  170. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +77 -0
  171. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.npmignore +2 -0
  172. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/.travis.yml +8 -0
  173. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +825 -0
  174. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/bower.json +33 -0
  175. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +11 -0
  176. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/foo.js +10 -0
  177. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/gulpfile.js +26 -0
  178. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +673 -0
  179. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log +0 -0
  180. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +107 -0
  181. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +23 -0
  182. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +22 -0
  183. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +69 -0
  184. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +6 -0
  185. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +1415 -0
  186. data/stdlib/nodejs/node_modules/js-yaml/node_modules/argparse/package.json +62 -0
  187. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/README.md +73 -0
  188. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +117 -0
  189. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +177 -0
  190. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/esprima.js +3908 -0
  191. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/package.json +69 -0
  192. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/compat.js +239 -0
  193. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/reflect.js +422 -0
  194. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/run.js +66 -0
  195. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/runner.js +387 -0
  196. data/stdlib/nodejs/node_modules/js-yaml/node_modules/esprima/test/test.js +20238 -0
  197. data/stdlib/nodejs/node_modules/js-yaml/package.json +83 -0
  198. data/{package.json → stdlib/nodejs/package.json} +0 -3
  199. data/stdlib/phantomjs.rb +1 -6
  200. data/tasks/testing.rake +1 -4
  201. metadata +191 -6
  202. data/stdlib/nodejs/runtime.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a9bf851ab7303452422a1822f7a2f312f4b2797
4
- data.tar.gz: 01582cdf5ce1c13f075e52f6fb2905b761817e28
3
+ metadata.gz: 0494f5ca3ec281015d5da6f2ebbc77efb60be8c1
4
+ data.tar.gz: 852eea5baed0f69c1e5ae1f927ffa732f088c849
5
5
  SHA512:
6
- metadata.gz: b41fd0b62ece98c9a117dd185ccc20708c751de45878c4fc4498f8125c76ec6f61227577ea4be1a472ae54e0658b4e23f45bccd4faf3c2a939c34135b9ecc7ca
7
- data.tar.gz: 1d021c3b6eea6eacc2ac7e9081fe079a5bcf454fbba2ada078b1e42b14675503c01065524ae84eaa948f7e7f0a78c2547e920e297f1197747313cdc07a41c44a
6
+ metadata.gz: 1476886b7df5b2044e99300f34430b497de8f4792d3a2d5db801ab6a64fc0c85c82e5145d7364d2ac29d4ce774e7d083ad1c333a03c21c7815b158373a0a2fb2
7
+ data.tar.gz: 4475446f440e51146edd1acac3c2767b81ab00f9480b77bab9c7596877910a085e4201d52068aefc8f72279be9fdf7c2a68f73ab7f1fb8b28ca82dfdf8017c89
@@ -1,4 +1,14 @@
1
- ## edge (upcoming 0.7)
1
+ ## edge (upcoming 0.7.1)
2
+
3
+ * CLI options `-d` and `-v` now set respectively `$DEBUG` and `$VERBOSE`
4
+
5
+ * Fixed a bug that would make the `-v` CLI option wait for STDIN input
6
+
7
+ * Add the `-E` / `--no-exit` CLI option to skip implicit `Kernel#exit` call
8
+
9
+ * Now the CLI implicitly calls `Kernel#exit` at the end of the script, thus making `at_exit` blocks be respected.
10
+
11
+ ## 0.7.0 2015-02-01
2
12
 
3
13
  * Stop keyword-arg variable names leaking to global javascript scope
4
14
 
@@ -7,7 +7,7 @@ module Opal
7
7
  class CLI
8
8
  attr_reader :options, :file, :compiler_options, :evals, :load_paths, :argv,
9
9
  :output, :requires, :gems, :stubs, :verbose, :port, :preload,
10
- :filename
10
+ :filename, :debug, :no_exit
11
11
 
12
12
  def compile?
13
13
  @compile
@@ -36,6 +36,7 @@ module Opal
36
36
  @compile = !!options.delete(:compile)
37
37
  @sexp = options.delete(:sexp)
38
38
  @file = options.delete(:file)
39
+ @no_exit = options.delete(:no_exit)
39
40
  @argv = options.delete(:argv) || []
40
41
  @evals = options.delete(:evals) || []
41
42
  @requires = options.delete(:requires) || []
@@ -45,6 +46,7 @@ module Opal
45
46
  @preload = options.delete(:preload) || []
46
47
  @output = options.delete(:output) || self.class.stdout || $stdout
47
48
  @verbose = options.fetch(:verbose, false); options.delete(:verbose)
49
+ @debug = options.fetch(:debug, false); options.delete(:debug)
48
50
  @filename = options.fetch(:filename) { @file && @file.path }; options.delete(:filename)
49
51
  @skip_opal_require = options.delete(:skip_opal_require)
50
52
  @compiler_options = Hash[
@@ -95,6 +97,10 @@ module Opal
95
97
 
96
98
  preload.each { |path| builder.build_require(path) }
97
99
 
100
+ # FLAGS
101
+ builder.build_str '$VERBOSE = true', '(flags)' if verbose
102
+ builder.build_str '$DEBUG = true', '(flags)' if debug
103
+
98
104
  # REQUIRES: -r
99
105
  requires.each do |local_require|
100
106
  builder.build(local_require)
@@ -108,6 +114,8 @@ module Opal
108
114
  end
109
115
  end
110
116
 
117
+ builder.build_str 'Kernel.exit', '(exit)' unless no_exit
118
+
111
119
  builder.to_s
112
120
  end
113
121
 
@@ -12,11 +12,16 @@ module Opal
12
12
 
13
13
  on('-v', '--verbose', 'print version number, then turn on verbose mode') do
14
14
  print_version
15
- options[:verbose] = true # TODO: print some warnings when verbose = true
15
+ exit if ARGV.empty?
16
+ options[:verbose] = true
16
17
  end
17
18
 
18
- on('--verbose', 'turn on verbose mode') do
19
- options[:verbose] = true # TODO: print some warnings when verbose = true
19
+ on('--verbose', 'turn on verbose mode (set $VERBOSE to true)') do
20
+ options[:verbose] = true
21
+ end
22
+
23
+ on('-d', '--debug', 'turn on debug mode (set $DEBUG to true)') do
24
+ options[:debug] = true
20
25
  end
21
26
 
22
27
  on('--version', 'Print the version') do
@@ -88,6 +93,10 @@ module Opal
88
93
  options[:port] = port.to_i
89
94
  end
90
95
 
96
+ on('--no-exit', 'Do not append a Kernel#exit at the end of file') do |no_exit|
97
+ options[:no_exit] = true
98
+ end
99
+
91
100
 
92
101
  section 'Compilation Options:'
93
102
 
@@ -1,4 +1,5 @@
1
1
  require 'opal/cli_runners'
2
+ require 'opal/paths'
2
3
 
3
4
  module Opal
4
5
  module CliRunners
@@ -13,7 +14,7 @@ module Opal
13
14
  end
14
15
 
15
16
  def node_modules
16
- File.expand_path("../../../../node_modules", __FILE__)
17
+ File.expand_path('../stdlib/nodejs/node_modules', ::Opal.gem_dir)
17
18
  end
18
19
 
19
20
  def run(code, argv)
@@ -29,7 +30,7 @@ module Opal
29
30
 
30
31
  # Let's support fake IO objects like StringIO
31
32
  def system_with_output(env, *cmd)
32
- if (io_output = IO.try_convert(output))
33
+ if IO.try_convert(output)
33
34
  system(env,*cmd)
34
35
  @exit_status = $?.exitstatus
35
36
  return
@@ -1,3 +1,3 @@
1
1
  module Opal
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -149,6 +149,13 @@ module Kernel
149
149
  `self === other`
150
150
  end
151
151
 
152
+ def exit(status = true)
153
+ $__at_exit__.reverse.each(&:call) if $__at_exit__
154
+ status = 0 if `status === true` # it's in JS because it can be null/undef
155
+ `Opal.exit(status);`
156
+ nil
157
+ end
158
+
152
159
  def extend(*mods)
153
160
  %x{
154
161
  var singleton = #{singleton_class};
@@ -43,6 +43,10 @@
43
43
  // Globals table
44
44
  Opal.gvars = {};
45
45
 
46
+ // Exit function, this should be replaced by platform specific implementation
47
+ // (See nodejs and phantom for examples)
48
+ Opal.exit = function(status) { if (Opal.gvars.DEBUG) console.log('Exited with status '+status); };
49
+
46
50
  /**
47
51
  Get a constant on the given scope. Every class and module in Opal has a
48
52
  scope used to store, and inherit, constants. For example, the top level
@@ -40,6 +40,22 @@ describe Opal::CLI do
40
40
  end
41
41
  end
42
42
 
43
+ describe ':no_exit option' do
44
+ context 'when false' do
45
+ let(:options) { {no_exit: false, compile: true, evals: ['']} }
46
+ it 'appends a Kernel#exit at the end of the source' do
47
+ expect_output_of{ subject.run }.to include(".$exit()")
48
+ end
49
+ end
50
+
51
+ context 'when true' do
52
+ let(:options) { {no_exit: true, compile: true, evals: ['']} }
53
+ it 'appends a Kernel#exit at the end of the source' do
54
+ expect_output_of{ subject.run }.not_to include(".$exit();")
55
+ end
56
+ end
57
+ end
58
+
43
59
  describe ':requires options' do
44
60
  context 'with an absolute path' do
45
61
  let(:options) { {:requires => [file], :evals => ['']} }
@@ -1,8 +1,7 @@
1
1
  module NodeJS
2
2
  end
3
3
 
4
- require 'nodejs/runtime'
4
+ require 'nodejs/kernel'
5
5
  require 'nodejs/file'
6
6
  require 'nodejs/dir'
7
7
  require 'nodejs/io'
8
- require 'nodejs/process'
@@ -1,8 +1,7 @@
1
+ `Opal.exit = process.exit`
2
+
1
3
  module Kernel
2
- def exit(status = true)
3
- $__at_exit__.reverse.each(&:call) if $__at_exit__
4
- `process.exit(status === true ? 0 : status)`
5
- end
4
+ NODE_REQUIRE = `require`
6
5
 
7
6
  def caller
8
7
  %x{
@@ -16,6 +15,10 @@ module Kernel
16
15
  return stack.$split("\n").slice(3);
17
16
  }
18
17
  end
18
+
19
+ def node_require(path)
20
+ `#{NODE_REQUIRE}(#{path.to_str})`
21
+ end
19
22
  end
20
23
 
21
24
  ARGV = `process.argv.slice(2)`
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env node
2
+
3
+
4
+ 'use strict';
5
+
6
+
7
+ // stdlib
8
+ var fs = require('fs');
9
+
10
+
11
+ // 3rd-party
12
+ var argparse = require('argparse');
13
+
14
+
15
+ // internal
16
+ var yaml = require('..');
17
+
18
+
19
+ ////////////////////////////////////////////////////////////////////////////////
20
+
21
+
22
+ var cli = new argparse.ArgumentParser({
23
+ prog: 'js-yaml',
24
+ version: require('../package.json').version,
25
+ addHelp: true
26
+ });
27
+
28
+
29
+ cli.addArgument(['-c', '--compact'], {
30
+ help: 'Display errors in compact mode',
31
+ action: 'storeTrue'
32
+ });
33
+
34
+
35
+ // deprecated (not needed after we removed output colors)
36
+ // option suppressed, but not completely removed for compatibility
37
+ cli.addArgument(['-j', '--to-json'], {
38
+ help: argparse.Const.SUPPRESS,
39
+ dest: 'json',
40
+ action: 'storeTrue'
41
+ });
42
+
43
+
44
+ cli.addArgument(['-t', '--trace'], {
45
+ help: 'Show stack trace on error',
46
+ action: 'storeTrue'
47
+ });
48
+
49
+ cli.addArgument(['file'], {
50
+ help: 'File to read, utf-8 encoded without BOM',
51
+ nargs: '?',
52
+ defaultValue: '-'
53
+ });
54
+
55
+
56
+ ////////////////////////////////////////////////////////////////////////////////
57
+
58
+
59
+ var options = cli.parseArgs();
60
+
61
+
62
+ ////////////////////////////////////////////////////////////////////////////////
63
+
64
+ function readFile(filename, encoding, callback) {
65
+ if (options.file === '-') {
66
+ // read from stdin
67
+
68
+ var chunks = [];
69
+
70
+ process.stdin.on('data', function(chunk) {
71
+ chunks.push(chunk);
72
+ });
73
+
74
+ process.stdin.on('end', function() {
75
+ return callback(null, Buffer.concat(chunks).toString(encoding));
76
+ });
77
+ } else {
78
+ fs.readFile(filename, encoding, callback);
79
+ }
80
+ }
81
+
82
+ readFile(options.file, 'utf8', function (error, input) {
83
+ var output, isYaml;
84
+
85
+ if (error) {
86
+ if ('ENOENT' === error.code) {
87
+ console.error('File not found: ' + options.file);
88
+ process.exit(2);
89
+ }
90
+
91
+ console.error(
92
+ options.trace && error.stack ||
93
+ error.message ||
94
+ String(error));
95
+
96
+ process.exit(1);
97
+ }
98
+
99
+ try {
100
+ output = JSON.parse(input);
101
+ isYaml = false;
102
+ } catch (error) {
103
+ if (error instanceof SyntaxError) {
104
+ try {
105
+ output = [];
106
+ yaml.loadAll(input, function (doc) { output.push(doc); }, {});
107
+ isYaml = true;
108
+
109
+ if (0 === output.length) {
110
+ output = null;
111
+ } else if (1 === output.length) {
112
+ output = output[0];
113
+ }
114
+ } catch (error) {
115
+ if (options.trace && error.stack) {
116
+ console.error(error.stack);
117
+ } else {
118
+ console.error(error.toString(options.compact));
119
+ }
120
+
121
+ process.exit(1);
122
+ }
123
+ } else {
124
+ console.error(
125
+ options.trace && error.stack ||
126
+ error.message ||
127
+ String(error));
128
+
129
+ process.exit(1);
130
+ }
131
+ }
132
+
133
+ if (isYaml) {
134
+ console.log(JSON.stringify(output, null, ' '));
135
+ } else {
136
+ console.log(yaml.dump(output));
137
+ }
138
+
139
+ process.exit(0);
140
+ });
@@ -0,0 +1,15 @@
1
+ The ISC License
2
+
3
+ Copyright (c) Isaac Z. Schlueter and Contributors
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
15
+ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,357 @@
1
+ [![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)
2
+
3
+ # Glob
4
+
5
+ Match files using the patterns the shell uses, like stars and stuff.
6
+
7
+ This is a glob implementation in JavaScript. It uses the `minimatch`
8
+ library to do its matching.
9
+
10
+ ![](oh-my-glob.gif)
11
+
12
+ ## Usage
13
+
14
+ ```javascript
15
+ var glob = require("glob")
16
+
17
+ // options is optional
18
+ glob("**/*.js", options, function (er, files) {
19
+ // files is an array of filenames.
20
+ // If the `nonull` option is set, and nothing
21
+ // was found, then files is ["**/*.js"]
22
+ // er is an error object or null.
23
+ })
24
+ ```
25
+
26
+ ## Glob Primer
27
+
28
+ "Globs" are the patterns you type when you do stuff like `ls *.js` on
29
+ the command line, or put `build/*` in a `.gitignore` file.
30
+
31
+ Before parsing the path part patterns, braced sections are expanded
32
+ into a set. Braced sections start with `{` and end with `}`, with any
33
+ number of comma-delimited sections within. Braced sections may contain
34
+ slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
35
+
36
+ The following characters have special magic meaning when used in a
37
+ path portion:
38
+
39
+ * `*` Matches 0 or more characters in a single path portion
40
+ * `?` Matches 1 character
41
+ * `[...]` Matches a range of characters, similar to a RegExp range.
42
+ If the first character of the range is `!` or `^` then it matches
43
+ any character not in the range.
44
+ * `!(pattern|pattern|pattern)` Matches anything that does not match
45
+ any of the patterns provided.
46
+ * `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
47
+ patterns provided.
48
+ * `+(pattern|pattern|pattern)` Matches one or more occurrences of the
49
+ patterns provided.
50
+ * `*(a|b|c)` Matches zero or more occurrences of the patterns provided
51
+ * `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
52
+ provided
53
+ * `**` If a "globstar" is alone in a path portion, then it matches
54
+ zero or more directories and subdirectories searching for matches.
55
+ It does not crawl symlinked directories.
56
+
57
+ ### Dots
58
+
59
+ If a file or directory path portion has a `.` as the first character,
60
+ then it will not match any glob pattern unless that pattern's
61
+ corresponding path part also has a `.` as its first character.
62
+
63
+ For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
64
+ However the pattern `a/*/c` would not, because `*` does not start with
65
+ a dot character.
66
+
67
+ You can make glob treat dots as normal characters by setting
68
+ `dot:true` in the options.
69
+
70
+ ### Basename Matching
71
+
72
+ If you set `matchBase:true` in the options, and the pattern has no
73
+ slashes in it, then it will seek for any file anywhere in the tree
74
+ with a matching basename. For example, `*.js` would match
75
+ `test/simple/basic.js`.
76
+
77
+ ### Negation
78
+
79
+ The intent for negation would be for a pattern starting with `!` to
80
+ match everything that *doesn't* match the supplied pattern. However,
81
+ the implementation is weird, and for the time being, this should be
82
+ avoided. The behavior will change or be deprecated in version 5.
83
+
84
+ ### Empty Sets
85
+
86
+ If no matching files are found, then an empty array is returned. This
87
+ differs from the shell, where the pattern itself is returned. For
88
+ example:
89
+
90
+ $ echo a*s*d*f
91
+ a*s*d*f
92
+
93
+ To get the bash-style behavior, set the `nonull:true` in the options.
94
+
95
+ ### See Also:
96
+
97
+ * `man sh`
98
+ * `man bash` (Search for "Pattern Matching")
99
+ * `man 3 fnmatch`
100
+ * `man 5 gitignore`
101
+ * [minimatch documentation](https://github.com/isaacs/minimatch)
102
+
103
+ ## glob.hasMagic(pattern, [options])
104
+
105
+ Returns `true` if there are any special characters in the pattern, and
106
+ `false` otherwise.
107
+
108
+ Note that the options affect the results. If `noext:true` is set in
109
+ the options object, then `+(a|b)` will not be considered a magic
110
+ pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`
111
+ then that is considered magical, unless `nobrace:true` is set in the
112
+ options.
113
+
114
+ ## glob(pattern, [options], cb)
115
+
116
+ * `pattern` {String} Pattern to be matched
117
+ * `options` {Object}
118
+ * `cb` {Function}
119
+ * `err` {Error | null}
120
+ * `matches` {Array<String>} filenames found matching the pattern
121
+
122
+ Perform an asynchronous glob search.
123
+
124
+ ## glob.sync(pattern, [options])
125
+
126
+ * `pattern` {String} Pattern to be matched
127
+ * `options` {Object}
128
+ * return: {Array<String>} filenames found matching the pattern
129
+
130
+ Perform a synchronous glob search.
131
+
132
+ ## Class: glob.Glob
133
+
134
+ Create a Glob object by instantiating the `glob.Glob` class.
135
+
136
+ ```javascript
137
+ var Glob = require("glob").Glob
138
+ var mg = new Glob(pattern, options, cb)
139
+ ```
140
+
141
+ It's an EventEmitter, and starts walking the filesystem to find matches
142
+ immediately.
143
+
144
+ ### new glob.Glob(pattern, [options], [cb])
145
+
146
+ * `pattern` {String} pattern to search for
147
+ * `options` {Object}
148
+ * `cb` {Function} Called when an error occurs, or matches are found
149
+ * `err` {Error | null}
150
+ * `matches` {Array<String>} filenames found matching the pattern
151
+
152
+ Note that if the `sync` flag is set in the options, then matches will
153
+ be immediately available on the `g.found` member.
154
+
155
+ ### Properties
156
+
157
+ * `minimatch` The minimatch object that the glob uses.
158
+ * `options` The options object passed in.
159
+ * `aborted` Boolean which is set to true when calling `abort()`. There
160
+ is no way at this time to continue a glob search after aborting, but
161
+ you can re-use the statCache to avoid having to duplicate syscalls.
162
+ * `statCache` Collection of all the stat results the glob search
163
+ performed.
164
+ * `cache` Convenience object. Each field has the following possible
165
+ values:
166
+ * `false` - Path does not exist
167
+ * `true` - Path exists
168
+ * `'DIR'` - Path exists, and is not a directory
169
+ * `'FILE'` - Path exists, and is a directory
170
+ * `[file, entries, ...]` - Path exists, is a directory, and the
171
+ array value is the results of `fs.readdir`
172
+ * `statCache` Cache of `fs.stat` results, to prevent statting the same
173
+ path multiple times.
174
+ * `symlinks` A record of which paths are symbolic links, which is
175
+ relevant in resolving `**` patterns.
176
+
177
+ ### Events
178
+
179
+ * `end` When the matching is finished, this is emitted with all the
180
+ matches found. If the `nonull` option is set, and no match was found,
181
+ then the `matches` list contains the original pattern. The matches
182
+ are sorted, unless the `nosort` flag is set.
183
+ * `match` Every time a match is found, this is emitted with the matched.
184
+ * `error` Emitted when an unexpected error is encountered, or whenever
185
+ any fs error occurs if `options.strict` is set.
186
+ * `abort` When `abort()` is called, this event is raised.
187
+
188
+ ### Methods
189
+
190
+ * `pause` Temporarily stop the search
191
+ * `resume` Resume the search
192
+ * `abort` Stop the search forever
193
+
194
+ ### Options
195
+
196
+ All the options that can be passed to Minimatch can also be passed to
197
+ Glob to change pattern matching behavior. Also, some have been added,
198
+ or have glob-specific ramifications.
199
+
200
+ All options are false by default, unless otherwise noted.
201
+
202
+ All options are added to the Glob object, as well.
203
+
204
+ If you are running many `glob` operations, you can pass a Glob object
205
+ as the `options` argument to a subsequent operation to shortcut some
206
+ `stat` and `readdir` calls. At the very least, you may pass in shared
207
+ `symlinks`, `statCache`, and `cache` options, so that parallel glob
208
+ operations will be sped up by sharing information about the
209
+ filesystem.
210
+
211
+ * `cwd` The current working directory in which to search. Defaults
212
+ to `process.cwd()`.
213
+ * `root` The place where patterns starting with `/` will be mounted
214
+ onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
215
+ systems, and `C:\` or some such on Windows.)
216
+ * `dot` Include `.dot` files in normal matches and `globstar` matches.
217
+ Note that an explicit dot in a portion of the pattern will always
218
+ match dot files.
219
+ * `nomount` By default, a pattern starting with a forward-slash will be
220
+ "mounted" onto the root setting, so that a valid filesystem path is
221
+ returned. Set this flag to disable that behavior.
222
+ * `mark` Add a `/` character to directory matches. Note that this
223
+ requires additional stat calls.
224
+ * `nosort` Don't sort the results.
225
+ * `stat` Set to true to stat *all* results. This reduces performance
226
+ somewhat, and is completely unnecessary, unless `readdir` is presumed
227
+ to be an untrustworthy indicator of file existence.
228
+ * `silent` When an unusual error is encountered when attempting to
229
+ read a directory, a warning will be printed to stderr. Set the
230
+ `silent` option to true to suppress these warnings.
231
+ * `strict` When an unusual error is encountered when attempting to
232
+ read a directory, the process will just continue on in search of
233
+ other matches. Set the `strict` option to raise an error in these
234
+ cases.
235
+ * `cache` See `cache` property above. Pass in a previously generated
236
+ cache object to save some fs calls.
237
+ * `statCache` A cache of results of filesystem information, to prevent
238
+ unnecessary stat calls. While it should not normally be necessary
239
+ to set this, you may pass the statCache from one glob() call to the
240
+ options object of another, if you know that the filesystem will not
241
+ change between calls. (See "Race Conditions" below.)
242
+ * `symlinks` A cache of known symbolic links. You may pass in a
243
+ previously generated `symlinks` object to save `lstat` calls when
244
+ resolving `**` matches.
245
+ * `sync` Perform a synchronous glob search.
246
+ * `nounique` In some cases, brace-expanded patterns can result in the
247
+ same file showing up multiple times in the result set. By default,
248
+ this implementation prevents duplicates in the result set. Set this
249
+ flag to disable that behavior.
250
+ * `nonull` Set to never return an empty set, instead returning a set
251
+ containing the pattern itself. This is the default in glob(3).
252
+ * `debug` Set to enable debug logging in minimatch and glob.
253
+ * `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
254
+ * `noglobstar` Do not match `**` against multiple filenames. (Ie,
255
+ treat it as a normal `*` instead.)
256
+ * `noext` Do not match `+(a|b)` "extglob" patterns.
257
+ * `nocase` Perform a case-insensitive match. Note: on
258
+ case-insensitive filesystems, non-magic patterns will match by
259
+ default, since `stat` and `readdir` will not raise errors.
260
+ * `matchBase` Perform a basename-only match if the pattern does not
261
+ contain any slash characters. That is, `*.js` would be treated as
262
+ equivalent to `**/*.js`, matching all js files in all directories.
263
+ * `nonegate` Suppress `negate` behavior. (See below.)
264
+ * `nocomment` Suppress `comment` behavior. (See below.)
265
+ * `nonull` Return the pattern when no matches are found.
266
+ * `nodir` Do not match directories, only files.
267
+
268
+ ## Comparisons to other fnmatch/glob implementations
269
+
270
+ While strict compliance with the existing standards is a worthwhile
271
+ goal, some discrepancies exist between node-glob and other
272
+ implementations, and are intentional.
273
+
274
+ If the pattern starts with a `!` character, then it is negated. Set the
275
+ `nonegate` flag to suppress this behavior, and treat leading `!`
276
+ characters normally. This is perhaps relevant if you wish to start the
277
+ pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
278
+ characters at the start of a pattern will negate the pattern multiple
279
+ times.
280
+
281
+ If a pattern starts with `#`, then it is treated as a comment, and
282
+ will not match anything. Use `\#` to match a literal `#` at the
283
+ start of a line, or set the `nocomment` flag to suppress this behavior.
284
+
285
+ The double-star character `**` is supported by default, unless the
286
+ `noglobstar` flag is set. This is supported in the manner of bsdglob
287
+ and bash 4.3, where `**` only has special significance if it is the only
288
+ thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
289
+ `a/**b` will not.
290
+
291
+ Note that symlinked directories are not crawled as part of a `**`,
292
+ though their contents may match against subsequent portions of the
293
+ pattern. This prevents infinite loops and duplicates and the like.
294
+
295
+ If an escaped pattern has no matches, and the `nonull` flag is set,
296
+ then glob returns the pattern as-provided, rather than
297
+ interpreting the character escapes. For example,
298
+ `glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
299
+ `"*a?"`. This is akin to setting the `nullglob` option in bash, except
300
+ that it does not resolve escaped pattern characters.
301
+
302
+ If brace expansion is not disabled, then it is performed before any
303
+ other interpretation of the glob pattern. Thus, a pattern like
304
+ `+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
305
+ **first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
306
+ checked for validity. Since those two are valid, matching proceeds.
307
+
308
+ ## Windows
309
+
310
+ **Please only use forward-slashes in glob expressions.**
311
+
312
+ Though windows uses either `/` or `\` as its path separator, only `/`
313
+ characters are used by this glob implementation. You must use
314
+ forward-slashes **only** in glob expressions. Back-slashes will always
315
+ be interpreted as escape characters, not path separators.
316
+
317
+ Results from absolute patterns such as `/foo/*` are mounted onto the
318
+ root setting using `path.join`. On windows, this will by default result
319
+ in `/foo/*` matching `C:\foo\bar.txt`.
320
+
321
+ ## Race Conditions
322
+
323
+ Glob searching, by its very nature, is susceptible to race conditions,
324
+ since it relies on directory walking and such.
325
+
326
+ As a result, it is possible that a file that exists when glob looks for
327
+ it may have been deleted or modified by the time it returns the result.
328
+
329
+ As part of its internal implementation, this program caches all stat
330
+ and readdir calls that it makes, in order to cut down on system
331
+ overhead. However, this also makes it even more susceptible to races,
332
+ especially if the cache or statCache objects are reused between glob
333
+ calls.
334
+
335
+ Users are thus advised not to use a glob result as a guarantee of
336
+ filesystem state in the face of rapid changes. For the vast majority
337
+ of operations, this is never a problem.
338
+
339
+ ## Contributing
340
+
341
+ Any change to behavior (including bugfixes) must come with a test.
342
+
343
+ Patches that fail tests or reduce performance will be rejected.
344
+
345
+ ```
346
+ # to run tests
347
+ npm test
348
+
349
+ # to re-generate test fixtures
350
+ npm run test-regen
351
+
352
+ # to benchmark against bash/zsh
353
+ npm run bench
354
+
355
+ # to profile javascript
356
+ npm run prof
357
+ ```