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
@@ -1,69 +1,7 @@
1
1
  module Middleman
2
2
 
3
- # Backwards compatibility namespace
4
- module Features
5
- end
6
-
7
- module CoreExtensions
8
- # File Change Notifier
9
- autoload :FileWatcher, "middleman-core/core_extensions/file_watcher"
10
-
11
- # In-memory Sitemap
12
- autoload :Sitemap, "middleman-core/core_extensions/sitemap"
13
-
14
- # Add Builder callbacks
15
- autoload :Builder, "middleman-core/core_extensions/builder"
16
-
17
- # Custom Feature API
18
- autoload :Extensions, "middleman-core/core_extensions/extensions"
19
-
20
- # Asset Path Pipeline
21
- autoload :Assets, "middleman-core/core_extensions/assets"
22
-
23
- # Data looks at the data/ folder for YAML files and makes them available
24
- # to dynamic requests.
25
- autoload :Data, "middleman-core/core_extensions/data"
26
-
27
- # Parse YAML from templates
28
- autoload :FrontMatter, "middleman-core/core_extensions/front_matter"
29
-
30
- # External helpers looks in the helpers/ folder for helper modules
31
- autoload :ExternalHelpers, "middleman-core/core_extensions/external_helpers"
32
-
33
- # DefaultHelpers are the built-in dynamic template helpers.
34
- autoload :DefaultHelpers, "middleman-core/core_extensions/default_helpers"
35
-
36
- # Extended version of Padrino's rendering
37
- autoload :Rendering, "middleman-core/core_extensions/rendering"
38
-
39
- # Pass custom options to views
40
- autoload :Routing, "middleman-core/core_extensions/routing"
41
-
42
- # Catch and show exceptions at the Rack level
43
- autoload :ShowExceptions, "middleman-core/core_extensions/show_exceptions"
44
-
45
- # i18n
46
- autoload :I18n, "middleman-core/core_extensions/i18n"
47
- end
48
-
49
3
  module Extensions
50
- # Provide Apache-style index.html files for directories
51
- autoload :DirectoryIndexes, "middleman-core/extensions/directory_indexes"
52
-
53
- # Lorem provides a handful of helpful prototyping methods to generate
54
- # words, paragraphs, fake images, names and email addresses.
55
- autoload :Lorem, "middleman-core/extensions/lorem"
56
-
57
- # AutomaticImageSizes inspects the images used in your dynamic templates
58
- # and automatically adds width and height attributes to their HTML
59
- # elements.
60
- autoload :AutomaticImageSizes, "middleman-core/extensions/automatic_image_sizes"
61
4
 
62
- # AssetHost allows you to setup multiple domains to host your static
63
- # assets. Calls to asset paths in dynamic templates will then rotate
64
- # through each of the asset servers to better spread the load.
65
- autoload :AssetHost, "middleman-core/extensions/asset_host"
66
-
67
5
  class << self
68
6
  def registered
69
7
  @_registered ||= {}
@@ -168,8 +106,8 @@ module Middleman
168
106
  # to discover extensions and Sprockets-supporting gems.
169
107
  #
170
108
  # @private
171
- # @param [Gem::Specification]
172
- # @param [String] Path to look for
109
+ # @param [Gem::Specification] spec
110
+ # @param [String] path Path to look for
173
111
  # @return [Boolean] Whether the file exists
174
112
  def spec_has_file?(spec, path)
175
113
  full_path = File.join(spec.full_gem_path, path)
