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,97 +1,108 @@
1
- module Middleman::Sitemap::Extensions
1
+ module Middleman
2
+
3
+ module Sitemap
4
+
5
+ module Extensions
2
6
 
3
- module Proxies
7
+ module Proxies
4
8
 
5
- # Setup extension
6
- class << self
9
+ # Setup extension
10
+ class << self
7
11
 
8
- # Once registered
9
- def registered(app)
10
- ::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
12
+ # Once registered
13
+ def registered(app)
14
+ ::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
11
15
 
12
- # Include methods
13
- app.send :include, InstanceMethods
14
- end
16
+ # Include methods
17
+ app.send :include, InstanceMethods
18
+ end
15
19
 
16
- alias :included :registered
17
- end
20
+ alias :included :registered
21
+ end
18
22
 
19
- module ResourceInstanceMethods
20
- # Whether this page is a proxy
21
- # @return [Boolean]
22
- def proxy?
23
- !!@proxied_to
24
- end
23
+ module ResourceInstanceMethods
24
+ # Whether this page is a proxy
25
+ # @return [Boolean]
26
+ def proxy?
27
+ !!@proxied_to
28
+ end
25
29
 
26
- # Set this page to proxy to a target path
27
- # @param [String] target
28
- # @return [void]
29
- def proxy_to(target)
30
- @proxied_to = target
31
- end
30
+ # Set this page to proxy to a target path
31
+ # @param [String] target
32
+ # @return [void]
33
+ def proxy_to(target)
34
+ @proxied_to = target
35
+ end
32
36
 
33
- # The path of the page this page is proxied to, or nil if it's not proxied.
34
- # @return [String]
35
- def proxied_to
36
- @proxied_to
37
- end
37
+ # The path of the page this page is proxied to, or nil if it's not proxied.
38
+ # @return [String]
39
+ def proxied_to
40
+ @proxied_to
41
+ end
38
42
 
39
- # Whether this page has a template file
40
- # @return [Boolean]
41
- def template?
42
- if proxy?
43
- store.find_resource_by_path(proxied_to).template?
44
- else
45
- super
46
- end
47
- end
43
+ # Whether this page has a template file
44
+ # @return [Boolean]
45
+ def template?
46
+ if proxy?
47
+ store.find_resource_by_path(proxied_to).template?
48
+ else
49
+ super
50
+ end
51
+ end
48
52
 
49
- def get_source_file
50
- if proxy?
51
- store.find_resource_by_path(proxied_to).source_file
53
+ def get_source_file
54
+ if proxy?
55
+ proxy_resource = store.find_resource_by_path(proxied_to)
56
+
57
+ unless proxy_resource
58
+ raise "Path #{path} proxies to unknown file #{proxied_to}"
59
+ end
60
+
61
+ proxy_resource.source_file
62
+ end
63
+ end
52
64
  end
53
- end
54
- end
55
65
 
56
- module InstanceMethods
57
- def proxy_manager
58
- @_proxy_manager ||= ProxyManager.new(self)
59
- end
66
+ module InstanceMethods
67
+ def proxy_manager
68
+ @_proxy_manager ||= ProxyManager.new(self)
69
+ end
60
70
 
61
- def proxy(*args)
62
- proxy_manager.proxy(*args)
63
- end
64
- end
71
+ def proxy(*args)
72
+ proxy_manager.proxy(*args)
73
+ end
74
+ end
65
75
 
66
- class ProxyManager
67
- def initialize(app)
68
- @app = app
76
+ class ProxyManager
77
+ def initialize(app)
78
+ @app = app
69
79
 
70
- @proxy_paths = {}
71
- end
80
+ @proxy_paths = {}
81
+ end
72
82
 
73
- # Setup a proxy from a path to a target
74
- # @param [String] path
75
- # @param [String] target
76
- # @return [void]
77
- def proxy(path, target)
78
- @proxy_paths[::Middleman::Util.normalize_path(path)] = ::Middleman::Util.normalize_path(target)
79
- @app.sitemap.rebuild_resource_list!(:added_proxy)
80
- end
83
+ # Setup a proxy from a path to a target
84
+ # @param [String] path
85
+ # @param [String] target
86
+ # @return [void]
87
+ def proxy(path, target)
88
+ @proxy_paths[::Middleman::Util.normalize_path(path)] = ::Middleman::Util.normalize_path(target)
89
+ @app.sitemap.rebuild_resource_list!(:added_proxy)
90
+ end
81
91
 
