middleman-core 3.0.0.beta.2 → 3.0.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. data/features/cli_extension.feature +13 -0
  2. data/features/{cli.feature → cli_init.feature} +1 -10
  3. data/features/directory_index.feature +29 -1
  4. data/features/dynamic_pages.feature +1 -0
  5. data/features/extensionless_text_files.feature +0 -2
  6. data/features/front-matter.feature +17 -1
  7. data/features/frontmatter_page_settings.feature +16 -1
  8. data/features/helpers_relative_link_to.feature +68 -0
  9. data/features/unicode_filenames.feature +14 -0
  10. data/fixtures/csspie/config.rb +0 -0
  11. data/fixtures/csspie/source/stylesheets/PIE.htc +96 -0
  12. data/fixtures/dynamic-pages-app/config.rb +3 -0
  13. data/fixtures/frontmatter-app/source/front-matter-auto.erb +6 -0
  14. data/fixtures/frontmatter-app/source/front-matter.html.erb +2 -0
  15. data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +7 -0
  16. data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +6 -0
  17. data/fixtures/frontmatter-app/source/json-front-matter.html.erb +6 -0
  18. data/fixtures/unicode-filenames-app/config.rb +1 -0
  19. data/fixtures/unicode-filenames-app/source/snowmen-rule-/342/230/203.html +4 -0
  20. data/lib/middleman-core/application.rb +43 -335
  21. data/lib/middleman-core/cli/build.rb +11 -4
  22. data/lib/middleman-core/cli/bundler.rb +40 -0
  23. data/lib/middleman-core/cli/extension.rb +36 -0
  24. data/lib/middleman-core/cli/server.rb +2 -2
  25. data/lib/middleman-core/cli.rb +2 -6
  26. data/lib/middleman-core/core_extensions/assets.rb +35 -31
  27. data/lib/middleman-core/core_extensions/builder.rb +14 -9
  28. data/lib/middleman-core/core_extensions/data.rb +150 -145
  29. data/lib/middleman-core/core_extensions/default_helpers.rb +159 -97
  30. data/lib/middleman-core/core_extensions/extensions.rb +103 -97
  31. data/lib/middleman-core/core_extensions/external_helpers.rb +27 -23
  32. data/lib/middleman-core/core_extensions/file_watcher.rb +140 -110
  33. data/lib/middleman-core/core_extensions/front_matter.rb +155 -175
  34. data/lib/middleman-core/core_extensions/i18n.rb +111 -102
  35. data/lib/middleman-core/core_extensions/rendering.rb +293 -295
  36. data/lib/middleman-core/core_extensions/request.rb +338 -0
  37. data/lib/middleman-core/core_extensions/routing.rb +72 -68
  38. data/lib/middleman-core/core_extensions/show_exceptions.rb +23 -18
  39. data/lib/middleman-core/core_extensions.rb +39 -0
  40. data/lib/middleman-core/extensions/directory_indexes.rb +1 -4
  41. data/lib/middleman-core/extensions/lorem.rb +10 -3
  42. data/lib/middleman-core/extensions.rb +2 -64
  43. data/lib/middleman-core/preview_server.rb +157 -0
  44. data/lib/middleman-core/sitemap/extensions/ignores.rb +73 -68
  45. data/lib/middleman-core/sitemap/extensions/on_disk.rb +65 -58
  46. data/lib/middleman-core/sitemap/extensions/proxies.rb +86 -75
  47. data/lib/middleman-core/sitemap/extensions/traversal.rb +68 -61
  48. data/lib/middleman-core/sitemap/resource.rb +123 -102
  49. data/lib/middleman-core/sitemap/store.rb +170 -149
  50. data/lib/middleman-core/sitemap.rb +57 -57
  51. data/lib/middleman-core/step_definitions/server_steps.rb +13 -3
  52. data/lib/middleman-core/templates/extension/Gemfile +4 -0
  53. data/lib/middleman-core/templates/extension/Rakefile +12 -0
  54. data/lib/middleman-core/templates/extension/features/support/env.rb +4 -0
  55. data/lib/middleman-core/templates/extension/gemspec +24 -0
  56. data/lib/middleman-core/templates/extension/lib/lib.rb +49 -0
  57. data/lib/middleman-core/templates/extension/lib/middleman_extension.rb +1 -0
  58. data/lib/middleman-core/templates/shared/gitignore +14 -0
  59. data/lib/middleman-core/templates.rb +14 -8
  60. data/lib/middleman-core/util.rb +31 -9
  61. data/lib/middleman-core/version.rb +1 -1
  62. data/lib/middleman-core.rb +6 -4
  63. data/middleman-core.gemspec +4 -6
  64. metadata +62 -203
  65. data/lib/middleman-core/vendor/padrino-core-0.10.6/.document +0 -5
  66. data/lib/middleman-core/vendor/padrino-core-0.10.6/.gitignore +0 -22
  67. data/lib/middleman-core/vendor/padrino-core-0.10.6/.yardopts +0 -1
  68. data/lib/middleman-core/vendor/padrino-core-0.10.6/LICENSE.txt +0 -20
  69. data/lib/middleman-core/vendor/padrino-core-0.10.6/README.rdoc +0 -294
  70. data/lib/middleman-core/vendor/padrino-core-0.10.6/Rakefile +0 -5
  71. data/lib/middleman-core/vendor/padrino-core-0.10.6/bin/padrino +0 -9
  72. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/rendering.rb +0 -292
  73. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/routing.rb +0 -943
  74. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/showexceptions.rb +0 -20
  75. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application.rb +0 -269
  76. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/caller.rb +0 -53
  77. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/adapter.rb +0 -24
  78. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/base.rb +0 -150
  79. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/console.rb +0 -20
  80. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake.rb +0 -24
  81. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake_tasks.rb +0 -59
  82. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/command.rb +0 -38
  83. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/404.png +0 -0
  84. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/500.png +0 -0
  85. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/loader.rb +0 -211
  86. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/cs.yml +0 -34
  87. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/da.yml +0 -34
  88. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/de.yml +0 -34
  89. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/en.yml +0 -34
  90. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/es.yml +0 -34
  91. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/fr.yml +0 -34
  92. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/hu.yml +0 -34
  93. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/it.yml +0 -40
  94. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ja.yml +0 -34
  95. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/lv.yml +0 -34
  96. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/nl.yml +0 -34
  97. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/no.yml +0 -35
  98. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pl.yml +0 -34
  99. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pt_br.yml +0 -40
  100. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ru.yml +0 -35
  101. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/tr.yml +0 -34
  102. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/uk.yml +0 -34
  103. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_cn.yml +0 -34
  104. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_tw.yml +0 -34
  105. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/logger.rb +0 -428
  106. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/mounter.rb +0 -224
  107. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/reloader.rb +0 -254
  108. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/router.rb +0 -98
  109. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/server.rb +0 -79
  110. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/support_lite.rb +0 -199
  111. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/tasks.rb +0 -21
  112. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/version.rb +0 -20
  113. data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core.rb +0 -152
  114. data/lib/middleman-core/vendor/padrino-core-0.10.6/padrino-core.gemspec +0 -38
  115. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.components +0 -6
  116. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.gitignore +0 -7
  117. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/complex.rb +0 -32
  118. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/simple.rb +0 -33
  119. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/a.rb +0 -9
  120. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/b.rb +0 -4
  121. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/c.rb +0 -1
  122. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/e.rb +0 -13
  123. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/f.rb +0 -2
  124. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/g.rb +0 -2
  125. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/d.rb +0 -4
  126. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/helper.rb +0 -83
  127. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/mini_shoulda.rb +0 -45
  128. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_application.rb +0 -108
  129. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_core.rb +0 -77
  130. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_dependencies.rb +0 -44
  131. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_filters.rb +0 -278
  132. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_locale.rb +0 -21
  133. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_logger.rb +0 -154
  134. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_mounter.rb +0 -177
  135. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_complex.rb +0 -75
  136. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_simple.rb +0 -98
  137. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_rendering.rb +0 -461
  138. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_restful_routing.rb +0 -33
  139. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_router.rb +0 -146
  140. data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_routing.rb +0 -1680
  141. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.document +0 -5
  142. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.gitignore +0 -21
  143. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.yardopts +0 -1
  144. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/LICENSE.txt +0 -20
  145. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/README.rdoc +0 -239
  146. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/Rakefile +0 -5
  147. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/asset_tag_helpers.rb +0 -417
  148. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/abstract_form_builder.rb +0 -251
  149. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -43
  150. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_helpers.rb +0 -787
  151. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/format_helpers.rb +0 -381
  152. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/cs.yml +0 -103
  153. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/da.yml +0 -91
  154. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/de.yml +0 -81
  155. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/en.yml +0 -103
  156. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/es.yml +0 -103
  157. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/fr.yml +0 -80
  158. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/hu.yml +0 -103
  159. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/it.yml +0 -89
  160. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ja.yml +0 -103
  161. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/lv.yml +0 -103
  162. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/nl.yml +0 -82
  163. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/no.yml +0 -91
  164. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pl.yml +0 -95
  165. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pt_br.yml +0 -103
  166. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ru.yml +0 -103
  167. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/tr.yml +0 -103
  168. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/uk.yml +0 -103
  169. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_cn.yml +0 -104
  170. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_tw.yml +0 -103
  171. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/number_helpers.rb +0 -288
  172. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -98
  173. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/erb_handler.rb +0 -79
  174. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -63
  175. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/slim_handler.rb +0 -81
  176. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers.rb +0 -175
  177. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/render_helpers.rb +0 -60
  178. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/tag_helpers.rb +0 -260
  179. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/translation_helpers.rb +0 -38
  180. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers.rb +0 -59
  181. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/padrino-helpers.gemspec +0 -27
  182. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/app.rb +0 -73
  183. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.erb +0 -14
  184. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.haml +0 -12
  185. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.slim +0 -13
  186. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.erb +0 -14
  187. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.haml +0 -12
  188. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.slim +0 -12
  189. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.erb +0 -11
  190. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.haml +0 -9
  191. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.slim +0 -9
  192. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.erb +0 -5
  193. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.haml +0 -5
  194. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.slim +0 -5
  195. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.erb +0 -20
  196. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.haml +0 -15
  197. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.slim +0 -15
  198. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.erb +0 -72
  199. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.haml +0 -59
  200. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.slim +0 -59
  201. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.erb +0 -86
  202. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.haml +0 -70
  203. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.slim +0 -70
  204. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.erb +0 -5
  205. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.haml +0 -4
  206. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.slim +0 -4
  207. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.erb +0 -3
  208. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.haml +0 -3
  209. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.slim +0 -3
  210. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.erb +0 -3
  211. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.haml +0 -3
  212. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.slim +0 -3
  213. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_erb.erb +0 -1
  214. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_haml.haml +0 -1
  215. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
  216. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.erb +0 -1
  217. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.haml +0 -1
  218. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.slim +0 -1
  219. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/app.rb +0 -50
  220. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engine.haml +0 -5
  221. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_erb.erb +0 -1
  222. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_haml.haml +0 -1
  223. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_slim.slim +0 -1
  224. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/erb/test.erb +0 -1
  225. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/explicit_engine.haml +0 -5
  226. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/haml/test.haml +0 -1
  227. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/_user.haml +0 -7
  228. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/haml_template.haml +0 -1
  229. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/some_template.haml +0 -2
  230. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/helper.rb +0 -66
  231. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_asset_tag_helpers.rb +0 -328
  232. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_builder.rb +0 -1106
  233. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_helpers.rb +0 -770
  234. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_format_helpers.rb +0 -227
  235. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_locale.rb +0 -20
  236. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_number_helpers.rb +0 -139
  237. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_output_helpers.rb +0 -153
  238. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_render_helpers.rb +0 -76
  239. data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_tag_helpers.rb +0 -106
  240. data/lib/middleman-core/watcher.rb +0 -196