@@ -0,0 +1,157 @@
1
+ module Middleman
2
+
3
+ WINDOWS = !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) unless const_defined?(:WINDOWS)
4
+
5
+ module PreviewServer
6
+
7
+ DEFAULT_PORT = 4567
8
+
9
+ class << self
10
+
11
+ # Start an instance of Middleman::Application
12
+ # @return [void]
13
+ def start(options={})
14
+ require "webrick"
15
+
16
+ app = ::Middleman::Application.server.inst do
17
+ if options[:environment]
18
+ set :environment, options[:environment]
19
+ end
20
+
21
+ if options[:debug]
22
+ set :logging, true
23
+ end
24
+ end
25
+
26
+ puts "== The Middleman is standing watch on port #{options[:port]||4567}"
27
+
28
+ @webrick ||= setup_webrick(
29
+ options[:host] || "0.0.0.0",
30
+ options[:port] || DEFAULT_PORT,
31
+ options[:debug] || false
32
+ )
33
+
34
+ mount_instance(app)
35
+
36
+ @initialized ||= false
37
+ unless @initialized
38
+ @initialized = true
39
+
40
+ register_signal_handlers unless ::Middleman::WINDOWS
41
+
42
+ start_file_watcher unless options[:"disable-watcher"]
43
+
44
+ @webrick.start
45
+ end
46
+ end
47
+
48
+ # Detach the current Middleman::Application instance
49
+ # @return [void]
50
+ def stop
51
+ puts "== The Middleman is shutting down"
52
+ unmount_instance
53
+ end
54
+
55
+ # Simply stop, then start the server
56
+ # @return [void]
57
+ def reload
58
+ stop
59
+ start
60
+ end
61
+
62
+ # Stop the current instance, exit Webrick
63
+ # @return [void]
64
+ def shutdown
65
+ stop
66
+ @webrick.shutdown
67
+ end
68
+
69
+ private
70
+
71
+ def start_file_watcher
72
+ # Watcher Library
73
+ require "listen"
74
+
75
+ listener = Listen.to(Dir.pwd, :relative_paths => true)
76
+
77
+ listener.change do |modified, added, removed|
78
+ added_and_modified = (modified + added)
79
+
80
+ if added_and_modified.length > 0
81
+ # See if the changed file is config.rb or lib/*.rb
82
+ return reload if needs_to_reload?(added_and_modified)
83
+
84
+ # Otherwise forward to Middleman
85
+ added_and_modified.each do |path|
86
+ @app.files.did_change(path)
87
+ end
88
+ end
89
+
90
+ if removed.length > 0
91
+ # See if the changed file is config.rb or lib/*.rb
92
+ return reload if needs_to_reload?(removed)
93
+
94
+ # Otherwise forward to Middleman
95
+ removed.each do |path|
96
+ @app.files.did_delete(path)
97
+ end
98
+ end
99
+ end
100
+
101
+ # Don't block this thread
102
+ listener.start(false)
103
+ end
104
+
105
+ # Trap the interupt signal and shut down smoothly
106
+ # @return [void]
107
+ def register_signal_handlers
108
+ trap("INT") { shutdown }
109
+ trap("TERM") { shutdown }
110
+ trap("QUIT") { shutdown }
111
+ end
112
+
113
+ # Initialize webrick
114
+ # @return [void]
115
+ def setup_webrick(host, port, is_logging)
116
+ @host = host
117
+ @port = port
118
+
119
+ http_opts = {
120
+ :BindAddress => @host,
121
+ :Port => @port,
122
+ :AccessLog => []
123
+ }
124
+
125
+ unless is_logging
126
+ http_opts[:Logger] = ::WEBrick::Log::new(nil, 0)
127
+ end
128
+
129
+ ::WEBrick::HTTPServer.new(http_opts)
130
+ end
131
+
132
+ # Attach a new Middleman::Application instance
133
+ # @param [Middleman::Application] app
134
+ # @return [void]
135
+ def mount_instance(app)
136
+ @app = app
137
+ @webrick.mount "/", ::Rack::Handler::WEBrick, @app.class.to_rack_app
138
+ end
139
+
140
+ # Detach the current Middleman::Application instance
141
+ # @return [void]
142
+ def unmount_instance
143
+ @webrick.unmount "/"
144
+ @app = nil
145
+ end
146
+
147
+ # Whether the passed files are config.rb, lib/*.rb or helpers
148
+ # @param [Array<String>] paths Array of paths to check
149
+ # @return [Boolean] Whether the server needs to reload
150
+ def needs_to_reload?(paths)
151
+ paths.any? do |path|
152
+ path.match(%{^config\.rb}) || path.match(%r{^lib/^[^\.](.*)\.rb$}) || path.match(%r{^helpers/^[^\.](.*)_helper\.rb$})
153
+ end
154
+ end
155
+ end
156
+ end
157
+ end
@@ -1,86 +1,91 @@
1
- module Middleman::Sitemap::Extensions
1
+ module Middleman
2
+
3
+ module Sitemap
4
+
5
+ module Extensions
2
6
 
3
- module Ignores
7
+ module Ignores
4
8
 
5
- # Setup extension
6
- class << self
9
+ # Setup extension
10
+ class << self
7
11
 
8
- # Once registered
9
- def registered(app)
10
- # Include methods
11
- app.send :include, InstanceMethods
12
+ # Once registered
13
+ def registered(app)
14
+ # Include methods
15
+ app.send :include, InstanceMethods
12
16
 
13
- ::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
14
- end
17
+ ::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
18
+ end
15
19
 
16
- alias :included :registered
17
- end
20
+ alias :included :registered
21
+ end
18
22
 
19
- module ResourceInstanceMethods
20
- def ignored?
21
- @app.ignore_manager.ignored?(path) ||
22
- (!proxy? &&
23
- @app.ignore_manager.ignored?(source_file.sub("#{@app.source_dir}/", ""))
24
- )
25
- end
26
- end
23
+ # Helpers methods for Resources
24
+ module ResourceInstanceMethods
25
+
26
+ # Whether the Resource is ignored
27
+ # @return [Boolean]
28
+ def ignored?
29
+ @app.ignore_manager.ignored?(path) ||
30
+ (!proxy? &&
31
+ @app.ignore_manager.ignored?(source_file.sub("#{@app.source_dir}/", ""))
32
+ )
33
+ end
34
+ end
27
35
 