82
- # Update the main sitemap resource list
83
- # @return [void]
84
- def manipulate_resource_list(resources)
85
- resources + @proxy_paths.map do |key, value|
86
- p = ::Middleman::Sitemap::Resource.new(
87
- @app.sitemap,
88
- key
89
- )
90
- p.proxy_to(value)
91
- p
92
+ # Update the main sitemap resource list
93
+ # @return [void]
94
+ def manipulate_resource_list(resources)
95
+ resources + @proxy_paths.map do |key, value|
96
+ p = ::Middleman::Sitemap::Resource.new(
97
+ @app.sitemap,
98
+ key
99
+ )
100
+ p.proxy_to(value)
101
+ p
102
+ end
103
+ end
92
104
  end
93
105
  end
94
106
  end
95
107
  end
96
-
97
108
  end
@@ -1,77 +1,84 @@
1
- module Middleman::Sitemap::Extensions
2
- module Traversal
3
- # This resource's parent resource
4
- # @return [Middleman::Sitemap::Resource, nil]
5
- def parent
6
- parts = path.split("/")
7
- parts.pop if path.include?(app.index_file)
1
+ module Middleman
2
+
3
+ module Sitemap
4
+
5
+ module Extensions
6
+
7
+ module Traversal
8
+ # This resource's parent resource
9
+ # @return [Middleman::Sitemap::Resource, nil]
10
+ def parent
11
+ parts = path.split("/")
12
+ parts.pop if path.include?(app.index_file)
8
13
 
9
- return nil if parts.length < 1
14
+ return nil if parts.length < 1
10
15
 
11
- parts.pop
12
- parts << app.index_file
16
+ parts.pop
17
+ parts << app.index_file
13
18
 
14
- parent_path = "/" + parts.join("/")
19
+ parent_path = "/" + parts.join("/")
15
20
 
16
- store.find_resource_by_destination_path(parent_path)
17
- end
21
+ store.find_resource_by_destination_path(parent_path)
22
+ end
18
23
 
19
- # This resource's child resources
20
- # @return [Array<Middleman::Sitemap::Resource>]
21
- def children
22
- return [] unless directory_index?
24
+ # This resource's child resources
25
+ # @return [Array<Middleman::Sitemap::Resource>]
26
+ def children
27
+ return [] unless directory_index?
23
28
 
24
- if eponymous_directory?
25
- base_path = eponymous_directory_path
26
- prefix = %r|^#{base_path.sub("/", "\\/")}|
27
- else
28
- base_path = path.sub("#{app.index_file}", "")
29
- prefix = %r|^#{base_path.sub("/", "\\/")}|
30
- end
31
-
32
- store.resources.select do |sub_resource|
33
- if sub_resource.path == self.path || sub_resource.path !~ prefix
34
- false
35
- else
36
- inner_path = sub_resource.path.sub(prefix, "")
37
- parts = inner_path.split("/")
38
- if parts.length == 1
39
- true
40
- elsif parts.length == 2
41
- parts.last == app.index_file
29
+ if eponymous_directory?
30
+ base_path = eponymous_directory_path
31
+ prefix = %r|^#{base_path.sub("/", "\\/")}|
42
32
  else
43
- false
33
+ base_path = path.sub("#{app.index_file}", "")
34
+ prefix = %r|^#{base_path.sub("/", "\\/")}|
35
+ end
36
+
37
+ store.resources.select do |sub_resource|
38
+ if sub_resource.path == self.path || sub_resource.path !~ prefix
39
+ false
40
+ else
41
+ inner_path = sub_resource.path.sub(prefix, "")
42
+ parts = inner_path.split("/")
43
+ if parts.length == 1
44
+ true
45
+ elsif parts.length == 2
46
+ parts.last == app.index_file
47
+ else
48
+ false
49
+ end
50
+ end
44
51
  end
45
52
  end
46
- end
47
- end
48
53
 
49
- # This resource's sibling resources
50
- # @return [Array<Middleman::Sitemap::Resource>]
51
- def siblings
52
- return [] unless parent
53
- parent.children.reject { |p| p == self }
54
- end
54
+ # This resource's sibling resources
55
+ # @return [Array<Middleman::Sitemap::Resource>]
56
+ def siblings
57
+ return [] unless parent
58
+ parent.children.reject { |p| p == self }
59
+ end
55
60
 
56
- # Whether this resource either a directory index, or has the same name as an existing directory in the source
57
- # @return [Boolean]
58
- def directory_index?
59
- path.include?(app.index_file) || path =~ /\/$/ || eponymous_directory?
60
- end
61
+ # Whether this resource either a directory index, or has the same name as an existing directory in the source
62
+ # @return [Boolean]
63
+ def directory_index?
64
+ path.include?(app.index_file) || path =~ /\/$/ || eponymous_directory?
65
+ end
61
66
 