@@ -28,124 +28,130 @@
28
28
  # methods to use in your views. Some modify the output on-the-fly. And some
29
29
  # apply computationally-intensive changes to your final build files.
30
30
 
31
- # Using for version parsing
32
- require "rubygems"
33
-
34
31
  # Namespace extensions module
35
- module Middleman::CoreExtensions::Extensions
32
+ module Middleman
33
+ module CoreExtensions
34
+ module Extensions
36
35
 
37
- # Register extension
38
- class << self
39
- # @private
40
- def included(app)
41
- # app.set :default_extensions, []
42
- app.define_hook :after_configuration
43
- app.define_hook :before_configuration
44
- app.define_hook :build_config
45
- app.define_hook :development_config
36
+ # Register extension
37
+ class << self
38
+ # @private
39
+ def registered(app)
40
+ # Using for version parsing
41
+ require "rubygems"
42
+
43
+ # app.set :default_extensions, []
44
+ app.define_hook :after_configuration
45
+ app.define_hook :before_configuration
46
+ app.define_hook :build_config
47
+ app.define_hook :development_config
46
48
 
47
- app.extend ClassMethods
48
- app.send :include, InstanceMethods
49
- app.delegate :configure, :to => :"self.class"
50
- end
51
- end
49
+ app.extend ClassMethods
50
+ app.send :include, InstanceMethods
51
+ app.delegate :configure, :to => :"self.class"
52
+ end
53
+ alias :included :registered
54
+ end
52
55
 
