classiccms 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. data/lib/classiccms/application.rb +2 -3
  2. data/lib/classiccms/cli.rb +6 -0
  3. data/lib/classiccms/scaffold/Gemfile +4 -0
  4. data/lib/classiccms/{mongoid.yml → scaffold/config/mongoid.yml} +3 -4
  5. data/lib/classiccms/scaffold/spec/models/article_spec.rb +8 -0
  6. data/lib/classiccms/scaffold/spec/spec_helper.rb +24 -0
  7. data/lib/classiccms/version.rb +1 -1
  8. data/spec/cli_spec.rb +8 -0
  9. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8.a +0 -0
  10. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/build/v8/libv8preparser.a +0 -0
  11. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-debug.h +395 -0
  12. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-preparser.h +117 -0
  13. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-profiler.h +505 -0
  14. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8-testing.h +104 -0
  15. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8.h +4124 -0
  16. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/v8/include/v8stdint.h +53 -0
  17. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8/version.rb +6 -0
  18. data/vendor/bundle/gems/libv8-3.3.10.4-x86_64-darwin-11/lib/libv8.rb +15 -0
  19. data/vendor/bundle/gems/sass-3.1.19/.yardopts +11 -0
  20. data/vendor/bundle/gems/sass-3.1.19/CONTRIBUTING +3 -0
  21. data/vendor/bundle/gems/sass-3.1.19/MIT-LICENSE +20 -0
  22. data/vendor/bundle/gems/sass-3.1.19/README.md +200 -0
  23. data/vendor/bundle/gems/sass-3.1.19/REVISION +1 -0
  24. data/vendor/bundle/gems/sass-3.1.19/Rakefile +339 -0
  25. data/vendor/bundle/gems/sass-3.1.19/VERSION +1 -0
  26. data/vendor/bundle/gems/sass-3.1.19/VERSION_NAME +1 -0
  27. data/vendor/bundle/gems/sass-3.1.19/bin/sass +8 -0
  28. data/vendor/bundle/gems/sass-3.1.19/bin/sass-convert +7 -0
  29. data/vendor/bundle/gems/sass-3.1.19/bin/scss +8 -0
  30. data/vendor/bundle/gems/sass-3.1.19/extra/update_watch.rb +13 -0
  31. data/vendor/bundle/gems/sass-3.1.19/init.rb +18 -0
  32. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/base.rb +86 -0
  33. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/chain.rb +33 -0
  34. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/filesystem.rb +61 -0
  35. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/memory.rb +47 -0
  36. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores/null.rb +25 -0
  37. data/vendor/bundle/gems/sass-3.1.19/lib/sass/cache_stores.rb +15 -0
  38. data/vendor/bundle/gems/sass-3.1.19/lib/sass/callbacks.rb +66 -0
  39. data/vendor/bundle/gems/sass-3.1.19/lib/sass/css.rb +390 -0
  40. data/vendor/bundle/gems/sass-3.1.19/lib/sass/engine.rb +880 -0
  41. data/vendor/bundle/gems/sass-3.1.19/lib/sass/environment.rb +180 -0
  42. data/vendor/bundle/gems/sass-3.1.19/lib/sass/error.rb +201 -0
  43. data/vendor/bundle/gems/sass-3.1.19/lib/sass/exec.rb +682 -0
  44. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/base.rb +139 -0
  45. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers/filesystem.rb +149 -0
  46. data/vendor/bundle/gems/sass-3.1.19/lib/sass/importers.rb +22 -0
  47. data/vendor/bundle/gems/sass-3.1.19/lib/sass/less.rb +382 -0
  48. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/base.rb +32 -0
  49. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger/log_level.rb +49 -0
  50. data/vendor/bundle/gems/sass-3.1.19/lib/sass/logger.rb +15 -0
  51. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/compiler.rb +384 -0
  52. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/configuration.rb +123 -0
  53. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/generic.rb +15 -0
  54. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/merb.rb +48 -0
  55. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rack.rb +60 -0
  56. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/rails.rb +47 -0
  57. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin/staleness_checker.rb +183 -0
  58. data/vendor/bundle/gems/sass-3.1.19/lib/sass/plugin.rb +132 -0
  59. data/vendor/bundle/gems/sass-3.1.19/lib/sass/railtie.rb +9 -0
  60. data/vendor/bundle/gems/sass-3.1.19/lib/sass/repl.rb +57 -0
  61. data/vendor/bundle/gems/sass-3.1.19/lib/sass/root.rb +7 -0
  62. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/bool.rb +18 -0
  63. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/color.rb +475 -0
  64. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_lexer.rb +29 -0
  65. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/css_parser.rb +31 -0
  66. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/funcall.rb +175 -0
  67. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/functions.rb +1381 -0
  68. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/interpolation.rb +79 -0
  69. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/lexer.rb +337 -0
  70. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/list.rb +84 -0
  71. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/literal.rb +230 -0
  72. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/node.rb +99 -0
  73. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/number.rb +452 -0
  74. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/operation.rb +107 -0
  75. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/parser.rb +474 -0
  76. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string.rb +51 -0
  77. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/string_interpolation.rb +103 -0
  78. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/unary_operation.rb +64 -0
  79. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script/variable.rb +58 -0
  80. data/vendor/bundle/gems/sass-3.1.19/lib/sass/script.rb +39 -0
  81. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/css_parser.rb +46 -0
  82. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/parser.rb +1055 -0
  83. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/rx.rb +137 -0
  84. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/sass_parser.rb +11 -0
  85. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_lexer.rb +15 -0
  86. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/script_parser.rb +25 -0
  87. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss/static_parser.rb +40 -0
  88. data/vendor/bundle/gems/sass-3.1.19/lib/sass/scss.rb +17 -0
  89. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/abstract_sequence.rb +71 -0
  90. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/comma_sequence.rb +86 -0
  91. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/sequence.rb +296 -0
  92. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple.rb +119 -0
  93. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector/simple_sequence.rb +154 -0
  94. data/vendor/bundle/gems/sass-3.1.19/lib/sass/selector.rb +373 -0
  95. data/vendor/bundle/gems/sass-3.1.19/lib/sass/shared.rb +76 -0
  96. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/charset_node.rb +22 -0
  97. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/comment_node.rb +90 -0
  98. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/debug_node.rb +18 -0
  99. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/directive_node.rb +28 -0
  100. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/each_node.rb +24 -0
  101. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/extend_node.rb +29 -0
  102. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/for_node.rb +36 -0
  103. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/function_node.rb +27 -0
  104. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/if_node.rb +52 -0
  105. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/import_node.rb +68 -0
  106. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/media_node.rb +32 -0
  107. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_def_node.rb +27 -0
  108. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/mixin_node.rb +32 -0
  109. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/node.rb +188 -0
  110. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/prop_node.rb +148 -0
  111. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/return_node.rb +18 -0
  112. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/root_node.rb +28 -0
  113. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/rule_node.rb +127 -0
  114. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/variable_node.rb +30 -0
  115. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/base.rb +75 -0
  116. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/check_nesting.rb +127 -0
  117. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/convert.rb +262 -0
  118. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/cssize.rb +206 -0
  119. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/deep_copy.rb +87 -0
  120. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/extend.rb +42 -0
  121. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/perform.rb +357 -0
  122. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/set_options.rb +97 -0
  123. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/visitors/to_css.rb +219 -0
  124. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/warn_node.rb +18 -0
  125. data/vendor/bundle/gems/sass-3.1.19/lib/sass/tree/while_node.rb +18 -0
  126. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/multibyte_string_scanner.rb +134 -0
  127. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util/subset_map.rb +101 -0
  128. data/vendor/bundle/gems/sass-3.1.19/lib/sass/util.rb +800 -0
  129. data/vendor/bundle/gems/sass-3.1.19/lib/sass/version.rb +112 -0
  130. data/vendor/bundle/gems/sass-3.1.19/lib/sass.rb +73 -0
  131. data/vendor/bundle/gems/sass-3.1.19/rails/init.rb +1 -0
  132. data/vendor/bundle/gems/sass-3.1.19/test/Gemfile +4 -0
  133. data/vendor/bundle/gems/sass-3.1.19/test/sass/cache_test.rb +89 -0
  134. data/vendor/bundle/gems/sass-3.1.19/test/sass/callbacks_test.rb +61 -0
  135. data/vendor/bundle/gems/sass-3.1.19/test/sass/conversion_test.rb +1245 -0
  136. data/vendor/bundle/gems/sass-3.1.19/test/sass/css2sass_test.rb +397 -0
  137. data/vendor/bundle/gems/sass-3.1.19/test/sass/data/hsl-rgb.txt +319 -0
  138. data/vendor/bundle/gems/sass-3.1.19/test/sass/engine_test.rb +2730 -0
  139. data/vendor/bundle/gems/sass-3.1.19/test/sass/extend_test.rb +1663 -0
  140. data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.css +1 -0
  141. data/vendor/bundle/gems/sass-3.1.19/test/sass/fixtures/test_staleness_check_across_importers.scss +1 -0
  142. data/vendor/bundle/gems/sass-3.1.19/test/sass/functions_test.rb +1047 -0
  143. data/vendor/bundle/gems/sass-3.1.19/test/sass/importer_test.rb +192 -0
  144. data/vendor/bundle/gems/sass-3.1.19/test/sass/less_conversion_test.rb +653 -0
  145. data/vendor/bundle/gems/sass-3.1.19/test/sass/logger_test.rb +58 -0
  146. data/vendor/bundle/gems/sass-3.1.19/test/sass/mock_importer.rb +49 -0
  147. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1.css +9 -0
  148. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more1_with_line_comments.css +26 -0
  149. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_results/more_import.css +29 -0
  150. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/_more_partial.sass +2 -0
  151. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more1.sass +23 -0
  152. data/vendor/bundle/gems/sass-3.1.19/test/sass/more_templates/more_import.sass +11 -0
  153. data/vendor/bundle/gems/sass-3.1.19/test/sass/plugin_test.rb +496 -0
  154. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/alt.css +4 -0
  155. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/basic.css +9 -0
  156. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compact.css +5 -0
  157. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/complex.css +86 -0
  158. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/compressed.css +1 -0
  159. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/expanded.css +19 -0
  160. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/if.css +3 -0
  161. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import.css +31 -0
  162. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset.css +5 -0
  163. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_1_8.css +5 -0
  164. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/import_charset_ibm866.css +5 -0
  165. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/line_numbers.css +49 -0
  166. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/mixins.css +95 -0
  167. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/multiline.css +24 -0
  168. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/nested.css +22 -0
  169. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/options.css +1 -0
  170. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/parent_ref.css +13 -0
  171. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/script.css +16 -0
  172. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_import.css +31 -0
  173. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/scss_importee.css +2 -0
  174. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/nested_subdir/nested_subdir.css +1 -0
  175. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/subdir/subdir.css +3 -0
  176. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/units.css +11 -0
  177. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn.css +0 -0
  178. data/vendor/bundle/gems/sass-3.1.19/test/sass/results/warn_imported.css +0 -0
  179. data/vendor/bundle/gems/sass-3.1.19/test/sass/script_conversion_test.rb +285 -0
  180. data/vendor/bundle/gems/sass-3.1.19/test/sass/script_test.rb +519 -0
  181. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/css_test.rb +975 -0
  182. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/rx_test.rb +156 -0
  183. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/scss_test.rb +1308 -0
  184. data/vendor/bundle/gems/sass-3.1.19/test/sass/scss/test_helper.rb +37 -0
  185. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_double_import_loop2.sass +1 -0
  186. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_ibm866.sass +4 -0
  187. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_imported_charset_utf8.sass +4 -0
  188. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/_partial.sass +2 -0
  189. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/alt.sass +16 -0
  190. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/basic.sass +23 -0
  191. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork1.sass +2 -0
  192. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork2.sass +2 -0
  193. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork3.sass +2 -0
  194. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork4.sass +2 -0
  195. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/bork5.sass +3 -0
  196. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compact.sass +17 -0
  197. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/complex.sass +305 -0
  198. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/compressed.sass +15 -0
  199. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/double_import_loop1.sass +1 -0
  200. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/expanded.sass +17 -0
  201. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/if.sass +11 -0
  202. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import.sass +12 -0
  203. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset.sass +9 -0
  204. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_1_8.sass +6 -0
  205. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/import_charset_ibm866.sass +11 -0
  206. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.less +2 -0
  207. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/importee.sass +19 -0
  208. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/line_numbers.sass +13 -0
  209. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixin_bork.sass +5 -0
  210. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/mixins.sass +76 -0
  211. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/multiline.sass +20 -0
  212. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested.sass +25 -0
  213. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork1.sass +2 -0
  214. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork2.sass +2 -0
  215. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork3.sass +2 -0
  216. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork4.sass +2 -0
  217. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_bork5.sass +2 -0
  218. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_import.sass +2 -0
  219. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/nested_mixin_bork.sass +6 -0
  220. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/options.sass +2 -0
  221. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/parent_ref.sass +25 -0
  222. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/script.sass +101 -0
  223. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_import.scss +11 -0
  224. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/scss_importee.scss +1 -0
  225. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/single_import_loop.sass +1 -0
  226. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/_nested_partial.sass +2 -0
  227. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/nested_subdir/nested_subdir.sass +3 -0
  228. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/subdir/subdir.sass +6 -0
  229. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/units.sass +11 -0
  230. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn.sass +3 -0
  231. data/vendor/bundle/gems/sass-3.1.19/test/sass/templates/warn_imported.sass +4 -0
  232. data/vendor/bundle/gems/sass-3.1.19/test/sass/test_helper.rb +8 -0
  233. data/vendor/bundle/gems/sass-3.1.19/test/sass/util/multibyte_string_scanner_test.rb +147 -0
  234. data/vendor/bundle/gems/sass-3.1.19/test/sass/util/subset_map_test.rb +91 -0
  235. data/vendor/bundle/gems/sass-3.1.19/test/sass/util_test.rb +282 -0
  236. data/vendor/bundle/gems/sass-3.1.19/test/test_helper.rb +70 -0
  237. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/CHANGELOG.md +90 -0
  238. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Gemfile +35 -0
  239. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Guardfile +8 -0
  240. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/LICENSE +20 -0
  241. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/README.md +312 -0
  242. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Rakefile +47 -0
  243. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/Vagrantfile +96 -0
  244. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapter.rb +167 -0
  245. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/darwin.rb +84 -0
  246. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/linux.rb +110 -0
  247. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/polling.rb +66 -0
  248. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/adapters/windows.rb +81 -0
  249. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/directory_record.rb +317 -0
  250. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/listener.rb +203 -0
  251. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/multi_listener.rb +121 -0
  252. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/turnstile.rb +28 -0
  253. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen/version.rb +3 -0
  254. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/lib/listen.rb +38 -0
  255. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/listen.gemspec +26 -0
  256. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapter_spec.rb +142 -0
  257. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/darwin_spec.rb +31 -0
  258. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/linux_spec.rb +41 -0
  259. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/polling_spec.rb +68 -0
  260. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/adapters/windows_spec.rb +24 -0
  261. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/directory_record_spec.rb +1034 -0
  262. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/listener_spec.rb +155 -0
  263. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/multi_listener_spec.rb +156 -0
  264. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen/turnstile_spec.rb +56 -0
  265. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/listen_spec.rb +73 -0
  266. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/spec_helper.rb +16 -0
  267. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/adapter_helper.rb +716 -0
  268. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/directory_record_helper.rb +55 -0
  269. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/fixtures_helper.rb +29 -0
  270. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/listeners_helper.rb +144 -0
  271. data/vendor/bundle/gems/sass-3.1.19/vendor/listen/spec/support/platform_helper.rb +11 -0
  272. data/vendor/bundle/gems/therubyracer-0.10.1/.gitignore +13 -0
  273. data/vendor/bundle/gems/therubyracer-0.10.1/.gitmodules +3 -0
  274. data/vendor/bundle/gems/therubyracer-0.10.1/.travis.yml +9 -0
  275. data/vendor/bundle/gems/therubyracer-0.10.1/.yardopts +1 -0
  276. data/vendor/bundle/gems/therubyracer-0.10.1/Changelog.md +196 -0
  277. data/vendor/bundle/gems/therubyracer-0.10.1/Gemfile +1 -0
  278. data/vendor/bundle/gems/therubyracer-0.10.1/README.md +167 -0
  279. data/vendor/bundle/gems/therubyracer-0.10.1/Rakefile +23 -0
  280. data/vendor/bundle/gems/therubyracer-0.10.1/bin/therubyracer +11 -0
  281. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/Makefile +213 -0
  282. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/extconf.rb +26 -0
  283. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/gem_make.out +156 -0
  284. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.cpp +189 -0
  285. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/rr.h +41 -0
  286. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8.cpp +48 -0
  287. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.cpp +48 -0
  288. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_array.h +8 -0
  289. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.cpp +81 -0
  290. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_callbacks.h +8 -0
  291. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.cpp +92 -0
  292. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_context.h +6 -0
  293. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.cpp +34 -0
  294. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_date.h +6 -0
  295. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.cpp +17 -0
  296. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_debug.h +6 -0
  297. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.cpp +133 -0
  298. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_exception.h +11 -0
  299. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.cpp +70 -0
  300. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_external.h +8 -0
  301. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.cpp +69 -0
  302. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_function.h +11 -0
  303. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.cpp +186 -0
  304. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_handle.h +48 -0
  305. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.cpp +139 -0
  306. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_locker.h +6 -0
  307. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.cpp +67 -0
  308. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_message.h +10 -0
  309. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.cpp +122 -0
  310. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_object.h +10 -0
  311. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.cpp +36 -0
  312. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_script.h +8 -0
  313. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.cpp +52 -0
  314. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_string.h +9 -0
  315. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.cpp +344 -0
  316. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_template.h +8 -0
  317. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.cpp +70 -0
  318. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_try_catch.h +5 -0
  319. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.cpp +35 -0
  320. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_v8.h +6 -0
  321. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.cpp +175 -0
  322. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_value.h +10 -0
  323. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.cpp +61 -0
  324. data/vendor/bundle/gems/therubyracer-0.10.1/ext/v8/v8_weakref.h +29 -0
  325. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/access.rb +87 -0
  326. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/array.rb +17 -0
  327. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/c/locker.rb +18 -0
  328. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/cli.rb +133 -0
  329. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/context.rb +111 -0
  330. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/error.rb +130 -0
  331. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/function.rb +44 -0
  332. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/object.rb +69 -0
  333. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/caller.rb +37 -0
  334. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/constructor.rb +98 -0
  335. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/function.rb +63 -0
  336. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/interceptors.rb +152 -0
  337. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/proxies.rb +151 -0
  338. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal/templates.rb +73 -0
  339. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/portal.rb +86 -0
  340. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/stack.rb +66 -0
  341. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/tap.rb +9 -0
  342. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8/version.rb +3 -0
  343. data/vendor/bundle/gems/therubyracer-0.10.1/lib/v8.rb +23 -0
  344. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/array_spec.rb +15 -0
  345. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/cxt_spec.rb +57 -0
  346. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/ext_spec_helper.rb +27 -0
  347. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/func_spec.rb +64 -0
  348. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/object_spec.rb +10 -0
  349. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/string_spec.rb +11 -0
  350. data/vendor/bundle/gems/therubyracer-0.10.1/spec/ext/try_catch_spec.rb +60 -0
  351. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/.gitignore +1 -0
  352. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/README.txt +8 -0
  353. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/jsapi_spec.rb +922 -0
  354. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs/loadme.js +1 -0
  355. data/vendor/bundle/gems/therubyracer-0.10.1/spec/redjs_helper.rb +3 -0
  356. data/vendor/bundle/gems/therubyracer-0.10.1/spec/spec_helper.rb +9 -0
  357. data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/error_spec.rb +131 -0
  358. data/vendor/bundle/gems/therubyracer-0.10.1/spec/v8/portal/proxies_spec.rb +106 -0
  359. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/handle_memspec.rb +41 -0
  360. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/object_memspec.rb +14 -0
  361. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/proxies_memspec.rb +49 -0
  362. data/vendor/bundle/gems/therubyracer-0.10.1/specmem/spec_helper.rb +24 -0
  363. data/vendor/bundle/gems/therubyracer-0.10.1/specthread/spec_helper.rb +2 -0
  364. data/vendor/bundle/gems/therubyracer-0.10.1/specthread/threading_spec.rb +13 -0
  365. data/vendor/bundle/gems/therubyracer-0.10.1/thefrontside.png +0 -0
  366. data/vendor/bundle/gems/therubyracer-0.10.1/therubyracer.gemspec +29 -0
  367. data/vendor/bundle/specifications/libv8-3.3.10.4-x86_64-darwin-11.gemspec +33 -0
  368. data/vendor/bundle/specifications/sass-3.1.19.gemspec +35 -0
  369. metadata +365 -3