62
- # Whether the resource has the same name as a directory in the source
63
- # (e.g., if the resource is named 'gallery.html' and a path exists named 'gallery/', this would return true)
64
- # @return [Boolean]
65
- def eponymous_directory?
66
- full_path = File.join(app.source_dir, eponymous_directory_path)
67
- !!(File.exists?(full_path) && File.directory?(full_path))
68
- end
67
+ # Whether the resource has the same name as a directory in the source
68
+ # (e.g., if the resource is named 'gallery.html' and a path exists named 'gallery/', this would return true)
69
+ # @return [Boolean]
70
+ def eponymous_directory?
71
+ full_path = File.join(app.source_dir, eponymous_directory_path)
72
+ !!(File.exists?(full_path) && File.directory?(full_path))
73
+ end
69
74
 
70
- # The path for this resource if it were a directory, and not a file
71
- # (e.g., for 'gallery.html' this would return 'gallery/')
72
- # @return [String]
73
- def eponymous_directory_path
74
- path.sub(ext, '/').sub(/\/$/, "") + "/"
75
+ # The path for this resource if it were a directory, and not a file
76
+ # (e.g., for 'gallery.html' this would return 'gallery/')
77
+ # @return [String]
78
+ def eponymous_directory_path
79
+ path.sub(ext, '/').sub(/\/$/, "") + "/"
80
+ end
81
+ end
75
82
  end
76
83
  end
77
84
  end
@@ -1,126 +1,147 @@
1
- # Sitemap namespace
2
- module Middleman::Sitemap
1
+ require "middleman-core/sitemap/extensions/traversal"
2
+
3
+ module Middleman
4
+
5
+ # Sitemap namespace
6
+ module Sitemap
3
7
 
4
- # Sitemap Resource class
5
- class Resource
6
- include Middleman::Sitemap::Extensions::Traversal
8
+ # Sitemap Resource class
9
+ class Resource
10
+ include Middleman::Sitemap::Extensions::Traversal
7
11
 
8
- # @return [Middleman::Application]
9
- attr_reader :app
12
+ # @return [Middleman::Application]
13
+ attr_reader :app
10
14
 
11
- # @return [Middleman::Sitemap::Store]
12
- attr_reader :store
15
+ # @return [Middleman::Sitemap::Store]
16
+ attr_reader :store
13
17
 
14
- # The source path of this resource (relative to the source directory,
15
- # without template extensions)
16
- # @return [String]
17
- attr_reader :path
18
+ # The source path of this resource (relative to the source directory,
19
+ # without template extensions)
20
+ # @return [String]
21
+ attr_reader :path
18
22
 
19
- # Set the on-disk source file for this resource
20
- # @return [String]
21
- # attr_reader :source_file
23
+ # Set the on-disk source file for this resource
24
+ # @return [String]
25
+ # attr_reader :source_file
22
26
 
23
- def source_file
24
- @source_file || get_source_file
25
- end
27
+ def source_file
28
+ @source_file || get_source_file
29
+ end
26
30
 
27
- # Initialize resource with parent store and URL
28
- # @param [Middleman::Sitemap::Store] store
29
- # @param [String] path
30
- # @param [String] source_file
31
- def initialize(store, path, source_file=nil)
32
- @store = store
33
- @app = @store.app
34
- @path = path
35
- @source_file = source_file
31
+ # Initialize resource with parent store and URL
32
+ # @param [Middleman::Sitemap::Store] store
33
+ # @param [String] path
34
+ # @param [String] source_file
35
+ def initialize(store, path, source_file=nil)
36
+ @store = store
37
+ @app = @store.app
38
+ @path = path
39
+ @source_file = source_file
36
40
 
37
- @destination_paths = [@path]
38
- end
39
-
40
- # Whether this resource has a template file
41
- # @return [Boolean]
42
- def template?
43
- return false if source_file.nil?
44
- !::Tilt[source_file].nil?
45
- end
41
+ @destination_paths = [@path]
42
+
43
+ @local_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
44
+ end
46
45
 
47
- # Get the metadata for both the current source_file and the current path
48
- # @return [Hash]
49
- def metadata
50
- store.metadata_for_file(source_file).deep_merge(
51
- store.metadata_for_path(path)
52
- )
53
- end
46
+ # Whether this resource has a template file
47
+ # @return [Boolean]
48
+ def template?
49
+ return false if source_file.nil?
50
+ !::Tilt[source_file].nil?
51
+ end
54
52
 