53
- # Class methods
54
- module ClassMethods
55
- # Add a callback to run in a specific environment
56
- #
57
- # @param [String, Symbol] env The environment to run in
58
- # @return [void]
59
- def configure(env, &block)
60
- send("#{env}_config", &block)
61
- end
56
+ # Class methods
57
+ module ClassMethods
58
+ # Add a callback to run in a specific environment
59
+ #
60
+ # @param [String, Symbol] env The environment to run in
61
+ # @return [void]
62
+ def configure(env, &block)
63
+ send("#{env}_config", &block)
64
+ end
62
65
 
63
- # Alias `extensions` to access registered extensions
64
- #
65
- # @return [Array<Module]
66
- def extensions
67
- @extensions ||= []
68
- end
66
+ # Alias `extensions` to access registered extensions
67
+ #
68
+ # @return [Array<Module>]
69
+ def extensions
70
+ @extensions ||= []
71
+ end
69
72
 
70
- # Register a new extension
71
- #
72
- # @param [Array<Module>] new_extensions Extension modules to register
73
- # @return [Array<Module]
74
- def register(extension, options={}, &block)
75
- @extensions ||= []
76
- @extensions += [extension]
73
+ # Register a new extension
74
+ #
75
+ # @param [Module] extension Extension modules to register
76
+ # @param [Hash] options Per-extension options hash
77
+ # @return [void]
78
+ def register(extension, options={}, &block)
79
+ @extensions ||= []
80
+ @extensions += [extension]
77
81
 
