batman-rails-flo 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +29 -0
  3. data/Rakefile +2 -0
  4. data/lib/batman-rails-flo.rb +5 -0
  5. data/lib/batman_rails_flo/railtie.rb +9 -0
  6. data/lib/batman_rails_flo/tasks.rake +14 -0
  7. data/lib/batman_rails_flo/version.rb +3 -0
  8. data/vendor/assets/javascripts/batman_rails_flo/flo_server.js +67 -0
  9. data/vendor/assets/javascripts/batman_rails_flo/live_reload.js.coffee +129 -0
  10. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/CNAME +1 -0
  11. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/CONTRIBUTING.md +9 -0
  12. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/LICENSE +22 -0
  13. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/README +50 -0
  14. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/bin/cake +7 -0
  15. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/bin/coffee +7 -0
  16. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/browser.js +134 -0
  17. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/cake.js +112 -0
  18. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/coffee-script.js +335 -0
  19. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/command.js +569 -0
  20. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/grammar.js +631 -0
  21. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/helpers.js +252 -0
  22. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/index.js +11 -0
  23. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/lexer.js +926 -0
  24. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/nodes.js +3158 -0
  25. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/optparse.js +139 -0
  26. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/parser.js +724 -0
  27. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/register.js +66 -0
  28. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/repl.js +163 -0
  29. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/rewriter.js +475 -0
  30. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/scope.js +146 -0
  31. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/lib/coffee-script/sourcemap.js +161 -0
  32. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/LICENSE +21 -0
  33. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js +6 -0
  34. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/index.js +82 -0
  35. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/package.json +34 -0
  36. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/readme.markdown +63 -0
  37. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js +38 -0
  38. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js +37 -0
  39. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js +28 -0
  40. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/perm.js +32 -0
  41. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js +39 -0
  42. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/race.js +41 -0
  43. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/rel.js +32 -0
  44. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/return.js +25 -0
  45. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js +24 -0
  46. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/root.js +18 -0
  47. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/sync.js +32 -0
  48. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/umask.js +28 -0
  49. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js +32 -0
  50. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/package.json +50 -0
  51. data/vendor/assets/javascripts/batman_rails_flo/node_modules/coffee-script/register.js +1 -0
  52. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/LICENSE +30 -0
  53. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/PATENTS +23 -0
  54. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/README.md +124 -0
  55. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/bin/flo +26 -0
  56. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/configure/configure.html +57 -0
  57. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/configure/configure.js +205 -0
  58. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/configure/style.css +334 -0
  59. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/connection.js +235 -0
  60. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/devtools.html +12 -0
  61. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/index.js +323 -0
  62. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/logger.js +42 -0
  63. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/logo.png +0 -0
  64. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/manifest.json +13 -0
  65. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/client/session.js +305 -0
  66. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/index.js +10 -0
  67. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/lib/flo.js +226 -0
  68. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/lib/server.js +94 -0
  69. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/README.md +66 -0
  70. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/index.js +437 -0
  71. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/LICENSE +23 -0
  72. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/README.md +218 -0
  73. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/minimatch.js +1055 -0
  74. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  75. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  76. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  77. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  78. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/package.json +33 -0
  79. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  80. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  81. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  82. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  83. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  84. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  85. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/package.json +42 -0
  86. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  87. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  88. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/package.json +40 -0
  89. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/test/basic.js +399 -0
  90. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/test/brace-expand.js +33 -0
  91. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/test/caching.js +14 -0
  92. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/test/defaults.js +274 -0
  93. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  94. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/lib/walker.js +111 -0
  95. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/license +13 -0
  96. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/lib/makeerror.js +87 -0
  97. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/node_modules/tmpl/lib/tmpl.js +17 -0
  98. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/node_modules/tmpl/package.json +31 -0
  99. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/node_modules/tmpl/readme.md +10 -0
  100. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/package.json +34 -0
  101. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/node_modules/makeerror/readme.md +77 -0
  102. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/package.json +36 -0
  103. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/walker/readme.md +52 -0
  104. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/LICENSE +55 -0
  105. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/main.js +128 -0
  106. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/package.json +34 -0
  107. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/readme.mkd +72 -0
  108. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/test/d/d/t +0 -0
  109. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/test/d/t +0 -0
  110. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/test/test_monitor.js +31 -0
  111. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/test/test_monitorRootDirectory.js +28 -0
  112. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/node_modules/watch/test/test_watchTree.js +20 -0
  113. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/package.json +45 -0
  114. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/sane/test/test.js +243 -0
  115. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/CHANGELOG.md +81 -0
  116. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/LICENSE +177 -0
  117. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/Makefile +11 -0
  118. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/README.md +245 -0
  119. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/binding.gyp +14 -0
  120. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Makefile +355 -0
  121. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Release/linker.lock +0 -0
  122. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Release/obj.target/validation/src/validation.o +0 -0
  123. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Release/obj.target/xor/src/xor.o +0 -0
  124. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Release/validation.node +0 -0
  125. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/Release/xor.node +0 -0
  126. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/binding.Makefile +6 -0
  127. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/config.gypi +115 -0
  128. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/gyp-mac-tool +512 -0
  129. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/validation.target.mk +154 -0
  130. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/build/xor.target.mk +154 -0
  131. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/index.js +1 -0
  132. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/install.js +31 -0
  133. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/Constants.js +23 -0
  134. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/Deprecation.js +38 -0
  135. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/Validation.fallback.js +12 -0
  136. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/Validation.js +18 -0
  137. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketClient.js +359 -0
  138. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketConnection.js +717 -0
  139. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketFrame.js +282 -0
  140. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketRequest.js +478 -0
  141. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketRouter.js +154 -0
  142. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketRouterRequest.js +59 -0
  143. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/WebSocketServer.js +216 -0
  144. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/utils.js +7 -0
  145. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/websocket.js +11 -0
  146. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/xor.fallback.js +13 -0
  147. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/lib/xor.js +18 -0
  148. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/package.json +43 -0
  149. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/src/validation.cc +144 -0
  150. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/src/xor.cpp +86 -0
  151. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/vendor/FastBufferList.js +192 -0
  152. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/vendor/node-ctype/LICENSE +18 -0
  153. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/node_modules/websocket/vendor/node-ctype/ctio-faster.js +1126 -0
  154. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/package.json +25 -0
  155. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/test/client/browser_websocket.js +63 -0
  156. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/test/client/connection_test.js +57 -0
  157. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/test/client/logger_mock.js +15 -0
  158. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/test/client/session_test.js +194 -0
  159. data/vendor/assets/javascripts/batman_rails_flo/node_modules/fb-flo/test/server/flo_test.js +211 -0
  160. data/vendor/assets/javascripts/batman_rails_flo/package.json +15 -0
  161. data/vendor/assets/javascripts/batman_rails_flo/reload_event_handler.js.coffee +56 -0
  162. metadata +232 -0
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "sigmund",
3
+ "version": "1.0.0",
4
+ "description": "Quick and dirty signatures for Objects.",
5
+ "main": "sigmund.js",
6
+ "directories": {
7
+ "test": "test"
8
+ },
9
+ "dependencies": {},
10
+ "devDependencies": {
11
+ "tap": "~0.3.0"
12
+ },
13
+ "scripts": {
14
+ "test": "tap test/*.js",
15
+ "bench": "node bench.js"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git://github.com/isaacs/sigmund"
20
+ },
21
+ "keywords": [
22
+ "object",
23
+ "signature",
24
+ "key",
25
+ "data",
26
+ "psychoanalysis"
27
+ ],
28
+ "author": {
29
+ "name": "Isaac Z. Schlueter",
30
+ "email": "i@izs.me",
31
+ "url": "http://blog.izs.me/"
32
+ },
33
+ "license": "BSD",
34
+ "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n",
35
+ "readmeFilename": "README.md",
36
+ "bugs": {
37
+ "url": "https://github.com/isaacs/sigmund/issues"
38
+ },
39
+ "homepage": "https://github.com/isaacs/sigmund",
40
+ "_id": "sigmund@1.0.0",
41
+ "_from": "sigmund@~1.0.0"
42
+ }
@@ -0,0 +1,39 @@
1
+ module.exports = sigmund
2
+ function sigmund (subject, maxSessions) {
3
+ maxSessions = maxSessions || 10;
4
+ var notes = [];
5
+ var analysis = '';
6
+ var RE = RegExp;
7
+
8
+ function psychoAnalyze (subject, session) {
9
+ if (session > maxSessions) return;
10
+
11
+ if (typeof subject === 'function' ||
12
+ typeof subject === 'undefined') {
13
+ return;
14
+ }
15
+
16
+ if (typeof subject !== 'object' || !subject ||
17
+ (subject instanceof RE)) {
18
+ analysis += subject;
19
+ return;
20
+ }
21
+
22
+ if (notes.indexOf(subject) !== -1 || session === maxSessions) return;
23
+
24
+ notes.push(subject);
25
+ analysis += '{';
26
+ Object.keys(subject).forEach(function (issue, _, __) {
27
+ // pseudo-private values. skip those.
28
+ if (issue.charAt(0) === '_') return;
29
+ var to = typeof subject[issue];
30
+ if (to === 'function' || to === 'undefined') return;
31
+ analysis += issue;
32
+ psychoAnalyze(subject[issue], session + 1);
33
+ });
34
+ }
35
+ psychoAnalyze(subject, 0);
36
+ return analysis;
37
+ }
38
+
39
+ // vim: set softtabstop=4 shiftwidth=4:
@@ -0,0 +1,24 @@
1
+ var test = require('tap').test
2
+ var sigmund = require('../sigmund.js')
3
+
4
+
5
+ // occasionally there are duplicates
6
+ // that's an acceptable edge-case. JSON.stringify and util.inspect
7
+ // have some collision potential as well, though less, and collision
8
+ // detection is expensive.
9
+ var hash = '{abc/def/g{0h1i2{jkl'
10
+ var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}
11
+ var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}
12
+
13
+ var obj3 = JSON.parse(JSON.stringify(obj1))
14
+ obj3.c = /def/
15
+ obj3.g[2].cycle = obj3
16
+ var cycleHash = '{abc/def/g{0h1i2{jklcycle'
17
+
18
+ test('basic', function (t) {
19
+ t.equal(sigmund(obj1), hash)
20
+ t.equal(sigmund(obj2), hash)
21
+ t.equal(sigmund(obj3), cycleHash)
22
+ t.end()
23
+ })
24
+
@@ -0,0 +1,40 @@
1
+ {
2
+ "author": {
3
+ "name": "Isaac Z. Schlueter",
4
+ "email": "i@izs.me",
5
+ "url": "http://blog.izs.me"
6
+ },
7
+ "name": "minimatch",
8
+ "description": "a glob matcher in javascript",
9
+ "version": "0.2.14",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git://github.com/isaacs/minimatch.git"
13
+ },
14
+ "main": "minimatch.js",
15
+ "scripts": {
16
+ "test": "tap test/*.js"
17
+ },
18
+ "engines": {
19
+ "node": "*"
20
+ },
21
+ "dependencies": {
22
+ "lru-cache": "2",
23
+ "sigmund": "~1.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "tap": ""
27
+ },
28
+ "license": {
29
+ "type": "MIT",
30
+ "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
31
+ },
32
+ "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nEventually, it will replace the C binding in node-glob.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself. When set, an empty list is returned if there are\nno matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n",
33
+ "readmeFilename": "README.md",
34
+ "bugs": {
35
+ "url": "https://github.com/isaacs/minimatch/issues"
36
+ },
37
+ "homepage": "https://github.com/isaacs/minimatch",
38
+ "_id": "minimatch@0.2.14",
39
+ "_from": "minimatch@~0.2.14"
40
+ }
@@ -0,0 +1,399 @@
1
+ // http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
2
+ //
3
+ // TODO: Some of these tests do very bad things with backslashes, and will
4
+ // most likely fail badly on windows. They should probably be skipped.
5
+
6
+ var tap = require("tap")
7
+ , globalBefore = Object.keys(global)
8
+ , mm = require("../")
9
+ , files = [ "a", "b", "c", "d", "abc"
10
+ , "abd", "abe", "bb", "bcd"
11
+ , "ca", "cb", "dd", "de"
12
+ , "bdir/", "bdir/cfile"]
13
+ , next = files.concat([ "a-b", "aXb"
14
+ , ".x", ".y" ])
15
+
16
+
17
+ var patterns =
18
+ [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test"
19
+ , ["a*", ["a", "abc", "abd", "abe"]]
20
+ , ["X*", ["X*"], {nonull: true}]
21
+
22
+ // allow null glob expansion
23
+ , ["X*", []]
24
+
25
+ // isaacs: Slightly different than bash/sh/ksh
26
+ // \\* is not un-escaped to literal "*" in a failed match,
27
+ // but it does make it get treated as a literal star
28
+ , ["\\*", ["\\*"], {nonull: true}]
29
+ , ["\\**", ["\\**"], {nonull: true}]
30
+ , ["\\*\\*", ["\\*\\*"], {nonull: true}]
31
+
32
+ , ["b*/", ["bdir/"]]
33
+ , ["c*", ["c", "ca", "cb"]]
34
+ , ["**", files]
35
+
36
+ , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
37
+ , ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
38
+
39
+ , "legendary larry crashes bashes"
40
+ , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
41
+ , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
42
+ , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
43
+ , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
44
+
45
+ , "character classes"
46
+ , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
47
+ , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
48
+ "bdir/", "ca", "cb", "dd", "de"]]
49
+ , ["a*[^c]", ["abd", "abe"]]
50
+ , function () { files.push("a-b", "aXb") }
51
+ , ["a[X-]b", ["a-b", "aXb"]]
52
+ , function () { files.push(".x", ".y") }
53
+ , ["[^a-c]*", ["d", "dd", "de"]]
54
+ , function () { files.push("a*b/", "a*b/ooo") }
55
+ , ["a\\*b/*", ["a*b/ooo"]]
56
+ , ["a\\*?/*", ["a*b/ooo"]]
57
+ , ["*\\\\!*", [], {null: true}, ["echo !7"]]
58
+ , ["*\\!*", ["echo !7"], null, ["echo !7"]]
59
+ , ["*.\\*", ["r.*"], null, ["r.*"]]
60
+ , ["a[b]c", ["abc"]]
61
+ , ["a[\\b]c", ["abc"]]
62
+ , ["a?c", ["abc"]]
63
+ , ["a\\*c", [], {null: true}, ["abc"]]
64
+ , ["", [""], { null: true }, [""]]
65
+
66
+ , "http://www.opensource.apple.com/source/bash/bash-23/" +
67
+ "bash/tests/glob-test"
68
+ , function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
69
+ , ["*/man*/bash.*", ["man/man1/bash.1"]]
70
+ , ["man/man1/bash.1", ["man/man1/bash.1"]]
71
+ , ["a***c", ["abc"], null, ["abc"]]
72
+ , ["a*****?c", ["abc"], null, ["abc"]]
73
+ , ["?*****??", ["abc"], null, ["abc"]]
74
+ , ["*****??", ["abc"], null, ["abc"]]
75
+ , ["?*****?c", ["abc"], null, ["abc"]]
76
+ , ["?***?****c", ["abc"], null, ["abc"]]
77
+ , ["?***?****?", ["abc"], null, ["abc"]]
78
+ , ["?***?****", ["abc"], null, ["abc"]]
79
+ , ["*******c", ["abc"], null, ["abc"]]
80
+ , ["*******?", ["abc"], null, ["abc"]]
81
+ , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
82
+ , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
83
+ , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
84
+ , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
85
+ , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
86
+ , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
87
+ , ["[-abc]", ["-"], null, ["-"]]
88
+ , ["[abc-]", ["-"], null, ["-"]]
89
+ , ["\\", ["\\"], null, ["\\"]]
90
+ , ["[\\\\]", ["\\"], null, ["\\"]]
91
+ , ["[[]", ["["], null, ["["]]
92
+ , ["[", ["["], null, ["["]]
93
+ , ["[*", ["[abc"], null, ["[abc"]]
94
+ , "a right bracket shall lose its special meaning and\n" +
95
+ "represent itself in a bracket expression if it occurs\n" +
96
+ "first in the list. -- POSIX.2 2.8.3.2"
97
+ , ["[]]", ["]"], null, ["]"]]
98
+ , ["[]-]", ["]"], null, ["]"]]
99
+ , ["[a-\z]", ["p"], null, ["p"]]
100
+ , ["??**********?****?", [], { null: true }, ["abc"]]
101
+ , ["??**********?****c", [], { null: true }, ["abc"]]
102
+ , ["?************c****?****", [], { null: true }, ["abc"]]
103
+ , ["*c*?**", [], { null: true }, ["abc"]]
104
+ , ["a*****c*?**", [], { null: true }, ["abc"]]
105
+ , ["a********???*******", [], { null: true }, ["abc"]]
106
+ , ["[]", [], { null: true }, ["a"]]
107
+ , ["[abc", [], { null: true }, ["["]]
108
+
109
+ , "nocase tests"
110
+ , ["XYZ", ["xYz"], { nocase: true, null: true }
111
+ , ["xYz", "ABC", "IjK"]]
112
+ , ["ab*", ["ABC"], { nocase: true, null: true }
113
+ , ["xYz", "ABC", "IjK"]]
114
+ , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
115
+ , ["xYz", "ABC", "IjK"]]
116
+
117
+ // [ pattern, [matches], MM opts, files, TAP opts]
118
+ , "onestar/twostar"
119
+ , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
120
+ , ["{/?,*}", ["/a", "bb"], {null: true}
121
+ , ["/a", "/b/b", "/a/b/c", "bb"]]
122
+
123
+ , "dots should not match unless requested"
124
+ , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
125
+
126
+ // .. and . can only match patterns starting with .,
127
+ // even when options.dot is set.
128
+ , function () {
129
+ files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
130
+ }
131
+ , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
132
+ , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
133
+ , ["a/*/b", ["a/c/b"], {dot:false}]
134
+ , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
135
+
136
+
137
+ // this also tests that changing the options needs
138
+ // to change the cache key, even if the pattern is
139
+ // the same!
140
+ , ["**", ["a/b","a/.d",".a/.d"], { dot: true }
141
+ , [ ".a/.d", "a/.d", "a/b"]]
142
+
143
+ , "paren sets cannot contain slashes"
144
+ , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
145
+
146
+ // brace sets trump all else.
147
+ //
148
+ // invalid glob pattern. fails on bash4 and bsdglob.
149
+ // however, in this implementation, it's easier just
150
+ // to do the intuitive thing, and let brace-expansion
151
+ // actually come before parsing any extglob patterns,
152
+ // like the documentation seems to say.
153
+ //
154
+ // XXX: if anyone complains about this, either fix it
155
+ // or tell them to grow up and stop complaining.
156
+ //
157
+ // bash/bsdglob says this:
158
+ // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
159
+ // but we do this instead:
160
+ , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
161
+
162
+ // test partial parsing in the presence of comment/negation chars
163
+ , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
164
+ , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
165
+
166
+ // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
167
+ , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
168
+ , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
169
+ , {}
170
+ , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
171
+
172
+
173
+ // crazy nested {,,} and *(||) tests.
174
+ , function () {
175
+ files = [ "a", "b", "c", "d"
176
+ , "ab", "ac", "ad"
177
+ , "bc", "cb"
178
+ , "bc,d", "c,db", "c,d"
179
+ , "d)", "(b|c", "*(b|c"
180
+ , "b|c", "b|cc", "cb|c"
181
+ , "x(a|b|c)", "x(a|c)"
182
+ , "(a|b|c)", "(a|c)"]
183
+ }
184
+ , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
185
+ , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
186
+ // a
187
+ // *(b|c)
188
+ // *(b|d)
189
+ , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
190
+ , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
191
+
192
+
193
+ // test various flag settings.
194
+ , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
195
+ , { noext: true } ]
196
+ , ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
197
+ , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
198
+ , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
199
+
200
+
201
+ // begin channelling Boole and deMorgan...
202
+ , "negation tests"
203
+ , function () {
204
+ files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
205
+ }
206
+
207
+ // anything that is NOT a* matches.
208
+ , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
209
+
210
+ // anything that IS !a* matches.
211
+ , ["!a*", ["!ab", "!abc"], {nonegate: true}]
212
+
213
+ // anything that IS a* matches
214
+ , ["!!a*", ["a!b"]]
215
+
216
+ // anything that is NOT !a* matches
217
+ , ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
218
+
219
+ // negation nestled within a pattern
220
+ , function () {
221
+ files = [ "foo.js"
222
+ , "foo.bar"
223
+ // can't match this one without negative lookbehind.
224
+ , "foo.js.js"
225
+ , "blar.js"
226
+ , "foo."
227
+ , "boo.js.boo" ]
228
+ }
229
+ , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
230
+
231
+ // https://github.com/isaacs/minimatch/issues/5
232
+ , function () {
233
+ files = [ 'a/b/.x/c'
234
+ , 'a/b/.x/c/d'
235
+ , 'a/b/.x/c/d/e'
236
+ , 'a/b/.x'
237
+ , 'a/b/.x/'
238
+ , 'a/.x/b'
239
+ , '.x'
240
+ , '.x/'
241
+ , '.x/a'
242
+ , '.x/a/b'
243
+ , 'a/.x/b/.x/c'
244
+ , '.x/.x' ]
245
+ }
246
+ , ["**/.x/**", [ '.x/'
247
+ , '.x/a'
248
+ , '.x/a/b'
249
+ , 'a/.x/b'
250
+ , 'a/b/.x/'
251
+ , 'a/b/.x/c'
252
+ , 'a/b/.x/c/d'
253
+ , 'a/b/.x/c/d/e' ] ]
254
+
255
+ ]
256
+
257
+ var regexps =
258
+ [ '/^(?:(?=.)a[^/]*?)$/',
259
+ '/^(?:(?=.)X[^/]*?)$/',
260
+ '/^(?:(?=.)X[^/]*?)$/',
261
+ '/^(?:\\*)$/',
262
+ '/^(?:(?=.)\\*[^/]*?)$/',
263
+ '/^(?:\\*\\*)$/',
264
+ '/^(?:(?=.)b[^/]*?\\/)$/',
265
+ '/^(?:(?=.)c[^/]*?)$/',
266
+ '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/',
267
+ '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/',
268
+ '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/',
269
+ '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/',
270
+ '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/',
271
+ '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/',
272
+ '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/',
273
+ '/^(?:(?=.)a[^/]*?[^c])$/',
274
+ '/^(?:(?=.)a[X-]b)$/',
275
+ '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/',
276
+ '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/',
277
+ '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/',
278
+ '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/',
279
+ '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/',
280
+ '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/',
281
+ '/^(?:(?=.)a[b]c)$/',
282
+ '/^(?:(?=.)a[b]c)$/',
283
+ '/^(?:(?=.)a[^/]c)$/',
284
+ '/^(?:a\\*c)$/',
285
+ 'false',
286
+ '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/',
287
+ '/^(?:man\\/man1\\/bash\\.1)$/',
288
+ '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/',
289
+ '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/',
290
+ '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/',
291
+ '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/',
292
+ '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/',
293
+ '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/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/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/',
349
+ '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/',
350
+ '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ]
351
+ var re = 0;
352
+
353
+ tap.test("basic tests", function (t) {
354
+ var start = Date.now()
355
+
356
+ // [ pattern, [matches], MM opts, files, TAP opts]
357
+ patterns.forEach(function (c) {
358
+ if (typeof c === "function") return c()
359
+ if (typeof c === "string") return t.comment(c)
360
+
361
+ var pattern = c[0]
362
+ , expect = c[1].sort(alpha)
363
+ , options = c[2] || {}
364
+ , f = c[3] || files
365
+ , tapOpts = c[4] || {}
366
+
367
+ // options.debug = true
368
+ var m = new mm.Minimatch(pattern, options)
369
+ var r = m.makeRe()
370
+ var expectRe = regexps[re++]
371
+ tapOpts.re = String(r) || JSON.stringify(r)
372
+ tapOpts.files = JSON.stringify(f)
373
+ tapOpts.pattern = pattern
374
+ tapOpts.set = m.set
375
+ tapOpts.negated = m.negate
376
+
377
+ var actual = mm.match(f, pattern, options)
378
+ actual.sort(alpha)
379
+
380
+ t.equivalent( actual, expect
381
+ , JSON.stringify(pattern) + " " + JSON.stringify(expect)
382
+ , tapOpts )
383
+
384
+ t.equal(tapOpts.re, expectRe, tapOpts)
385
+ })
386
+
387
+ t.comment("time=" + (Date.now() - start) + "ms")
388
+ t.end()
389
+ })
390
+
391
+ tap.test("global leak test", function (t) {
392
+ var globalAfter = Object.keys(global)
393
+ t.equivalent(globalAfter, globalBefore, "no new globals, please")
394
+ t.end()
395
+ })
396
+
397
+ function alpha (a, b) {
398
+ return a > b ? 1 : -1
399
+ }