55
- # Get the output/preview URL for this resource
56
- # @return [String]
57
- def destination_path
58
- @destination_paths.last
59
- end
53
+ # Get the metadata for both the current source_file and the current path
54
+ # @return [Hash]
55
+ def metadata
56
+ result = store.metadata_for_file(source_file).dup
57
+
58
+ path_meta = store.metadata_for_path(path).dup
59
+ if path_meta.has_key?(:blocks)
60
+ result[:blocks] << path_meta[:blocks]
61
+ path_meta.delete(:blocks)
62
+ end
63
+ result.deep_merge!(path_meta)
64
+
65
+ local_meta = @local_metadata.dup
66
+ if local_meta.has_key?(:blocks)
67
+ result[:blocks] << local_meta[:blocks]
68
+ local_meta.delete(:blocks)
69
+ end
70
+ result.deep_merge!(local_meta)
71
+
72
+ result
73
+ end
74
+
75
+ # Merge in new metadata specific to this resource.
76
+ # @param [Hash] metadata A metadata block like provides_metadata_for_path takes
77
+ def add_metadata(metadata={}, &block)
78
+ if metadata.has_key?(:blocks)
79
+ @local_metadata[:blocks] << metadata[:blocks]
80
+ metadata.delete(:blocks)
81
+ end
82
+ @local_metadata.deep_merge!(metadata)
83
+ @local_metadata[:blocks] << block if block_given?
84
+ end
60
85
 
61
- # Set the output/preview URL for this resource
62
- # @param [String] path
63
- # @return [void]
64
- def destination_path=(path)
65
- @destination_paths << path
66
- end
86
+ # Get the output/preview URL for this resource
87
+ # @return [String]
88
+ def destination_path
89
+ @destination_paths.last
90
+ end
67
91
 
68
- # The template instance
69
- # @return [Middleman::Sitemap::Template]
70
- def template
71
- @_template ||= ::Middleman::Sitemap::Template.new(self)
72
- end
92
+ # Set the output/preview URL for this resource
93
+ # @param [String] path
94
+ # @return [void]
95
+ def destination_path=(path)
96
+ @destination_paths << path
97
+ end
73
98
 
74
- # Extension of the path (i.e. '.js')
75
- # @return [String]
76
- def ext
77
- File.extname(path)
78
- end
99
+ # Extension of the path (i.e. '.js')
100
+ # @return [String]
101
+ def ext
102
+ File.extname(path)
103
+ end
79
104
 
80
- # Mime type of the path
81
- # @return [String]
82
- def mime_type
83
- app.mime_type ext
84
- end
105
+ # Mime type of the path
106
+ # @return [String]
107
+ def mime_type
108
+ app.mime_type ext
109
+ end
85
110
 
86
- # Render this resource
87
- # @return [String]
88
- def render(opts={}, locs={}, &block)
89
- return File.open(source_file).read unless template?
111
+ # Render this resource
112
+ # @return [String]
113
+ def render(opts={}, locs={}, &block)
114
+ return File.open(source_file).read unless template?
90
115
 
91
- puts "== Render Start: #{source_file}" if app.logging?
116
+ start_time = Time.now
117
+ puts "== Render Start: #{source_file}" if app.logging?
92
118
 
93
- md = metadata.dup
94
- opts = md[:options].deep_merge(opts)
95
- locs = md[:locals].deep_merge(locs)
119
+ md = metadata.dup
120
+ opts = md[:options].deep_merge(opts)
121
+ locs = md[:locals].deep_merge(locs)
96
122
 
97
- # Forward remaining data to helpers
98
- if md.has_key?(:page)
99
- app.data.store("page", md[:page])
100
- end
123
+ # Forward remaining data to helpers
124
+ if md.has_key?(:page)
125
+ app.data.store("page", md[:page])
126
+ end
101
127
 
102
- md[:blocks].flatten.compact.each do |block|
103
- app.instance_eval(&block)
104
- end
105
-
106
- app.instance_eval(&block) if block_given?
107
- result = app.render_template(source_file, locs, opts)
128
+ md[:blocks].flatten.compact.each do |block|
129
+ app.instance_eval(&block)
130
+ end
131
+
132
+ app.instance_eval(&block) if block_given?
133
+ result = app.render_template(source_file, locs, opts)
108
134
 
109
- puts "== Render End: #{source_file}" if app.logging?
110
- result
111
- end
135
+ puts "== Render End: #{source_file} (#{(Time.now - start_time).round(2)}s)" if app.logging?
136
+ result
137
+ end
112
138
 
113
- # A path without the directory index - so foo/index.html becomes
114
- # just foo. Best for linking.
115
- # @return [String]
116
- def url
117
- '/' + destination_path.sub(/#{Regexp.escape(app.index_file)}$/, '')
118
- end
119
-
120
- # Get the relative path from the source
121
- # @return [String]
122
- def relative_path
123
- source_file ? source_file.sub(app.source_dir, '') : nil
139
+ # A path without the directory index - so foo/index.html becomes
140
+ # just foo. Best for linking.
141
+ # @return [String]
142
+ def url
143
+ ('/' + destination_path).sub(/\/#{Regexp.escape(app.index_file)}$/, '/')
144
+ end
124
145
  end
125
146
  end
126
147
  end