28
- module InstanceMethods
29
- def ignore_manager
30
- @_ignore_manager ||= IgnoreManager.new(self)
31
- end
36
+ # Ignore-related instance methods
37
+ module InstanceMethods
38
+ def ignore_manager
39
+ @_ignore_manager ||= IgnoreManager.new(self)
40
+ end
32
41
 
33
- def ignore(*args, &block)
34
- ignore_manager.ignore(*args, &block)
35
- end
36
- end
42
+ # Ignore a path or add an ignore callback
43
+ # @param [String, Regexp] path Path glob expression, or path regex
44
+ # @return [void]
45
+ def ignore(path=nil, &block)
46
+ ignore_manager.ignore(path, &block)
47
+ end
48
+ end
37
49
 
38
- class IgnoreManager
39
- def initialize(app)
40
- @app = app
50
+ # Class to handle managing ignores
51
+ class IgnoreManager
52
+ def initialize(app)
53
+ @app = app
41
54
 
42
- @ignored_callbacks = []
43
- end
55
+ # Array of callbacks which can ass ignored
56
+ @ignored_callbacks = []
57
+ end
44
58
 
45
- # Ignore a path or add an ignore callback
46
- # @param [String, Regexp] path, path glob expression, or path regex
47
- # @return [void]
48
- def ignore(path=nil, &block)
49
- original_callback_size = @ignored_callbacks.size
59
+ # Ignore a path or add an ignore callback
60
+ # @param [String, Regexp] path Path glob expression, or path regex
61
+ # @return [void]
62
+ def ignore(path=nil, &block)
63
+ original_callback_size = @ignored_callbacks.size
50
64
 
51
- if path.is_a? Regexp
52
- @ignored_callbacks << Proc.new {|p| p =~ path }
53
- elsif path.is_a? String
54
- path_clean = ::Middleman::Util.normalize_path(path)
55
- if path_clean.include?("*") # It's a glob
56
- @ignored_callbacks << Proc.new {|p| File.fnmatch(path_clean, p) }
57
- else
58
- # Add a specific-path ignore unless that path is already covered
59
- @ignored_callbacks << Proc.new {|p| p == path_clean } unless ignored?(path_clean)
65
+ if path.is_a? Regexp
66
+ @ignored_callbacks << Proc.new {|p| p =~ path }
67
+ elsif path.is_a? String
68
+ path_clean = ::Middleman::Util.normalize_path(path)
69
+ if path_clean.include?("*") # It's a glob
70
+ @ignored_callbacks << Proc.new {|p| File.fnmatch(path_clean, p) }
71
+ else
72
+ # Add a specific-path ignore unless that path is already covered
73
+ @ignored_callbacks << Proc.new {|p| p == path_clean } unless ignored?(path_clean)
74
+ end
75
+ elsif block_given?
76
+ @ignored_callbacks << block
77
+ end
60
78
  end
61
- elsif block_given?
62
- @ignored_callbacks << block
63
- end
64
79
 
65
- if @ignored_callbacks.size > original_callback_size
66
- @app.sitemap.rebuild_resource_list!(:added_ignore_rule)
80
+ # Whether a path is ignored
81
+ # @param [String] path
82
+ # @return [Boolean]
83
+ def ignored?(path)
84
+ path_clean = ::Middleman::Util.normalize_path(path)
85
+ @ignored_callbacks.any? { |b| b.call(path_clean) }
86
+ end
67
87
  end
68
88
  end
69
-
70
- # Whether a path is ignored
71
- # @param [String] path
72
- # @return [Boolean]
73
- def ignored?(path)
74
- path_clean = ::Middleman::Util.normalize_path(path)
75
- @ignored_callbacks.any? { |b| b.call(path_clean) }
76
- end
77
-
78
- # Update the main sitemap resource list
79
- # @return [void]
80
- def manipulate_resource_list(resources)
81
- # No op
82
- resources
83
- end
84
89
  end
85
90
  end
86
- end
91
+ end
@@ -1,77 +1,84 @@
1
1
  require 'set'
2
2
 
3
- module Middleman::Sitemap::Extensions
4
- class OnDisk
3
+ module Middleman
4
+
5
+ module Sitemap
6
+
7
+ module Extensions
8
+
9
+ class OnDisk
5
10
 
6
- attr_accessor :sitemap
7
- attr_accessor :waiting_for_ready
11
+ attr_accessor :sitemap
12
+ attr_accessor :waiting_for_ready
8
13
 
