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,63 @@
1
+ # mkdirp
2
+
3
+ Like `mkdir -p`, but in node.js!
4
+
5
+ [![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
6
+
7
+ # example
8
+
9
+ ## pow.js
10
+
11
+ ```js
12
+ var mkdirp = require('mkdirp');
13
+
14
+ mkdirp('/tmp/foo/bar/baz', function (err) {
15
+ if (err) console.error(err)
16
+ else console.log('pow!')
17
+ });
18
+ ```
19
+
20
+ Output
21
+
22
+ ```
23
+ pow!
24
+ ```
25
+
26
+ And now /tmp/foo/bar/baz exists, huzzah!
27
+
28
+ # methods
29
+
30
+ ```js
31
+ var mkdirp = require('mkdirp');
32
+ ```
33
+
34
+ ## mkdirp(dir, mode, cb)
35
+
36
+ Create a new directory and any necessary subdirectories at `dir` with octal
37
+ permission string `mode`.
38
+
39
+ If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
40
+
41
+ `cb(err, made)` fires with the error or the first directory `made`
42
+ that had to be created, if any.
43
+
44
+ ## mkdirp.sync(dir, mode)
45
+
46
+ Synchronously create a new directory and any necessary subdirectories at `dir`
47
+ with octal permission string `mode`.
48
+
49
+ If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
50
+
51
+ Returns the first directory that had to be created, if any.
52
+
53
+ # install
54
+
55
+ With [npm](http://npmjs.org) do:
56
+
57
+ ```
58
+ npm install mkdirp
59
+ ```
60
+
61
+ # license
62
+
63
+ MIT
@@ -0,0 +1,38 @@
1
+ var mkdirp = require('../').mkdirp;
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ var ps = [ '', 'tmp' ];
7
+
8
+ for (var i = 0; i < 25; i++) {
9
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ ps.push(dir);
11
+ }
12
+
13
+ var file = ps.join('/');
14
+
15
+ test('chmod-pre', function (t) {
16
+ var mode = 0744
17
+ mkdirp(file, mode, function (er) {
18
+ t.ifError(er, 'should not error');
19
+ fs.stat(file, function (er, stat) {
20
+ t.ifError(er, 'should exist');
21
+ t.ok(stat && stat.isDirectory(), 'should be directory');
22
+ t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
23
+ t.end();
24
+ });
25
+ });
26
+ });
27
+
28
+ test('chmod', function (t) {
29
+ var mode = 0755
30
+ mkdirp(file, mode, function (er) {
31
+ t.ifError(er, 'should not error');
32
+ fs.stat(file, function (er, stat) {
33
+ t.ifError(er, 'should exist');
34
+ t.ok(stat && stat.isDirectory(), 'should be directory');
35
+ t.end();
36
+ });
37
+ });
38
+ });
@@ -0,0 +1,37 @@
1
+ var mkdirp = require('../').mkdirp;
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ var ps = [ '', 'tmp' ];
7
+
8
+ for (var i = 0; i < 25; i++) {
9
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ ps.push(dir);
11
+ }
12
+
13
+ var file = ps.join('/');
14
+
15
+ // a file in the way
16
+ var itw = ps.slice(0, 3).join('/');
17
+
18
+
19
+ test('clobber-pre', function (t) {
20
+ console.error("about to write to "+itw)
21
+ fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
22
+
23
+ fs.stat(itw, function (er, stat) {
24
+ t.ifError(er)
25
+ t.ok(stat && stat.isFile(), 'should be file')
26
+ t.end()
27
+ })
28
+ })
29
+
30
+ test('clobber', function (t) {
31
+ t.plan(2);
32
+ mkdirp(file, 0755, function (err) {
33
+ t.ok(err);
34
+ t.equal(err.code, 'ENOTDIR');
35
+ t.end();
36
+ });
37
+ });
@@ -0,0 +1,28 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('woo', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ mkdirp(file, 0755, function (err) {
15
+ if (err) t.fail(err);
16
+ else path.exists(file, function (ex) {
17
+ if (!ex) t.fail('file not created')
18
+ else fs.stat(file, function (err, stat) {
19
+ if (err) t.fail(err)
20
+ else {
21
+ t.equal(stat.mode & 0777, 0755);
22
+ t.ok(stat.isDirectory(), 'target not a directory');
23
+ t.end();
24
+ }
25
+ })
26
+ })
27
+ });
28
+ });
@@ -0,0 +1,32 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('async perm', function (t) {
7
+ t.plan(2);
8
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
9
+
10
+ mkdirp(file, 0755, function (err) {
11
+ if (err) t.fail(err);
12
+ else path.exists(file, function (ex) {
13
+ if (!ex) t.fail('file not created')
14
+ else fs.stat(file, function (err, stat) {
15
+ if (err) t.fail(err)
16
+ else {
17
+ t.equal(stat.mode & 0777, 0755);
18
+ t.ok(stat.isDirectory(), 'target not a directory');
19
+ t.end();
20
+ }
21
+ })
22
+ })
23
+ });
24
+ });
25
+
26
+ test('async root perm', function (t) {
27
+ mkdirp('/tmp', 0755, function (err) {
28
+ if (err) t.fail(err);
29
+ t.end();
30
+ });
31
+ t.end();
32
+ });
@@ -0,0 +1,39 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('sync perm', function (t) {
7
+ t.plan(2);
8
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
9
+
10
+ mkdirp.sync(file, 0755);
11
+ path.exists(file, function (ex) {
12
+ if (!ex) t.fail('file not created')
13
+ else fs.stat(file, function (err, stat) {
14
+ if (err) t.fail(err)
15
+ else {
16
+ t.equal(stat.mode & 0777, 0755);
17
+ t.ok(stat.isDirectory(), 'target not a directory');
18
+ t.end();
19
+ }
20
+ })
21
+ });
22
+ });
23
+
24
+ test('sync root perm', function (t) {
25
+ t.plan(1);
26
+
27
+ var file = '/tmp';
28
+ mkdirp.sync(file, 0755);
29
+ path.exists(file, function (ex) {
30
+ if (!ex) t.fail('file not created')
31
+ else fs.stat(file, function (err, stat) {
32
+ if (err) t.fail(err)
33
+ else {
34
+ t.ok(stat.isDirectory(), 'target not a directory');
35
+ t.end();
36
+ }
37
+ })
38
+ });
39
+ });
@@ -0,0 +1,41 @@
1
+ var mkdirp = require('../').mkdirp;
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('race', function (t) {
7
+ t.plan(4);
8
+ var ps = [ '', 'tmp' ];
9
+
10
+ for (var i = 0; i < 25; i++) {
11
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
12
+ ps.push(dir);
13
+ }
14
+ var file = ps.join('/');
15
+
16
+ var res = 2;
17
+ mk(file, function () {
18
+ if (--res === 0) t.end();
19
+ });
20
+
21
+ mk(file, function () {
22
+ if (--res === 0) t.end();
23
+ });
24
+
25
+ function mk (file, cb) {
26
+ mkdirp(file, 0755, function (err) {
27
+ if (err) t.fail(err);
28
+ else path.exists(file, function (ex) {
29
+ if (!ex) t.fail('file not created')
30
+ else fs.stat(file, function (err, stat) {
31
+ if (err) t.fail(err)
32
+ else {
33
+ t.equal(stat.mode & 0777, 0755);
34
+ t.ok(stat.isDirectory(), 'target not a directory');
35
+ if (cb) cb();
36
+ }
37
+ })
38
+ })
39
+ });
40
+ }
41
+ });
@@ -0,0 +1,32 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('rel', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var cwd = process.cwd();
13
+ process.chdir('/tmp');
14
+
15
+ var file = [x,y,z].join('/');
16
+
17
+ mkdirp(file, 0755, function (err) {
18
+ if (err) t.fail(err);
19
+ else path.exists(file, function (ex) {
20
+ if (!ex) t.fail('file not created')
21
+ else fs.stat(file, function (err, stat) {
22
+ if (err) t.fail(err)
23
+ else {
24
+ process.chdir(cwd);
25
+ t.equal(stat.mode & 0777, 0755);
26
+ t.ok(stat.isDirectory(), 'target not a directory');
27
+ t.end();
28
+ }
29
+ })
30
+ })
31
+ });
32
+ });
@@ -0,0 +1,25 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('return value', function (t) {
7
+ t.plan(4);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ // should return the first dir created.
15
+ // By this point, it would be profoundly surprising if /tmp didn't
16
+ // already exist, since every other test makes things in there.
17
+ mkdirp(file, function (err, made) {
18
+ t.ifError(err);
19
+ t.equal(made, '/tmp/' + x);
20
+ mkdirp(file, function (err, made) {
21
+ t.ifError(err);
22
+ t.equal(made, null);
23
+ });
24
+ });
25
+ });
@@ -0,0 +1,24 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('return value', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ // should return the first dir created.
15
+ // By this point, it would be profoundly surprising if /tmp didn't
16
+ // already exist, since every other test makes things in there.
17
+ // Note that this will throw on failure, which will fail the test.
18
+ var made = mkdirp.sync(file);
19
+ t.equal(made, '/tmp/' + x);
20
+
21
+ // making the same file again should have no effect.
22
+ made = mkdirp.sync(file);
23
+ t.equal(made, null);
24
+ });
@@ -0,0 +1,18 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('root', function (t) {
7
+ // '/' on unix, 'c:/' on windows.
8
+ var file = path.resolve('/');
9
+
10
+ mkdirp(file, 0755, function (err) {
11
+ if (err) throw err
12
+ fs.stat(file, function (er, stat) {
13
+ if (er) throw er
14
+ t.ok(stat.isDirectory(), 'target is a directory');
15
+ t.end();
16
+ })
17
+ });
18
+ });
@@ -0,0 +1,32 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('sync', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ try {
15
+ mkdirp.sync(file, 0755);
16
+ } catch (err) {
17
+ t.fail(err);
18
+ return t.end();
19
+ }
20
+
21
+ path.exists(file, function (ex) {
22
+ if (!ex) t.fail('file not created')
23
+ else fs.stat(file, function (err, stat) {
24
+ if (err) t.fail(err)
25
+ else {
26
+ t.equal(stat.mode & 0777, 0755);
27
+ t.ok(stat.isDirectory(), 'target not a directory');
28
+ t.end();
29
+ }
30
+ });
31
+ });
32
+ });
@@ -0,0 +1,28 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('implicit mode from umask', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ mkdirp(file, function (err) {
15
+ if (err) t.fail(err);
16
+ else path.exists(file, function (ex) {
17
+ if (!ex) t.fail('file not created')
18
+ else fs.stat(file, function (err, stat) {
19
+ if (err) t.fail(err)
20
+ else {
21
+ t.equal(stat.mode & 0777, 0777 & (~process.umask()));
22
+ t.ok(stat.isDirectory(), 'target not a directory');
23
+ t.end();
24
+ }
25
+ })
26
+ })
27
+ });
28
+ });