@@ -0,0 +1,1034 @@
1
+ require 'spec_helper'
2
+
3
+ describe Listen::DirectoryRecord do
4
+ let(:base_directory) { File.dirname(__FILE__) }
5
+
6
+ subject { described_class.new(base_directory) }
7
+
8
+ describe '.generate_default_ignoring_patterns' do
9
+ it 'creates regexp patterns from the default ignored directories and extensions' do
10
+ described_class.generate_default_ignoring_patterns.should include(
11
+ %r{^(?:\.rbx|\.bundle|\.git|\.svn|log|tmp|vendor)/},
12
+ %r{(?:\.DS_Store)$}
13
+ )
14
+ end
15
+
16
+ it 'memoizes the generated results' do
17
+ described_class.generate_default_ignoring_patterns.should equal described_class.generate_default_ignoring_patterns
18
+ end
19
+ end
20
+
21
+ describe '#initialize' do
22
+ it 'sets the base directory' do
23
+ subject.directory.should eq base_directory
24
+ end
25
+
26
+ it 'sets the default ignoring patterns' do
27
+ subject.ignoring_patterns.should =~ described_class.generate_default_ignoring_patterns
28
+ end
29
+
30
+ it 'sets the default filtering patterns' do
31
+ subject.filtering_patterns.should eq []
32
+ end
33
+
34
+ it 'raises an error when the passed path does not exist' do
35
+ expect { described_class.new('no way I exist') }.to raise_error(ArgumentError)
36
+ end
37
+
38
+ it 'raises an error when the passed path is not a directory' do
39
+ expect { described_class.new(__FILE__) }.to raise_error(ArgumentError)
40
+ end
41
+ end
42
+
43
+ describe '#ignore' do
44
+ it 'adds the passed paths to the list of ignoted paths in the record' do
45
+ subject.ignore(%r{^\.old/}, %r{\.pid$})
46
+ subject.ignoring_patterns.should include(%r{^\.old/}, %r{\.pid$})
47
+ end
48
+ end
49
+
50
+ describe '#filter' do
51
+ it 'adds the passed regexps to the list of filters that determine the stored paths' do
52
+ subject.filter(%r{\.(?:jpe?g|gif|png)}, %r{\.(?:mp3|ogg|a3c)})
53
+ subject.filtering_patterns.should include(%r{\.(?:jpe?g|gif|png)}, %r{\.(?:mp3|ogg|a3c)})
54
+ end
55
+ end
56
+
57
+ describe '#ignored?' do
58
+ before { subject.stub(:relative_to_base) { |path| path } }
59
+
60
+ it 'tests paths relative to the base directory' do
61
+ subject.should_receive(:relative_to_base).with('file.txt')
62
+ subject.ignored?('file.txt')
63
+ end
64
+
65
+ it 'returns true when the passed path is a default ignored path' do
66
+ subject.ignored?('tmp/some_process.pid').should be_true
67
+ subject.ignored?('dir/.DS_Store').should be_true
68
+ subject.ignored?('.git/config').should be_true
69
+ end
70
+
71
+ it 'returns false when the passed path is not a default ignored path' do
72
+ subject.ignored?('nested/tmp/some_process.pid').should be_false
73
+ subject.ignored?('nested/.git').should be_false
74
+ subject.ignored?('dir/.DS_Store/file').should be_false
75
+ subject.ignored?('file.git').should be_false
76
+ end
77
+
78
+ it 'returns true when the passed path is ignored' do
79
+ subject.ignore(%r{\.pid$})
80
+ subject.ignored?('dir/some_process.pid').should be_true
81
+ end
82
+
83
+ it 'returns false when the passed path is not ignored' do
84
+ subject.ignore(%r{\.pid$})
85
+ subject.ignored?('dir/some_file.txt').should be_false
86
+ end
87
+ end
88
+
89
+ describe '#filtered?' do
90
+ before { subject.stub(:relative_to_base) { |path| path } }
91
+
92
+ context 'when no filtering patterns are set' do
93
+ it 'returns true for any path' do
94
+ subject.filtered?('file.txt').should be_true
95
+ end
96
+ end
97
+
98
+ context 'when filtering patterns are set' do
99
+ before { subject.filter(%r{\.(?:jpe?g|gif|png)}) }
100
+
101
+ it 'tests paths relative to the base directory' do
102
+ subject.should_receive(:relative_to_base).with('file.txt')
103
+ subject.filtered?('file.txt')
104
+ end
105
+
106
+ it 'returns true when the passed path is filtered' do
107
+ subject.filter(%r{\.(?:jpe?g|gif|png)})
108
+ subject.filtered?('dir/picture.jpeg').should be_true
109
+ end
110
+
111
+ it 'returns false when the passed path is not filtered' do
112
+ subject.filter(%r{\.(?:jpe?g|gif|png)})
113
+ subject.filtered?('dir/song.mp3').should be_false
114
+ end
115
+ end
116
+ end
117
+
118
+ describe '#build' do
119
+ it 'stores all files' do
120
+ fixtures do |path|
121
+ touch 'file.rb'
122
+ mkdir 'a_directory'
123
+ touch 'a_directory/file.txt'
124
+
125
+ record = described_class.new(path)
126
+ record.build
127
+
128
+ record.paths[path]['file.rb'].type.should eq 'File'
129
+ record.paths[path]['a_directory'].type.should eq 'Dir'
130
+ record.paths["#{path}/a_directory"]['file.txt'].type.should eq 'File'
131
+ end
132
+ end
133
+
134
+ context 'with ignored path set' do
135
+ it 'does not store ignored directory or its childs' do
136
+ fixtures do |path|
137
+ mkdir 'ignored_directory'
138
+ mkdir 'ignored_directory/child_directory'
139
+ touch 'ignored_directory/file.txt'
140
+
141
+ record = described_class.new(path)
142
+ record.ignore %r{^ignored_directory/}
143
+ record.build
144
+
145
+ record.paths[path]['/a_ignored_directory'].should be_nil
146
+ record.paths["#{path}/a_ignored_directory"]['child_directory'].should be_nil
147
+ record.paths["#{path}/a_ignored_directory"]['file.txt'].should be_nil
148
+ end
149
+ end
150
+
151
+ it 'does not store ignored files' do
152
+ fixtures do |path|
153
+ touch 'ignored_file.rb'
154
+
155
+ record = described_class.new(path)
156
+ record.ignore %r{^ignored_file.rb$}
157
+ record.build
158
+
159
+ record.paths[path]['ignored_file.rb'].should be_nil
160
+ end
161
+ end
162
+ end
163
+
164
+ context 'with filters set' do
165
+ it 'only stores filterd files' do
166
+ fixtures do |path|
167
+ touch 'file.rb'
168
+ touch 'file.zip'
169
+ mkdir 'a_directory'
170
+ touch 'a_directory/file.txt'
171
+ touch 'a_directory/file.rb'
172
+
173
+ record = described_class.new(path)
174
+ record.filter(/\.txt$/, /.*\.zip/)
175
+ record.build
176
+
177
+ record.paths[path]['file.rb'].should be_nil
178
+ record.paths[path]['file.zip'].type.should eq 'File'
179
+ record.paths[path]['a_directory'].type.should eq 'Dir'
180
+ record.paths["#{path}/a_directory"]['file.txt'].type.should eq 'File'
181
+ record.paths["#{path}/a_directory"]['file.rb'].should be_nil
182
+ end
183
+ end
184
+ end
185
+ end
186
+
187
+ describe '#relative_to_base' do
188
+ it 'removes the path of the base-directory from the passed path' do
189
+ path = 'dir/to/app/file.rb'
190
+ subject.relative_to_base(File.join(base_directory, path)).should eq path
191
+ end
192
+
193
+ it 'returns nil when the passed path is not inside the base-directory' do
194
+ subject.relative_to_base('/tmp/some_random_path').should be_nil
195
+ end
196
+ end
197
+
198
+ describe '#fetch_changes' do
199
+ context 'with single file changes' do
200
+ context 'when a file is created' do
201
+ it 'detects the added file' do
202
+ fixtures do |path|
203
+ modified, added, removed = changes(path) do
204
+ touch 'new_file.rb'
205
+ end
206
+
207
+ added.should =~ %w(new_file.rb)
208
+ modified.should be_empty
209
+ removed.should be_empty
210
+ end
211
+ end
212
+
213
+ it 'stores the added file in the record' do
214
+ fixtures do |path|
215
+ changes(path) do
216
+ @record.paths.should be_empty
217
+
218
+ touch 'new_file.rb'
219
+ end
220
+
221
+ @record.paths[path]['new_file.rb'].should_not be_nil
222
+ end
223
+ end
224
+
225
+ context 'given a new created directory' do
226
+ it 'detects the added file' do
227
+ fixtures do |path|
228
+ modified, added, removed = changes(path) do
229
+ mkdir 'a_directory'
230
+ touch 'a_directory/new_file.rb'
231
+ end
232
+
233
+ added.should =~ %w(a_directory/new_file.rb)
234
+ modified.should be_empty
235
+ removed.should be_empty
236
+ end
237
+ end
238
+
239
+ it 'stores the added directory and file in the record' do
240
+ fixtures do |path|
241
+ changes(path) do
242
+ @record.paths.should be_empty
243
+
244
+ mkdir 'a_directory'
245
+ touch 'a_directory/new_file.rb'
246
+ end
247
+
248
+ @record.paths[path]['a_directory'].should_not be_nil
249
+ @record.paths["#{path}/a_directory"]['new_file.rb'].should_not be_nil
250
+ end
251
+ end
252
+ end
253
+
254
+ context 'given an existing directory' do
255
+ context 'with recursive option set to true' do
256
+ it 'detects the added file' do
257
+ fixtures do |path|
258
+ mkdir 'a_directory'
259
+
260
+ modified, added, removed = changes(path, :recursive => true) do
261
+ touch 'a_directory/new_file.rb'
262
+ end
263
+
264
+ added.should =~ %w(a_directory/new_file.rb)
265
+ modified.should be_empty
266
+ removed.should be_empty
267
+ end
268
+ end
269
+
270
+ context 'with an ignored directory' do
271
+ it "doesn't detect the added file" do
272
+ fixtures do |path|
273
+ mkdir 'ignored_directory'
274
+
275
+ modified, added, removed = changes(path, :ignore => %r{^ignored_directory/}, :recursive => true) do
276
+ touch 'ignored_directory/new_file.rb'
277
+ end
278
+
279
+ added.should be_empty
280
+ modified.should be_empty
281
+ removed.should be_empty
282
+ end
283
+ end
284
+
285
+ it "doesn't detect the added file when it's asked to fetch the changes of the ignored directory"do
286
+ fixtures do |path|
287
+ mkdir 'ignored_directory'
288
+
289
+ modified, added, removed = changes(path, :paths => ["#{path}/ignored_directory"], :ignore => %r{^ignored_directory/}, :recursive => true) do
290
+ touch 'ignored_directory/new_file.rb'
291
+ end
292
+
293
+ added.should be_empty
294
+ modified.should be_empty
295
+ removed.should be_empty
296
+ end
297
+ end
298
+ end
299
+ end
300
+
301
+ context 'with recursive option set to false' do
302
+ it "doesn't detect deeply-nested added files" do
303
+ fixtures do |path|
304
+ mkdir 'a_directory'
305
+
306
+ modified, added, removed = changes(path, :recursive => false) do
307
+ touch 'a_directory/new_file.rb'
308
+ end
309
+
310
+ added.should be_empty
311
+ modified.should be_empty
312
+ removed.should be_empty
313
+ end
314
+ end
315
+ end
316
+ end
317
+
318
+ context 'given a directory with subdirectories' do
319
+ it 'detects the added file' do
320
+ fixtures do |path|
321
+ mkdir_p 'a_directory/subdirectory'
322
+
323
+ modified, added, removed = changes(path, :recursive => true) do
324
+ touch 'a_directory/subdirectory/new_file.rb'
325
+ end
326
+
327
+ added.should =~ %w(a_directory/subdirectory/new_file.rb)
328
+ modified.should be_empty
329
+ removed.should be_empty
330
+ end
331
+ end
332
+
333
+ context 'with an ignored directory' do
334
+ it "doesn't detect added files in neither the directory nor the subdirectory" do
335
+ fixtures do |path|
336
+ mkdir_p 'ignored_directory/subdirectory'
337
+
338
+ modified, added, removed = changes(path, :ignore => %r{^ignored_directory/}, :recursive => true) do
339
+ touch 'ignored_directory/new_file.rb'
340
+ touch 'ignored_directory/subdirectory/new_file.rb'
341
+ end
342
+
343
+ added.should be_empty
344
+ modified.should be_empty
345
+ removed.should be_empty
346
+ end
347
+ end
348
+ end
349
+ end
350
+ end
351
+
352
+ context 'when a file is modified' do
353
+ it 'detects the modified file' do
354
+ fixtures do |path|
355
+ touch 'existing_file.txt'
356
+
357
+ modified, added, removed = changes(path) do
358
+ sleep 1.5 # make a difference in the mtime of the file
359
+ touch 'existing_file.txt'
360
+ end
361
+
362
+ added.should be_empty
363
+ modified.should =~ %w(existing_file.txt)
364
+ removed.should be_empty
365
+ end
366
+ end
367
+
368
+ context 'during the same second at which we are checking for changes' do
369
+ before { ensure_same_second }
370
+
371
+ # The following test can only be run on systems that report
372
+ # modification times in milliseconds.
373
+ it 'always detects the modified file the first time', :if => described_class::HIGH_PRECISION_SUPPORTED do
374
+ fixtures do |path|
375
+ touch 'existing_file.txt'
376
+
377
+ modified, added, removed = changes(path) do
378
+ sleep 0.3 # make sure the mtime is changed a bit
379
+ touch 'existing_file.txt'
380
+ end
381
+
382
+ added.should be_empty
383
+ modified.should =~ %w(existing_file.txt)
384
+ removed.should be_empty
385
+ end
386
+ end
387
+
388
+ context '#27 - when a file is created and then checked for modifications at the same second' do
389
+ # This issue was the result of checking a file for content changes when
390
+ # the mtime and the checking time are the same. In this case there
391
+ # is no checksum saved, so the file was reported as being changed.
392
+ it ' does not report any changes' do
393
+ fixtures do |path|
394
+ touch 'a_file.rb'
395
+
396
+ modified, added, removed = changes(path)
397
+
398
+ added.should be_empty
399
+ modified.should be_empty
400
+ removed.should be_empty
401
+ end
402
+ end
403
+ end
404
+
405
+ it "doesn't detects the modified file the second time if the content haven't changed" do
406
+ fixtures do |path|
407
+ touch 'existing_file.txt'
408
+
409
+ changes(path) do
410
+ touch 'existing_file.txt'
411
+ end
412
+
413
+ modified, added, removed = changes(path, :use_last_record => true) do
414
+ touch 'existing_file.txt'
415
+ end
416
+
417
+ added.should be_empty
418
+ modified.should be_empty
419
+ removed.should be_empty
420
+ end
421
+ end
422
+
423
+ it 'detects the modified file the second time if the content have changed' do
424
+ fixtures do |path|
425
+ touch 'existing_file.txt'
426
+
427
+ changes(path) do
428
+ touch 'existing_file.txt'
429
+ end
430
+
431
+ modified, added, removed = changes(path, :use_last_record => true) do
432
+ open('existing_file.txt', 'w') { |f| f.write('foo') }
433
+ end
434
+
435
+ added.should be_empty
436
+ modified.should =~ %w(existing_file.txt)
437
+ removed.should be_empty
438
+ end
439
+ end
440
+ end
441
+
442
+ context 'given a hidden file' do
443
+ it 'detects the modified file' do
444
+ fixtures do |path|
445
+ touch '.hidden'
446
+
447
+ modified, added, removed = changes(path) do
448
+ small_time_difference
449
+ touch '.hidden'
450
+ end
451
+
452
+ added.should be_empty
453
+ modified.should =~ %w(.hidden)
454
+ removed.should be_empty
455
+ end
456
+ end
457
+ end
458
+
459
+ context 'given a file mode change' do
460
+ it 'does not detect the mode change' do
461
+ fixtures do |path|
462
+ touch 'run.rb'
463
+ sleep 1.5 # make a difference in the mtime of the file
464
+
465
+ modified, added, removed = changes(path) do
466
+ chmod 0777, 'run.rb'
467
+ end
468
+
469
+ added.should be_empty
470
+ modified.should be_empty
471
+ removed.should be_empty
472
+ end
473
+ end
474
+ end
475
+
476
+ context 'given an existing directory' do
477
+ context 'with recursive option set to true' do
478
+ it 'detects the modified file' do
479
+ fixtures do |path|
480
+ mkdir 'a_directory'
481
+ touch 'a_directory/existing_file.txt'
482
+
483
+ modified, added, removed = changes(path, :recursive => true) do
484
+ small_time_difference
485
+ touch 'a_directory/existing_file.txt'
486
+ end
487
+
488
+ added.should be_empty
489
+ modified.should =~ %w(a_directory/existing_file.txt)
490
+ removed.should be_empty
491
+ end
492
+ end
493
+ end
494
+
495
+ context 'with recursive option set to false' do
496
+ it "doesn't detects the modified file" do
497
+ fixtures do |path|
498
+ mkdir 'a_directory'
499
+ touch 'a_directory/existing_file.txt'
500
+
501
+ modified, added, removed = changes(path, :recursive => false) do
502
+ small_time_difference
503
+ touch 'a_directory/existing_file.txt'
504
+ end
505
+
506
+ added.should be_empty
507
+ modified.should be_empty
508
+ removed.should be_empty
509
+ end
510
+ end
511
+ end
512
+ end
513
+
514
+ context 'given a directory with subdirectories' do
515
+ it 'detects the modified file' do
516
+ fixtures do |path|
517
+ mkdir_p 'a_directory/subdirectory'
518
+ touch 'a_directory/subdirectory/existing_file.txt'
519
+
520
+ modified, added, removed = changes(path, :recursive => true) do
521
+ small_time_difference
522
+ touch 'a_directory/subdirectory/existing_file.txt'
523
+ end
524
+
525
+ added.should be_empty
526
+ modified.should =~ %w(a_directory/subdirectory/existing_file.txt)
527
+ removed.should be_empty
528
+ end
529
+ end
530
+
531
+ context 'with an ignored subdirectory' do
532
+ it "doesn't detect the modified files in neither the directory nor the subdirectory" do
533
+ fixtures do |path|
534
+ mkdir_p 'ignored_directory/subdirectory'
535
+ touch 'ignored_directory/existing_file.txt'
536
+ touch 'ignored_directory/subdirectory/existing_file.txt'
537
+
538
+ modified, added, removed = changes(path, :ignore => %r{^ignored_directory/}, :recursive => true) do
539
+ touch 'ignored_directory/existing_file.txt'
540
+ touch 'ignored_directory/subdirectory/existing_file.txt'
541
+ end
542
+
543
+ added.should be_empty
544
+ modified.should be_empty
545
+ removed.should be_empty
546
+ end
547
+ end
548
+ end
549
+ end
550
+ end
551
+
552
+ context 'when a file is moved' do
553
+ it 'detects the file movement' do
554
+ fixtures do |path|
555
+ touch 'move_me.txt'
556
+
557
+ modified, added, removed = changes(path) do
558
+ mv 'move_me.txt', 'new_name.txt'
559
+ end
560
+
561
+ added.should =~ %w(new_name.txt)
562
+ modified.should be_empty
563
+ removed.should =~ %w(move_me.txt)
564
+ end
565
+ end
566
+
567
+ context 'given an existing directory' do
568
+ context 'with recursive option set to true' do
569
+ it 'detects the file movement into the directory' do
570
+ fixtures do |path|
571
+ mkdir 'a_directory'
572
+ touch 'move_me.txt'
573
+
574
+ modified, added, removed = changes(path, :recursive => true) do
575
+ mv 'move_me.txt', 'a_directory/move_me.txt'
576
+ end
577
+
578
+ added.should =~ %w(a_directory/move_me.txt)
579
+ modified.should be_empty
580
+ removed.should =~ %w(move_me.txt)
581
+ end
582
+ end
583
+
584
+ it 'detects a file movement out of the directory' do
585
+ fixtures do |path|
586
+ mkdir 'a_directory'
587
+ touch 'a_directory/move_me.txt'
588
+
589
+ modified, added, removed = changes(path, :recursive => true) do
590
+ mv 'a_directory/move_me.txt', 'i_am_here.txt'
591
+ end
592
+
593
+ added.should =~ %w(i_am_here.txt)
594
+ modified.should be_empty
595
+ removed.should =~ %w(a_directory/move_me.txt)
596
+ end
597
+ end
598
+
599
+ it 'detects a file movement between two directories' do
600
+ fixtures do |path|
601
+ mkdir 'from_directory'
602
+ touch 'from_directory/move_me.txt'
603
+ mkdir 'to_directory'
604
+
605
+ modified, added, removed = changes(path, :recursive => true) do
606
+ mv 'from_directory/move_me.txt', 'to_directory/move_me.txt'
607
+ end
608
+
609
+ added.should =~ %w(to_directory/move_me.txt)
610
+ modified.should be_empty
611
+ removed.should =~ %w(from_directory/move_me.txt)
612
+ end
613
+ end
614
+ end
615
+
616
+ context 'with recursive option set to false' do
617
+ it "doesn't detect the file movement into the directory" do
618
+ fixtures do |path|
619
+ mkdir 'a_directory'
620
+ touch 'move_me.txt'
621
+
622
+ modified, added, removed = changes(path, :recursive => false) do
623
+ mv 'move_me.txt', 'a_directory/move_me.txt'
624
+ end
625
+
626
+ added.should be_empty
627
+ modified.should be_empty
628
+ removed.should =~ %w(move_me.txt)
629
+ end
630
+ end
631
+
632
+ it "doesn't detect a file movement out of the directory" do
633
+ fixtures do |path|
634
+ mkdir 'a_directory'
635
+ touch 'a_directory/move_me.txt'
636
+
637
+ modified, added, removed = changes(path, :recursive => false) do
638
+ mv 'a_directory/move_me.txt', 'i_am_here.txt'
639
+ end
640
+
641
+ added.should =~ %w(i_am_here.txt)
642
+ modified.should be_empty
643
+ removed.should be_empty
644
+ end
645
+ end
646
+
647
+ it "doesn't detect a file movement between two directories" do
648
+ fixtures do |path|
649
+ mkdir 'from_directory'
650
+ touch 'from_directory/move_me.txt'
651
+ mkdir 'to_directory'
652
+
653
+ modified, added, removed = changes(path, :recursive => false) do
654
+ mv 'from_directory/move_me.txt', 'to_directory/move_me.txt'
655
+ end
656
+
657
+ added.should be_empty
658
+ modified.should be_empty
659
+ removed.should be_empty
660
+ end
661
+ end
662
+
663
+ context 'given a directory with subdirectories' do
664
+ it 'detects a file movement between two subdirectories' do
665
+ fixtures do |path|
666
+ mkdir_p 'a_directory/subdirectory'
667
+ mkdir_p 'b_directory/subdirectory'
668
+ touch 'a_directory/subdirectory/move_me.txt'
669
+
670
+ modified, added, removed = changes(path, :recursive => true) do
671
+ mv 'a_directory/subdirectory/move_me.txt', 'b_directory/subdirectory'
672
+ end
673
+
674
+ added.should =~ %w(b_directory/subdirectory/move_me.txt)
675
+ modified.should be_empty
676
+ removed.should =~ %w(a_directory/subdirectory/move_me.txt)
677
+ end
678
+ end
679
+
680
+ context 'with an ignored subdirectory' do
681
+ it "doesn't detect the file movement between subdirectories" do
682
+ fixtures do |path|
683
+ mkdir_p 'a_ignored_directory/subdirectory'
684
+ mkdir_p 'b_ignored_directory/subdirectory'
685
+ touch 'a_ignored_directory/subdirectory/move_me.txt'
686
+
687
+ modified, added, removed = changes(path, :ignore => %r{^(?:a|b)_ignored_directory/}, :recursive => true) do
688
+ mv 'a_ignored_directory/subdirectory/move_me.txt', 'b_ignored_directory/subdirectory'
689
+ end
690
+
691
+ added.should be_empty
692
+ modified.should be_empty
693
+ removed.should be_empty
694
+ end
695
+ end
696
+ end
697
+ end
698
+
699
+ context 'with all paths passed as params' do
700
+ it 'detects the file movement into the directory' do
701
+ fixtures do |path|
702
+ mkdir 'a_directory'
703
+ touch 'move_me.txt'
704
+
705
+ modified, added, removed = changes(path, :recursive => false, :paths => [path, "#{path}/a_directory"]) do
706
+ mv 'move_me.txt', 'a_directory/move_me.txt'
707
+ end
708
+
709
+ added.should =~ %w(a_directory/move_me.txt)
710
+ modified.should be_empty
711
+ removed.should =~ %w(move_me.txt)
712
+ end
713
+ end
714
+
715
+ it 'detects a file moved outside of a directory' do
716
+ fixtures do |path|
717
+ mkdir 'a_directory'
718
+ touch 'a_directory/move_me.txt'
719
+
720
+ modified, added, removed = changes(path, :recursive => false, :paths => [path, "#{path}/a_directory"]) do
721
+ mv 'a_directory/move_me.txt', 'i_am_here.txt'
722
+ end
723
+
724
+ added.should =~ %w(i_am_here.txt)
725
+ modified.should be_empty
726
+ removed.should =~ %w(a_directory/move_me.txt)
727
+ end
728
+ end
729
+
730
+ it 'detects a file movement between two directories' do
731
+ fixtures do |path|
732
+ mkdir 'from_directory'
733
+ touch 'from_directory/move_me.txt'
734
+ mkdir 'to_directory'
735
+
736
+ modified, added, removed = changes(path, :recursive => false, :paths => [path, "#{path}/from_directory", "#{path}/to_directory"]) do
737
+ mv 'from_directory/move_me.txt', 'to_directory/move_me.txt'
738
+ end
739
+
740
+ added.should =~ %w(to_directory/move_me.txt)
741
+ modified.should be_empty
742
+ removed.should =~ %w(from_directory/move_me.txt)
743
+ end
744
+ end
745
+ end
746
+ end
747
+ end
748
+ end
749
+
750
+ context 'when a file is deleted' do
751
+ it 'detects the file removal' do
752
+ fixtures do |path|
753
+ touch 'unnecessary.txt'
754
+
755
+ modified, added, removed = changes(path) do
756
+ rm 'unnecessary.txt'
757
+ end
758
+
759
+ added.should be_empty
760
+ modified.should be_empty
761
+ removed.should =~ %w(unnecessary.txt)
762
+ end
763
+ end
764
+
765
+ it "deletes the file from the record" do
766
+ fixtures do |path|
767
+ touch 'unnecessary.txt'
768
+
769
+ changes(path) do
770
+ @record.paths[path]['unnecessary.txt'].should_not be_nil
771
+
772
+ rm 'unnecessary.txt'
773
+ end
774
+
775
+ @record.paths[path]['unnecessary.txt'].should be_nil
776
+ end
777
+ end
778
+
779
+ it "deletes the path from the paths checksums" do
780
+ fixtures do |path|
781
+ touch 'unnecessary.txt'
782
+
783
+ changes(path) do
784
+ @record.sha1_checksums["#{path}/unnecessary.txt"] = 'foo'
785
+
786
+ rm 'unnecessary.txt'
787
+ end
788
+
789
+ @record.sha1_checksums["#{path}/unnecessary.txt"].should be_nil
790
+ end
791
+ end
792
+
793
+ context 'given an existing directory' do
794
+ context 'with recursive option set to true' do
795
+ it 'detects the file removal' do
796
+ fixtures do |path|
797
+ mkdir 'a_directory'
798
+ touch 'a_directory/do_not_use.rb'
799
+
800
+ modified, added, removed = changes(path, :recursive => true) do
801
+ rm 'a_directory/do_not_use.rb'
802
+ end
803
+
804
+ added.should be_empty
805
+ modified.should be_empty
806
+ removed.should =~ %w(a_directory/do_not_use.rb)
807
+ end
808
+ end
809
+ end
810
+
811
+ context 'with recursive option set to false' do
812
+ it "doesn't detect the file removal" do
813
+ fixtures do |path|
814
+ mkdir 'a_directory'
815
+ touch 'a_directory/do_not_use.rb'
816
+
817
+ modified, added, removed = changes(path, :recursive => false) do
818
+ rm 'a_directory/do_not_use.rb'
819
+ end
820
+
821
+ added.should be_empty
822
+ modified.should be_empty
823
+ removed.should be_empty
824
+ end
825
+ end
826
+ end
827
+ end
828
+
829
+ context 'given a directory with subdirectories' do
830
+ it 'detects the file removal in subdirectories' do
831
+ fixtures do |path|
832
+ mkdir_p 'a_directory/subdirectory'
833
+ touch 'a_directory/subdirectory/do_not_use.rb'
834
+
835
+ modified, added, removed = changes(path, :recursive => true) do
836
+ rm 'a_directory/subdirectory/do_not_use.rb'
837
+ end
838
+
839
+ added.should be_empty
840
+ modified.should be_empty
841
+ removed.should =~ %w(a_directory/subdirectory/do_not_use.rb)
842
+ end
843
+ end
844
+
845
+ context 'with an ignored subdirectory' do
846
+ it "doesn't detect files removals in neither the directory nor its subdirectories" do
847
+ fixtures do |path|
848
+ mkdir_p 'ignored_directory/subdirectory'
849
+ touch 'ignored_directory/do_not_use.rb'
850
+ touch 'ignored_directory/subdirectory/do_not_use.rb'
851
+
852
+ modified, added, removed = changes(path, :ignore => %r{^ignored_directory/}, :recursive => true) do
853
+ rm 'ignored_directory/do_not_use.rb'
854
+ rm 'ignored_directory/subdirectory/do_not_use.rb'
855
+ end
856
+
857
+ added.should be_empty
858
+ modified.should be_empty
859
+ removed.should be_empty
860
+ end
861
+ end
862
+ end
863
+ end
864
+ end
865
+ end
866
+
867
+ context 'multiple file operations' do
868
+ it 'detects the added files' do
869
+ fixtures do |path|
870
+ modified, added, removed = changes(path) do
871
+ touch 'a_file.rb'
872
+ touch 'b_file.rb'
873
+ mkdir 'a_directory'
874
+ touch 'a_directory/a_file.rb'
875
+ touch 'a_directory/b_file.rb'
876
+ end
877
+
878
+ added.should =~ %w(a_file.rb b_file.rb a_directory/a_file.rb a_directory/b_file.rb)
879
+ modified.should be_empty
880
+ removed.should be_empty
881
+ end
882
+ end
883
+
884
+ it 'detects the modified files' do
885
+ fixtures do |path|
886
+ touch 'a_file.rb'
887
+ touch 'b_file.rb'
888
+ mkdir 'a_directory'
889
+ touch 'a_directory/a_file.rb'
890
+ touch 'a_directory/b_file.rb'
891
+
892
+ small_time_difference
893
+
894
+ modified, added, removed = changes(path) do
895
+ touch 'b_file.rb'
896
+ touch 'a_directory/a_file.rb'
897
+ end
898
+
899
+ added.should be_empty
900
+ modified.should =~ %w(b_file.rb a_directory/a_file.rb)
901
+ removed.should be_empty
902
+ end
903
+ end
904
+
905
+ it 'detects the removed files' do
906
+ fixtures do |path|
907
+ touch 'a_file.rb'
908
+ touch 'b_file.rb'
909
+ mkdir 'a_directory'
910
+ touch 'a_directory/a_file.rb'
911
+ touch 'a_directory/b_file.rb'
912
+
913
+ modified, added, removed = changes(path) do
914
+ rm 'b_file.rb'
915
+ rm 'a_directory/a_file.rb'
916
+ end
917
+
918
+ added.should be_empty
919
+ modified.should be_empty
920
+ removed.should =~ %w(b_file.rb a_directory/a_file.rb)
921
+ end
922
+ end
923
+ end
924
+
925
+ context 'single directory operations' do
926
+ it 'detects a moved directory' do
927
+ fixtures do |path|
928
+ mkdir 'a_directory'
929
+ touch 'a_directory/a_file.rb'
930
+ touch 'a_directory/b_file.rb'
931
+
932
+ modified, added, removed = changes(path) do
933
+ mv 'a_directory', 'renamed'
934
+ end
935
+
936
+ added.should =~ %w(renamed/a_file.rb renamed/b_file.rb)
937
+ modified.should be_empty
938
+ removed.should =~ %w(a_directory/a_file.rb a_directory/b_file.rb)
939
+ end
940
+ end
941
+
942
+ it 'detects a removed directory' do
943
+ fixtures do |path|
944
+ mkdir 'a_directory'
945
+ touch 'a_directory/a_file.rb'
946
+ touch 'a_directory/b_file.rb'
947
+
948
+ modified, added, removed = changes(path) do
949
+ rm_rf 'a_directory'
950
+ end
951
+
952
+ added.should be_empty
953
+ modified.should be_empty
954
+ removed.should =~ %w(a_directory/a_file.rb a_directory/b_file.rb)
955
+ end
956
+ end
957
+
958
+ it "deletes the directory from the record" do
959
+ fixtures do |path|
960
+ mkdir 'a_directory'
961
+ touch 'a_directory/file.rb'
962
+
963
+ changes(path) do
964
+ @record.paths.should have(2).paths
965
+ @record.paths[path]['a_directory'].should_not be_nil
966
+ @record.paths["#{path}/a_directory"]['file.rb'].should_not be_nil
967
+
968
+ rm_rf 'a_directory'
969
+ end
970
+
971
+ @record.paths.should have(1).paths
972
+ @record.paths[path]['a_directory'].should be_nil
973
+ @record.paths["#{path}/a_directory"]['file.rb'].should be_nil
974
+ end
975
+ end
976
+
977
+ context 'with nested paths' do
978
+ it 'detects removals without crashing - #18' do
979
+ fixtures do |path|
980
+ mkdir_p 'a_directory/subdirectory'
981
+ touch 'a_directory/subdirectory/do_not_use.rb'
982
+
983
+ modified, added, removed = changes(path) do
984
+ rm_r 'a_directory'
985
+ end
986
+
987
+ added.should be_empty
988
+ modified.should be_empty
989
+ removed.should =~ %w(a_directory/subdirectory/do_not_use.rb)
990
+ end
991
+ end
992
+ end
993
+ end
994
+
995
+ context 'with a path outside the directory for which a record is made' do
996
+ it "skips that path and doesn't check for changes" do
997
+ fixtures do |path|
998
+ modified, added, removed = changes(path, :paths => ['some/where/outside']) do
999
+ @record.should_not_receive(:detect_additions)
1000
+ @record.should_not_receive(:detect_modifications_and_removals)
1001
+
1002
+ touch 'new_file.rb'
1003
+ end
1004
+
1005
+ added.should be_empty
1006
+ modified.should be_empty
1007
+ removed.should be_empty
1008
+ end
1009
+ end
1010
+ end
1011
+
1012
+ context 'with the relative_paths option set to false' do
1013
+ it 'returns full paths in the changes hash' do
1014
+ fixtures do |path|
1015
+ touch 'a_file.rb'
1016
+ touch 'b_file.rb'
1017
+
1018
+ modified, added, removed = changes(path, :relative_paths => false) do
1019
+ small_time_difference
1020
+ rm 'a_file.rb'
1021
+ touch 'b_file.rb'
1022
+ touch 'c_file.rb'
1023
+ mkdir 'a_directory'
1024
+ touch 'a_directory/a_file.rb'
1025
+ end
1026
+
1027
+ added.should =~ ["#{path}/c_file.rb", "#{path}/a_directory/a_file.rb"]
1028
+ modified.should =~ ["#{path}/b_file.rb"]
1029
+ removed.should =~ ["#{path}/a_file.rb"]
1030
+ end
1031
+ end
1032
+ end
1033
+ end
1034
+ end