9
- def initialize(sitemap)
10
- @sitemap = sitemap
11
- @app = @sitemap.app
14
+ def initialize(sitemap)
15
+ @sitemap = sitemap
16
+ @app = @sitemap.app
12
17
 
13
- @file_paths_on_disk = Set.new
18
+ @file_paths_on_disk = Set.new
14
19
 
15
- scoped_self = self
16
- @waiting_for_ready = true
20
+ scoped_self = self
21
+ @waiting_for_ready = true
17
22
 
18
- # Register file change callback
19
- @app.files.changed do |file|
20
- scoped_self.touch_file(file, !scoped_self.waiting_for_ready)
21
- end
23
+ # Register file change callback
24
+ @app.files.changed do |file|
25
+ scoped_self.touch_file(file, !scoped_self.waiting_for_ready)
26
+ end
22
27
 
23
- # Register file delete callback
24
- @app.files.deleted do |file|
25
- scoped_self.remove_file(file, !scoped_self.waiting_for_ready)
26
- end
28
+ # Register file delete callback
29
+ @app.files.deleted do |file|
30
+ scoped_self.remove_file(file, !scoped_self.waiting_for_ready)
31
+ end
27
32
 
28
- @app.ready do
29
- scoped_self.waiting_for_ready = false
30
- scoped_self.sitemap.rebuild_resource_list!(:on_disk_ready)
31
- end
32
- end
33
+ @app.ready do
34
+ scoped_self.waiting_for_ready = false
35
+ scoped_self.sitemap.rebuild_resource_list!(:on_disk_ready)
36
+ end
37
+ end
33
38
 
34
- # Update or add an on-disk file path
35
- # @param [String] file
36
- # @return [Boolean]
37
- def touch_file(file, rebuild=true)
38
- return false if file == @app.source_dir || File.directory?(file)
39
+ # Update or add an on-disk file path
40
+ # @param [String] file
41
+ # @return [Boolean]
42
+ def touch_file(file, rebuild=true)
43
+ return false if file == @app.source_dir || File.directory?(file)
39
44
 
40
- path = @sitemap.file_to_path(file)
41
- return false unless path
45
+ path = @sitemap.file_to_path(file)
46
+ return false unless path
42
47
 
43
- ignored = @app.ignored_sitemap_matchers.any? do |name, callback|
44
- callback.call(file, path)
45
- end
48
+ ignored = @app.ignored_sitemap_matchers.any? do |name, callback|
49
+ callback.call(file, path)
50
+ end
46
51
 
47
- @file_paths_on_disk << file unless ignored
52
+ @file_paths_on_disk << file unless ignored
48
53
 
49
- # Rebuild the sitemap any time a file is touched
50
- # in case one of the other manipulators
51
- # (like asset_hash) cares about the contents of this file,
52
- # whether or not it belongs in the sitemap (like a partial)
53
- @sitemap.rebuild_resource_list!(:touched_file) if rebuild
54
- end
54
+ # Rebuild the sitemap any time a file is touched
55
+ # in case one of the other manipulators
56
+ # (like asset_hash) cares about the contents of this file,
57
+ # whether or not it belongs in the sitemap (like a partial)
58
+ @sitemap.rebuild_resource_list!(:touched_file) if rebuild
59
+ end
55
60
 
56
- # Remove a file from the store
57
- # @param [String] file
58
- # @return [void]
59
- def remove_file(file, rebuild=true)
60
- if @file_paths_on_disk.delete?(file)
61
- @sitemap.rebuild_resource_list!(:removed_file) if rebuild
62
- end
63
- end
61
+ # Remove a file from the store
62
+ # @param [String] file
63
+ # @return [void]
64
+ def remove_file(file, rebuild=true)
65
+ if @file_paths_on_disk.delete?(file)
66
+ @sitemap.rebuild_resource_list!(:removed_file) if rebuild
67
+ end
68
+ end
64
69
 
65
- # Update the main sitemap resource list
66
- # @return [void]
67
- def manipulate_resource_list(resources)
68
- resources + @file_paths_on_disk.map do |file|
69
- ::Middleman::Sitemap::Resource.new(
70
- @sitemap,
71
- @sitemap.file_to_path(file),
72
- File.expand_path(file, @app.root)
73
- )
70
+ # Update the main sitemap resource list
71
+ # @return [void]
72
+ def manipulate_resource_list(resources)
73
+ resources + @file_paths_on_disk.map do |file|
74
+ ::Middleman::Sitemap::Resource.new(
75
+ @sitemap,
76
+ @sitemap.file_to_path(file),
77
+ File.expand_path(file, @app.root)
78
+ )
79
+ end
80
+ end
74
81
  end
75
82
  end
76
83
  end
77
- end
84
+ end