78
- extend extension
79
- if extension.respond_to?(:registered)
80
- if extension.method(:registered).arity === 1
81
- extension.registered(self, &block)
82
- else
83
- extension.registered(self, options, &block)
82
+ extend extension
83
+ if extension.respond_to?(:registered)
84
+ if extension.method(:registered).arity === 1
85
+ extension.registered(self, &block)
86
+ else
87
+ extension.registered(self, options, &block)
88
+ end
89
+ end
84
90
  end
85
91
  end
86
- end
87
- end
88
92
 
89
- # Instance methods
90
- module InstanceMethods
91
- # This method is available in the project's `config.rb`.
92
- # It takes a underscore-separated symbol, finds the appropriate
93
- # feature module and includes it.
94
- #
95
- # activate :lorem
96
- #
97
- # @param [Symbol, Module] ext Which extension to activate
98
- # @return [void]
99
- def activate(ext, options={}, &block)
100
- # Make :i18n a no-op
101
- return if ext == :i18n
93
+ # Instance methods
94
+ module InstanceMethods
95
+ # This method is available in the project's `config.rb`.
96
+ # It takes a underscore-separated symbol, finds the appropriate
97
+ # feature module and includes it.
98
+ #
99
+ # activate :lorem
100
+ #
101
+ # @param [Symbol, Module] ext Which extension to activate
102
+ # @return [void]
103
+ def activate(ext, options={}, &block)
104
+ # Make :i18n a no-op
105
+ return if ext == :i18n
102
106
 
