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,12 +1,17 @@
1
- # Convenience methods to allow config.rb to talk to the Builder
2
- module Middleman::CoreExtensions::Builder
1
+ module Middleman
2
+ module CoreExtensions
3
+
4
+ # Convenience methods to allow config.rb to talk to the Builder
5
+ module Builder
3
6
 
4
- # Extension registered
5
- class << self
6
- # @private
7
- def registered(app)
8
- app.define_hook :after_build
7
+ # Extension registered
8
+ class << self
9
+ # @private
10
+ def registered(app)
11
+ app.define_hook :after_build
12
+ end
13
+ alias :included :registered
14
+ end
9
15
  end
10
- alias :included :registered
11
16
  end
12
- end
17
+ end
@@ -1,175 +1,180 @@
1
- # Data formats
2
- require "yaml"
3
- require "active_support/json"
4
-
5
- # The data extension parses YAML and JSON files in the data/ directory
6
- # and makes them available to config.rb, templates and extensions
7
- module Middleman::CoreExtensions::Data
8
-
9
- # Extension registered
10
- class << self
11
- # @private
12
- def registered(app)
13
- app.set :data_dir, "data"
14
- app.send :include, InstanceMethods
15
- end
16
- alias :included :registered
17
- end
1
+ module Middleman
2
+ module CoreExtensions
3
+
4
+ # The data extension parses YAML and JSON files in the data/ directory
5
+ # and makes them available to config.rb, templates and extensions
6
+ module Data
18
7
 