103
- ext_module = if ext.is_a?(Module)
104
- ext
105
- else
106
- ::Middleman::Extensions.load(ext.to_sym)
107
- end
107
+ ext_module = if ext.is_a?(Module)
108
+ ext
109
+ else
110
+ ::Middleman::Extensions.load(ext.to_sym)
111
+ end
108
112
 
109
- if ext_module.nil?
110
- puts "== Unknown Extension: #{ext}"
111
- else
112
- puts "== Activating: #{ext}" if logging?
113
- self.class.register(ext_module, options, &block)
114
- end
115
- end
113
+ if ext_module.nil?
114
+ puts "== Unknown Extension: #{ext}"
115
+ else
116
+ puts "== Activating: #{ext}" if logging?
117
+ self.class.register(ext_module, options, &block)
118
+ end
119
+ end
116
120
 
117
- # Load features before starting server
118
- def initialize
119
- super
121
+ # Load features before starting server
122
+ def initialize
123
+ super
120
124
 
121
- self.class.inst = self
122
- run_hook :before_configuration
125
+ self.class.inst = self
126
+ run_hook :before_configuration
123
127
 
124
- # Search the root of the project for required files
125
- $LOAD_PATH.unshift(root)
128
+ # Search the root of the project for required files
129
+ $LOAD_PATH.unshift(root)
126
130
 
127
- # Check for and evaluate local configuration
128
- local_config = File.join(root, "config.rb")
129
- if File.exists? local_config
130
- puts "== Reading: Local config" if logging?
131
- instance_eval File.read(local_config), local_config, 1
132
- end
131
+ # Check for and evaluate local configuration
132
+ local_config = File.join(root, "config.rb")
133
+ if File.exists? local_config
134
+ puts "== Reading: Local config" if logging?
135
+ instance_eval File.read(local_config), local_config, 1
136
+ end
133
137
 
134
- run_hook :build_config if build?
135
- run_hook :development_config if development?
138
+ run_hook :build_config if build?
139
+ run_hook :development_config if development?
136
140
 
137
- run_hook :after_configuration
141
+ run_hook :after_configuration
138
142
 
139
- # Add in defaults
140
- default_extensions.each do |ext|
141
- activate ext
142
- end
143
+ # Add in defaults
144
+ default_extensions.each do |ext|
145
+ activate ext
146
+ end
143
147
 
144
- if logging?
145
- self.class.extensions.each do |ext|
146
- puts "== Extension: #{ext}"
148
+ if logging?
149
+ self.class.extensions.each do |ext|
150
+ puts "== Extension: #{ext}"
151
+ end
152
+ end
147
153
  end
148
154
  end
149
155
  end
150
156
  end
151
- end
157
+ end
@@ -1,35 +1,39 @@
1
1
  # Load helpers in helpers/
2
- module Middleman::CoreExtensions::ExternalHelpers
2
+ module Middleman
3
+ module CoreExtensions
4
+ module ExternalHelpers
3
5
 
4
- # Setup extension
5
- class << self
6
+ # Setup extension
7
+ class << self
6
8
 
7
- # once registered
8
- def registered(app)
9
- # Setup a default helpers paths
10
- app.set :helpers_dir, "helpers"
11
- app.set :helpers_filename_glob, "**/*_helper.rb"
12
- app.set :helpers_filename_to_module_name_proc, Proc.new { |filename|
13
- basename = File.basename(filename, File.extname(filename))
14
- basename.camelcase
15
- }
9
+ # once registered
10
+ def registered(app)
11
+ # Setup a default helpers paths
12
+ app.set :helpers_dir, "helpers"
13
+ app.set :helpers_filename_glob, "**/*_helper.rb"
14
+ app.set :helpers_filename_to_module_name_proc, Proc.new { |filename|
15
+ basename = File.basename(filename, File.extname(filename))
16
+ basename.camelcase
17
+ }
16
18
 
17
- # After config
18
- app.after_configuration do
19
- helpers_path = File.expand_path(helpers_dir, root)
20
- next unless File.exists?(helpers_path)
19
+ # After config
20
+ app.after_configuration do
21
+ helpers_path = File.expand_path(helpers_dir, root)
22
+ next unless File.exists?(helpers_path)
21
23
 
22
- Dir[File.join(helpers_path, helpers_filename_glob)].each do |filename|
23
- module_name = helpers_filename_to_module_name_proc.call(filename)
24
- next unless module_name
24
+ Dir[File.join(helpers_path, helpers_filename_glob)].each do |filename|
25
+ module_name = helpers_filename_to_module_name_proc.call(filename)
26
+ next unless module_name
25
27
 
26
- require filename
27
- next unless Object.const_defined?(module_name.to_sym)
28
+ require filename
29
+ next unless Object.const_defined?(module_name.to_sym)
28
30
 
29
- helpers Object.const_get(module_name.to_sym)
31
+ helpers Object.const_get(module_name.to_sym)
32
+ end
33
+ end
30
34
  end
35
+ alias :included :registered
31
36
  end
32
37
  end
33
- alias :included :registered
34
38
  end
35
39
  end
@@ -1,135 +1,165 @@
1
1
  require "find"
2
- require "middleman-core/watcher"
3
2
  require "set"
4
3
 
5
4
  # API for watching file change events
6
- module Middleman::CoreExtensions::FileWatcher
5
+ module Middleman
6
+ module CoreExtensions
7
+ module FileWatcher
7
8
 
8
- # Setup extension
9
- class << self
9
+ IGNORE_LIST = [
10
+ /^\.sass-cache\//,
11
+ /^\.git\//,
12
+ /^\.gitignore$/,
13
+ /^\.DS_Store$/,
14
+ /^build\//,
15
+ /^\.rbenv-.*$/,
16
+ /^Gemfile$/,
17
+ /^Gemfile\.lock$/,
18
+ /~$/
19
+ ]
20
+
21
+ # Setup extension
22
+ class << self
10
23
 
11
- # Once registered
12
- def registered(app)
13
- app.extend ClassMethods
14
- app.send :include, InstanceMethods
24
+ # Once registered
25
+ def registered(app)
26
+ app.extend ClassMethods
27
+ app.send :include, InstanceMethods
15
28
 
16
- # Before parsing config, load the data/ directory
17
- app.before_configuration do
18
- data_path = File.join(self.root, self.data_dir)
19
- self.files.reload_path(data_path) if File.exists?(data_path)
20
- end
29
+ # Before parsing config, load the data/ directory
30
+ app.before_configuration do
31
+ data_path = File.join(root, data_dir)
32
+ files.reload_path(data_path) if File.exists?(data_path)
33
+ end
21
34
 