19
- # Instance methods
20
- module InstanceMethods
21
- # Setup data files before anything else so they are available when
22
- # parsing config.rb
23
- def initialize
24
- self.files.changed DataStore.matcher do |file|
25
- self.data.touch_file(file) if file.match(%r{^#{self.data_dir}\/})
8
+ # Extension registered
9
+ class << self
10
+ # @private
11
+ def registered(app)
12
+ # Data formats
13
+ require "yaml"
14
+ require "active_support/json"
15
+
16
+ app.set :data_dir, "data"
17
+ app.send :include, InstanceMethods
18
+ end
19
+ alias :included :registered
26
20
  end
21
+
22
+ # Instance methods
23
+ module InstanceMethods
24
+ # Setup data files before anything else so they are available when
25
+ # parsing config.rb
26
+ def initialize
27
+ self.files.changed DataStore.matcher do |file|
28
+ self.data.touch_file(file) if file.match(%r{^#{self.data_dir}\/})
29
+ end
27
30
 
28
- self.files.deleted DataStore.matcher do |file|
29
- self.data.remove_file(file) if file.match(%r{^#{self.data_dir}\/})
30
- end
31
+ self.files.deleted DataStore.matcher do |file|
32
+ self.data.remove_file(file) if file.match(%r{^#{self.data_dir}\/})
33
+ end
31
34
 
32
- super
33
- end
35
+ super
36
+ end
34
37
 
35
- # The data object
36
- #
37
- # @return [DataStore]
38
- def data
39
- @_data ||= DataStore.new(self)
40
- end
41
- end
38
+ # The data object
39
+ #
40
+ # @return [DataStore]
41
+ def data
42
+ @_data ||= DataStore.new(self)
43
+ end
44
+ end
42
45
 
43
- # The core logic behind the data extension.
44
- class DataStore
46
+ # The core logic behind the data extension.
47
+ class DataStore
45
48
 
46
- # Static methods
47
- class << self
49
+ # Static methods
50
+ class << self
48
51
 
49
- # The regex which tells Middleman which files are for data
50
- #
51
- # @return [Regexp]
52
- def matcher
53
- %r{[\w-]+\.(yml|yaml|json)$}
54
- end
55
- end
52
+ # The regex which tells Middleman which files are for data
53
+ #
54
+ # @return [Regexp]
55
+ def matcher
56
+ %r{[\w-]+\.(yml|yaml|json)$}
57
+ end
58
+ end
56
59
 
57
- # Store static data hash
58
- #
59
- # @param [Symbol] name Name of the data, used for namespacing
60
- # @param [Hash] content The content for this data
61
- # @return [void]
62
- def store(name=nil, content=nil)
63
- @_local_sources ||= {}
64
- @_local_sources[name.to_s] = content unless name.nil? || content.nil?
65
- @_local_sources
66
- end
60
+ # Store static data hash
61
+ #
62
+ # @param [Symbol] name Name of the data, used for namespacing
63
+ # @param [Hash] content The content for this data
64
+ # @return [void]
65
+ def store(name=nil, content=nil)
66
+ @_local_sources ||= {}
67
+ @_local_sources[name.to_s] = content unless name.nil? || content.nil?
68
+ @_local_sources
69
+ end
67
70
 
68
- # Store callback-based data
69
- #
70
- # @param [Symbol] name Name of the data, used for namespacing
71
- # @param [Proc] proc The callback which will return data
72
- # @return [void]
73
- def callbacks(name=nil, proc=nil)
74
- @_callback_sources ||= {}
75
- @_callback_sources[name.to_s] = proc unless name.nil? || proc.nil?
76
- @_callback_sources
77
- end
71
+ # Store callback-based data
72
+ #
73
+ # @param [Symbol] name Name of the data, used for namespacing
74
+ # @param [Proc] proc The callback which will return data
75
+ # @return [void]
76
+ def callbacks(name=nil, proc=nil)
77
+ @_callback_sources ||= {}
78
+ @_callback_sources[name.to_s] = proc unless name.nil? || proc.nil?
79
+ @_callback_sources
80
+ end
78
81
 
79
- # Setup data store
80
- #
81
- # @param [Middleman::Application] app The current instance of Middleman
82
- def initialize(app)
83
- @app = app
84
- @local_data = {}
85
- end
82
+ # Setup data store
83
+ #
84
+ # @param [Middleman::Application] app The current instance of Middleman
85
+ def initialize(app)
86
+ @app = app
87
+ @local_data = {}
88
+ end
86
89
 
87
- # Update the internal cache for a given file path
88
- #
89
- # @param [String] file The file to be re-parsed
90
- # @return [void]
91
- def touch_file(file)
92
- file = File.expand_path(file, @app.root)
93
- extension = File.extname(file)
94
- basename = File.basename(file, extension)
90
+ # Update the internal cache for a given file path
91
+ #
92
+ # @param [String] file The file to be re-parsed
93
+ # @return [void]
94
+ def touch_file(file)
95
+ file = File.expand_path(file, @app.root)
96
+ extension = File.extname(file)
97
+ basename = File.basename(file, extension)
95
98
 
96
- if %w(.yaml .yml).include?(extension)
97
- data = YAML.load_file(file)
98
- elsif extension == ".json"
99
- data = ActiveSupport::JSON.decode(File.read(file))
100
- else
101
- return
102
- end
99
+ if %w(.yaml .yml).include?(extension)
100
+ data = YAML.load_file(file)
101
+ elsif extension == ".json"
102
+ data = ActiveSupport::JSON.decode(File.read(file))
103
+ else
104
+ return
105
+ end
103
106
 
104
- @local_data[basename] = ::Middleman::Util.recursively_enhance(data)
105
- end
107
+ @local_data[basename] = ::Middleman::Util.recursively_enhance(data)
108
+ end
106
109
 
107
- # Remove a given file from the internal cache
108
- #
109
- # @param [String] file The file to be cleared
110
- # @return [void]
111
- def remove_file(file)
112
- extension = File.extname(file)
113
- basename = File.basename(file, extension)
114
- @local_data.delete(basename) if @local_data.has_key?(basename)
115
- end
110
+ # Remove a given file from the internal cache
111
+ #
112
+ # @param [String] file The file to be cleared
113
+ # @return [void]
114
+ def remove_file(file)
115
+ extension = File.extname(file)
116
+ basename = File.basename(file, extension)
117
+ @local_data.delete(basename) if @local_data.has_key?(basename)
118
+ end
116
119
 
117
- # Get a hash hash from either internal static data or a callback
118
- #
119
- # @param [String, Symbol] path The name of the data namespace
120
- # @return [Hash, nil]
121
- def data_for_path(path)
122
- response = nil
120
+ # Get a hash hash from either internal static data or a callback
121
+ #
122
+ # @param [String, Symbol] path The name of the data namespace
123
+ # @return [Hash, nil]
124
+ def data_for_path(path)
125
+ response = nil
123
126
 
124
- @@local_sources ||= {}
125
- @@callback_sources ||= {}
127
+ @@local_sources ||= {}
128
+ @@callback_sources ||= {}
126
129
 
127
- if self.store.has_key?(path.to_s)
128
- response = self.store[path.to_s]
129
- elsif self.callbacks.has_key?(path.to_s)
130
- response = self.callbacks[path.to_s].call()
131
- end
130
+ if self.store.has_key?(path.to_s)
131
+ response = self.store[path.to_s]
132
+ elsif self.callbacks.has_key?(path.to_s)
133
+ response = self.callbacks[path.to_s].call()
134
+ end
132
135
 
133
- response
134
- end
136
+ response
137
+ end
135
138
 
136
- # "Magically" find namespaces of data if they exist
137
- #
138
- # @param [String] path The namespace to search for
139
- # @return [Hash, nil]
140
- def method_missing(path)
141
- if @local_data.has_key?(path.to_s)
142
- return @local_data[path.to_s]
143
- else
144
- result = data_for_path(path)
139
+ # "Magically" find namespaces of data if they exist
140
+ #
141
+ # @param [String] path The namespace to search for
142
+ # @return [Hash, nil]
143
+ def method_missing(path)
144
+ if @local_data.has_key?(path.to_s)
145
+ return @local_data[path.to_s]
146
+ else
147
+ result = data_for_path(path)
145
148
 
146
- if result
147
- return ::Middleman::Util.recursively_enhance(result)
148
- end
149
- end
149
+ if result
150
+ return ::Middleman::Util.recursively_enhance(result)
151
+ end
152
+ end
150
153
 
151
- super
152
- end
154
+ super
155
+ end
153
156
 
154
- # Convert all the data into a static hash
155
- #
156
- # @return [Hash]
157
- def to_h
158
- data = {}
157
+ # Convert all the data into a static hash
158
+ #
159
+ # @return [Hash]
160
+ def to_h
161
+ data = {}
159
162
 
160
- self.store.each do |k, v|
161
- data[k] = data_for_path(k)
162
- end
163
+ self.store.each do |k, v|
164
+ data[k] = data_for_path(k)
165
+ end
163
166
 
164
- self.callbacks.each do |k, v|
165
- data[k] = data_for_path(k)
166
- end
167
+ self.callbacks.each do |k, v|
168
+ data[k] = data_for_path(k)
169
+ end
167
170
 
168
- (@local_data || {}).each do |k, v|
169
- data[k] = v
170
- end
171
+ (@local_data || {}).each do |k, v|
172
+ data[k] = v
173
+ end
171
174
 
172
- data
175
+ data
176
+ end
177
+ end
173
178
  end
174
179
  end
175
180
  end
@@ -1,110 +1,172 @@
1
- require 'middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers'
2
-
3
- # Built-in helpers
4
- module Middleman::CoreExtensions::DefaultHelpers
5
-
6
- # Extension registered
7
- class << self
8
- # @private
9
- def registered(app)
10
- app.helpers ::Padrino::Helpers::OutputHelpers
11
- app.helpers ::Padrino::Helpers::TagHelpers
12
- app.helpers ::Padrino::Helpers::AssetTagHelpers
13
- app.helpers ::Padrino::Helpers::FormHelpers
14
- app.helpers ::Padrino::Helpers::FormatHelpers
15
- app.helpers ::Padrino::Helpers::RenderHelpers
16
- app.helpers ::Padrino::Helpers::NumberHelpers
17
- # app.helpers ::Padrino::Helpers::TranslationHelpers
18
-
19
- app.helpers Helpers
20
-
21
- app.ready do
22
- ::I18n.load_path += Dir["#{File.dirname(__FILE__)}/../vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/*.yml"]
23
- end
24
- end
25
- alias :included :registered
26
- end
1
+ module Middleman
2
+ module CoreExtensions
3
+ # Built-in helpers
4
+ module DefaultHelpers
27
5
 
28
- # The helpers
29
- module Helpers
30
- # Output a stylesheet link tag based on the current path
31
- #
32
- # @param [String] separator How to break up path in parts
33
- # @return [String]
34
- def auto_stylesheet_link_tag(separator="/")
35
- auto_tag(:css, separator) do |path|
36
- stylesheet_link_tag path
37
- end
38
- end
6
+ # Extension registered
7
+ class << self
8
+ # @private
9
+ def registered(app)
10
+ require "active_support/core_ext/integer/inflections"
11
+ require 'padrino-helpers'
12
+
13
+ app.helpers ::Padrino::Helpers::OutputHelpers
14
+ app.helpers ::Padrino::Helpers::TagHelpers
15
+ app.helpers ::Padrino::Helpers::AssetTagHelpers
16
+ app.helpers ::Padrino::Helpers::FormHelpers
17
+ app.helpers ::Padrino::Helpers::FormatHelpers
18
+ app.helpers ::Padrino::Helpers::RenderHelpers
19
+ app.helpers ::Padrino::Helpers::NumberHelpers
20
+ # app.helpers ::Padrino::Helpers::TranslationHelpers
39
21
 
40
- # Output a javascript tag based on the current path
41
- #
42
- # @param [String] separator How to break up path in parts
43
- # @return [String]
44
- def auto_javascript_include_tag(separator="/")
45
- auto_tag(:js, separator) do |path|
46
- javascript_include_tag path
47
- end
48
- end
22
+ app.helpers Helpers
49
23
 
50
- # Output a stylesheet link tag based on the current path
51
- #
52
- # @param [Symbol] asset_ext The type of asset
53
- # @param [String] separator How to break up path in parts
54
- # @param [String] asset_dir Where to look for assets
55
- # @return [void]
56
- def auto_tag(asset_ext, separator="/", asset_dir=nil)
57
- if asset_dir.nil?
58
- asset_dir = case asset_ext
59
- when :js then js_dir
60
- when :css then css_dir
24
+ app.set :relative_links, false
61
25
  end
26
+ alias :included :registered
62
27
  end
63
28
 
64
- # If the basename of the request as no extension, assume we are serving a
65
- # directory and join index_file to the path.
66
- path = full_path(current_path.dup)
67
- path = path.sub(%r{^/}, '')
68
- path = path.gsub(File.extname(path), ".#{asset_ext}")
69
- path = path.gsub("/", separator)
29
+ # The helpers
30
+ module Helpers
31
+ # Output a stylesheet link tag based on the current path
32
+ #
33
+ # @param [String] separator How to break up path in parts
34
+ # @return [String]
35
+ def auto_stylesheet_link_tag(separator="/")
36
+ auto_tag(:css, separator) do |path|
37
+ stylesheet_link_tag path
38
+ end
39
+ end
70
40
 
71
- yield path if sitemap.find_resource_by_path(File.join(asset_dir, path))
72
- end
41
+ # Output a javascript tag based on the current path
42
+ #
43
+ # @param [String] separator How to break up path in parts
44
+ # @return [String]
45
+ def auto_javascript_include_tag(separator="/")
46
+ auto_tag(:js, separator) do |path|
47
+ javascript_include_tag path
48
+ end
49
+ end
73
50
 
74
- # Generate body css classes based on the current path
75
- #
76
- # @return [String]
77
- def page_classes
78
- path = current_path.dup
79
- path << index_file if path.match(%r{/$})
80
- path = path.gsub(%r{^/}, '')
51
+ # Output a stylesheet link tag based on the current path
52
+ #
53
+ # @param [Symbol] asset_ext The type of asset
54
+ # @param [String] separator How to break up path in parts
55
+ # @param [String] asset_dir Where to look for assets
56
+ # @return [void]
57
+ def auto_tag(asset_ext, separator="/", asset_dir=nil)
58
+ if asset_dir.nil?
59
+ asset_dir = case asset_ext
60
+ when :js then js_dir
61
+ when :css then css_dir
62
+ end
63
+ end
81
64
 
82
- classes = []
83
- parts = path.split('.')[0].split('/')
84
- parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
65
+ # If the basename of the request as no extension, assume we are serving a
66
+ # directory and join index_file to the path.
67
+ path = full_path(current_path.dup)
68
+ path = path.sub(%r{^/}, '')
69
+ path = path.gsub(File.extname(path), ".#{asset_ext}")
70
+ path = path.gsub("/", separator)
85
71
 
86
- classes.join(' ')
87
- end
72
+ yield path if sitemap.find_resource_by_path(File.join(asset_dir, path))
73
+ end
88
74
 
89
- # Get the path of a file of a given type
90
- #
91
- # @param [Symbol] kind The type of file
92
- # @param [String] source The path to the file
93
- # @return [String]
94
- def asset_path(kind, source)
95
- return source if source =~ /^http/
96
- asset_folder = case kind
97
- when :css then css_dir
98
- when :js then js_dir
99
- when :images then images_dir
100
- else kind.to_s
101
- end
102
- source = source.to_s.gsub(/\s/, '')
103
- ignore_extension = (kind == :images) # don't append extension
104
- source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/
105
- result_path = source if source =~ %r{^/} # absolute path
106
- result_path ||= asset_url(source, asset_folder)
107
- "#{result_path}"
108
- end
75
+ # Generate body css classes based on the current path
76
+ #
77
+ # @return [String]
78
+ def page_classes
79
+ path = current_path.dup
80
+ path << index_file if path.match(%r{/$})
81
+ path = path.gsub(%r{^/}, '')
82
+
83
+ classes = []
84
+ parts = path.split('.')[0].split('/')
85
+ parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
86
+
87
+ classes.join(' ')
88
+ end
89
+
90
+ # Get the path of a file of a given type
91
+ #
92
+ # @param [Symbol] kind The type of file
93
+ # @param [String] source The path to the file
94
+ # @return [String]
95
+ def asset_path(kind, source)
96
+ return source if source =~ /^http/
97
+ asset_folder = case kind
98
+ when :css then css_dir
99
+ when :js then js_dir
100
+ when :images then images_dir
101
+ else kind.to_s
102
+ end
103
+ source = source.to_s.gsub(/\s/, '')
104
+ ignore_extension = (kind == :images) # don't append extension
105
+ source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/
106
+ result_path = source if source =~ %r{^/} # absolute path
107
+ result_path ||= asset_url(source, asset_folder)
108
+ "#{result_path}"
109
+ end
110
+
111
+ # Overload the regular link_to to be sitemap-aware - if you
112
+ # reference a source path, either absolutely or relatively,
113
+ # you'll get that resource's nice URL. Also, there is a
114
+ # :relative option which, if set to true, will produce
115
+ # relative URLs instead of absolute URLs. You can also add
116
+ #
117
+ # set :relative_links, true
118
+ #
119
+ # to config.rb to have all links default to relative.
120
+ def link_to(*args, &block)
121
+ url_arg_index = block_given? ? 0 : 1
122
+ options_index = block_given? ? 1 : 2
123
+
124
+ if url = args[url_arg_index]
125
+ options = args[options_index] || {}
126
+ relative = options.delete(:relative)
127
+
128
+
129
+ if url.include? '://'
130
+ raise "Can't use the relative option with an external URL" if relative
131
+ else
132
+ # Handle relative urls
133
+ current_dir = Pathname('/' + current_resource.path).dirname
134
+ path = Pathname(url)
135
+
136
+ url = current_dir.join(path).to_s if path.relative?
137
+
138
+ resource = sitemap.find_resource_by_path(url)
139
+
140
+ # Allow people to turn on relative paths for all links with set :relative_links, true
141
+ # but still override on a case by case basis with the :relative parameter.
142
+ effective_relative = relative || false
143
+ if relative.nil? && relative_links
144
+ effective_relative = true
145
+ end
146
+
147
+ if resource
148
+ if effective_relative
149
+ resource_url = resource.url
150
+ new_url = Pathname(resource_url).relative_path_from(current_dir).to_s
151
+
152
+ # Put back the trailing slash to avoid unnecessary Apache redirects
153
+ if resource_url.end_with?('/') && !new_url.end_with?('/')
154
+ new_url << '/'
155
+ end
156
+ else
157
+ new_url = resource.url
158
+ end
159
+
160
+ args[url_arg_index] = new_url
161
+ else
162
+ raise "No resource exists at #{url}" if relative
163
+ end
164
+ end
165
+ end
166
+
167
+ super(*args, &block)
168
+ end
169
+ end
170
+ end
109
171
  end
110
172
  end