22
- # After config, load everything else
23
- app.ready do
24
- self.files.reload_path(self.root)
35
+ # After config, load everything else
36
+ app.ready do
37
+ files.reload_path(root)
38
+ end
39
+ end
40
+ alias :included :registered
25
41
  end
26
- end
27
- alias :included :registered
28
- end
29
42
 
30
- # Class methods
31
- module ClassMethods
43
+ # Class methods
44
+ module ClassMethods
32
45
 
33
- # Access the file api
34
- # @return [Middleman::CoreExtensions::FileWatcher::API]
35
- def files
36
- @_files_api ||= API.new
37
- end
38
- end
46
+ # Access the file api
47
+ # @return [Middleman::CoreExtensions::FileWatcher::API]
48
+ def files
49
+ @_files_api ||= API.new
50
+ end
51
+ end
39
52
 
40
- # Instance methods
41
- module InstanceMethods
53
+ # Instance methods
54
+ module InstanceMethods
42
55
 
43
- # Access the file api
44
- # @return [Middleman::CoreExtensions::FileWatcher::API]
45
- def files
46
- api = self.class.files
47
- api.instance ||= self
48
- api
49
- end
50
- end
56
+ # Access the file api
57
+ # @return [Middleman::CoreExtensions::FileWatcher::API]
58
+ def files
59
+ @_files_api ||= API.new(self)
60
+ end
61
+ end
51
62
 
52
- # Core File Change API class
53
- class API
54
- attr_accessor :instance, :known_paths
63
+ # Core File Change API class
64
+ class API
65
+
66
+ # Initialize api and internal path cache
67
+ def initialize(app)
68
+ @app = app
69
+ @known_paths = Set.new
70
+
71
+ @_changed = []
72
+ @_deleted = []
73
+ end
55
74
 
56
- # Initialize api and internal path cache
57
- def initialize
58
- self.known_paths = Set.new
59
- end
75
+ # Add callback to be run on file change
76
+ #
77
+ # @param [nil,Regexp] matcher A Regexp to match the change path against
78
+ # @return [Array<Proc>]
79
+ def changed(matcher=nil, &block)
80
+ @_changed << [block, matcher] if block_given?
81
+ @_changed
82
+ end
60
83
 
61
- # Add callback to be run on file change
62
- #
63
- # @param [nil,Regexp] matcher A Regexp to match the change path against
64
- # @return [Array<Proc>]
65
- def changed(matcher=nil, &block)
66
- @_changed ||= []
67
- @_changed << [block, matcher] if block_given?
68
- @_changed
69
- end
70
-
71
- # Add callback to be run on file deletion
72
- #
73
- # @param [nil,Regexp] matcher A Regexp to match the deleted path against
74
- # @return [Array<Proc>]
75
- def deleted(matcher=nil, &block)
76
- @_deleted ||= []
77
- @_deleted << [block, matcher] if block_given?
78
- @_deleted
79
- end
84
+ # Add callback to be run on file deletion
85
+ #
86
+ # @param [nil,Regexp] matcher A Regexp to match the deleted path against
87
+ # @return [Array<Proc>]
88
+ def deleted(matcher=nil, &block)
89
+ @_deleted << [block, matcher] if block_given?
90
+ @_deleted
91
+ end
80
92
 
81
- # Notify callbacks that a file changed
82
- #
83
- # @param [String] path The file that changed
84
- # @return [void]
85
- def did_change(path)
86
- puts "== File Change: #{path}" if instance.logging? && !::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
87
- self.known_paths << path
88
- self.run_callbacks(path, :changed)
89
- end
93
+ # Notify callbacks that a file changed
94
+ #
95
+ # @param [String] path The file that changed
96
+ # @return [void]
97
+ def did_change(path)
98
+ return if IGNORE_LIST.any? { |r| path.match(r) }
99
+ puts "== File Change: #{path}" if @app.logging?
100
+ @known_paths << path
101
+ self.run_callbacks(path, :changed)
102
+ end
90
103
 
91
- # Notify callbacks that a file was deleted
92
- #
93
- # @param [String] path The file that was deleted
94
- # @return [void]
95
- def did_delete(path)
96
- puts "== File Deletion: #{path}" if instance.logging? && !::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
97
- self.known_paths.delete(path)
98
- self.run_callbacks(path, :deleted)
99
- end
104
+ # Notify callbacks that a file was deleted
105
+ #
106
+ # @param [String] path The file that was deleted
107
+ # @return [void]
108
+ def did_delete(path)
109
+ return if IGNORE_LIST.any? { |r| path.match(r) }
110
+ puts "== File Deletion: #{path}" if @app.logging?
111
+ @known_paths.delete(path)
112
+ self.run_callbacks(path, :deleted)
113
+ end
100
114
 
101
- # Manually trigger update events
102
- #
103
- # @param [String] path The path to reload
104
- # @return [void]
105
- def reload_path(path)
106
- subset = self.known_paths.select { |p| p.match(%r{^#{path}}) }
115
+ # Manually trigger update events
116
+ #
117
+ # @param [String] path The path to reload
118
+ # @return [void]
119
+ def reload_path(path)
120
+ relative_path = path.sub("#{@app.root}/", "")
121
+ subset = @known_paths.select { |p| p.match(%r{^#{relative_path}}) }
107
122
 
108
- Find.find(path) do |path|
109
- next if File.directory?(path)
110
- relative_path = path.sub("#{self.instance.root}/", "")
111
- subset.delete(relative_path) if subset.include?(relative_path)
112
- self.did_change(relative_path)
113
- end if File.exists?(path)
123
+ Find.find(path) do |path|
124
+ next if File.directory?(path)
125
+ relative_path = path.sub("#{@app.root}/", "")
126
+ subset.delete(relative_path)
127
+ self.did_change(relative_path)
128
+ end if File.exists?(path)
114
129
 
115
- subset.each do |removed_path|
116
- self.did_delete(removed_path)
117
- end
118
- end
119
-
120
- protected
121
- # Notify callbacks for a file given an array of callbacks
122
- #
123
- # @param [String] path The file that was changed
124
- # @param [Symbol] callbacks_name The name of the callbacks method
125
- # @return [void]
126
- def run_callbacks(path, callbacks_name)
127
- return if ::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
130
+ subset.each do |removed_path|
131
+ self.did_delete(removed_path)
132
+ end
133
+ end
128
134
 
129
- self.send(callbacks_name).each do |callback, matcher|
130
- next if path.match(%r{^#{self.instance.build_dir}/})
131
- next unless matcher.nil? || path.match(matcher)
132
- self.instance.instance_exec(path, &callback)
135
+ # Like reload_path, but only triggers events on new files
136
+ #
137
+ # @param [String] path The path to reload
138
+ # @return [void]
139
+ def find_new_files(path)
140
+ relative_path = path.sub("#{@app.root}/", "")
141
+ subset = @known_paths.select { |p| p.match(%r{^#{relative_path}}) }
142
+
143
+ Find.find(path) do |file|
144
+ next if File.directory?(file)
145
+ relative_path = file.sub("#{@app.root}/", "")
146
+ self.did_change(relative_path) unless subset.include?(relative_path)
147
+ end if File.exists?(path)
148
+ end
149
+
150
+ protected
151
+ # Notify callbacks for a file given an array of callbacks
152
+ #
153
+ # @param [String] path The file that was changed
154
+ # @param [Symbol] callbacks_name The name of the callbacks method
155
+ # @return [void]
156
+ def run_callbacks(path, callbacks_name)
157
+ self.send(callbacks_name).each do |callback, matcher|
158
+ next if path.match(%r{^#{@app.build_dir}/})
159
+ next unless matcher.nil? || path.match(matcher)
160
+ @app.instance_exec(path, &callback)
161
+ end
162
+ end
133
163
  end
134
164
  end
135
165
  end