middleman 2.0.16.1 → 3.0.0.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. data/.gitignore +2 -1
  2. data/CHANGELOG +16 -8
  3. data/features/builder.feature +2 -5
  4. data/features/cache_buster.feature +1 -1
  5. data/features/clean_build.feature +0 -1
  6. data/features/coffee-script.feature +3 -3
  7. data/features/custom_layout_engines.feature +10 -0
  8. data/features/directory_index.feature +0 -1
  9. data/features/dynamic_pages.feature +0 -1
  10. data/features/fonts.feature +0 -1
  11. data/features/{padrino_helpers.feature → former_padrino_helpers.feature} +1 -1
  12. data/features/sprockets.feature +34 -5
  13. data/features/sprockets_gems.feature +7 -4
  14. data/features/step_definitions/asset_host_steps.rb +7 -6
  15. data/features/step_definitions/builder_steps.rb +4 -0
  16. data/features/step_definitions/middleman_steps.rb +22 -16
  17. data/features/step_definitions/page_layout_steps.rb +10 -8
  18. data/fixtures/custom-layout-app/config.rb +1 -0
  19. data/fixtures/custom-layout-app/source/index.html.erb +1 -0
  20. data/fixtures/custom-layout-app/source/layout.haml +6 -0
  21. data/fixtures/sprockets-app/config.rb +2 -1
  22. data/fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss +1 -0
  23. data/fixtures/sprockets-app/source/library/css/plain.css +3 -0
  24. data/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss +1 -0
  25. data/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss +1 -0
  26. data/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss +1 -0
  27. data/fixtures/sprockets-app/source/{jquery_include.js → library/js/jquery_include.js} +0 -0
  28. data/fixtures/sprockets-app/source/library/js/plain.js +3 -0
  29. data/fixtures/sprockets-app/source/library/{javascripts → js}/sprockets_base.js +0 -0
  30. data/fixtures/sprockets-app/source/library/{javascripts → js}/sprockets_sub.js +0 -0
  31. data/fixtures/test-app/config.rb +5 -4
  32. data/fixtures/test-app/source/{padrino_test.html.haml → former_padrino_test.html.haml} +0 -0
  33. data/fixtures/test-app/source/stylesheets/sprockets_base1.css.scss +1 -0
  34. data/fixtures/test-app/source/stylesheets/sprockets_base2.css.scss +1 -0
  35. data/fixtures/test-app/source/stylesheets/sprockets_sub.css.scss +1 -0
  36. data/lib/middleman.rb +27 -25
  37. data/lib/middleman/base.rb +408 -166
  38. data/lib/middleman/builder.rb +78 -162
  39. data/lib/middleman/cli.rb +61 -32
  40. data/lib/middleman/core_extensions/assets.rb +4 -44
  41. data/lib/middleman/core_extensions/builder.rb +12 -16
  42. data/lib/middleman/core_extensions/compass.rb +28 -57
  43. data/lib/middleman/core_extensions/data.rb +65 -49
  44. data/lib/middleman/core_extensions/default_helpers.rb +33 -18
  45. data/lib/middleman/core_extensions/features.rb +48 -26
  46. data/lib/middleman/core_extensions/file_watcher.rb +66 -0
  47. data/lib/middleman/core_extensions/front_matter.rb +91 -86
  48. data/lib/middleman/core_extensions/rendering.rb +9 -8
  49. data/lib/middleman/core_extensions/routing.rb +19 -53
  50. data/lib/middleman/core_extensions/sitemap.rb +229 -0
  51. data/lib/middleman/core_extensions/sprockets.rb +53 -37
  52. data/lib/middleman/features/asset_host.rb +20 -10
  53. data/lib/middleman/features/automatic_image_sizes.rb +12 -9
  54. data/lib/middleman/features/cache_buster.rb +38 -25
  55. data/lib/middleman/features/directory_indexes.rb +31 -28
  56. data/lib/middleman/features/minify_css.rb +3 -2
  57. data/lib/middleman/features/minify_css/cssmin.rb +55 -0
  58. data/lib/middleman/features/minify_javascript.rb +12 -5
  59. data/lib/middleman/features/relative_assets.rb +28 -25
  60. data/lib/middleman/features/sitemap_tree.rb +34 -0
  61. data/lib/middleman/guard.rb +57 -23
  62. data/lib/middleman/renderers/erb.rb +29 -0
  63. data/lib/middleman/renderers/liquid.rb +3 -12
  64. data/lib/middleman/renderers/markdown.rb +16 -15
  65. data/lib/middleman/renderers/sass.rb +34 -38
  66. data/lib/middleman/vendor/hooks-0.2.0/CHANGES.textile +9 -0
  67. data/lib/middleman/vendor/hooks-0.2.0/Gemfile +3 -0
  68. data/lib/middleman/vendor/hooks-0.2.0/README.rdoc +107 -0
  69. data/lib/middleman/vendor/hooks-0.2.0/Rakefile +12 -0
  70. data/lib/middleman/vendor/hooks-0.2.0/hooks.gemspec +22 -0
  71. data/lib/middleman/vendor/hooks-0.2.0/lib/hooks.rb +109 -0
  72. data/lib/middleman/vendor/hooks-0.2.0/lib/hooks/inheritable_attribute.rb +33 -0
  73. data/lib/middleman/vendor/hooks-0.2.0/test/hooks_test.rb +141 -0
  74. data/lib/middleman/vendor/hooks-0.2.0/test/inheritable_attribute_test.rb +55 -0
  75. data/lib/middleman/vendor/hooks-0.2.0/test/test_helper.rb +10 -0
  76. data/lib/middleman/vendor/padrino-core-0.10.5/.document +5 -0
  77. data/lib/middleman/vendor/padrino-core-0.10.5/.gitignore +22 -0
  78. data/lib/middleman/vendor/padrino-core-0.10.5/.yardopts +1 -0
  79. data/lib/middleman/vendor/padrino-core-0.10.5/LICENSE.txt +20 -0
  80. data/lib/middleman/vendor/padrino-core-0.10.5/README.rdoc +294 -0
  81. data/lib/middleman/vendor/padrino-core-0.10.5/Rakefile +5 -0
  82. data/lib/middleman/vendor/padrino-core-0.10.5/bin/padrino +9 -0
  83. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core.rb +167 -0
  84. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application.rb +270 -0
  85. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/rendering.rb +292 -0
  86. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/routing.rb +934 -0
  87. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/showexceptions.rb +20 -0
  88. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/caller.rb +53 -0
  89. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/adapter.rb +24 -0
  90. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/base.rb +151 -0
  91. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/console.rb +20 -0
  92. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake.rb +24 -0
  93. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake_tasks.rb +59 -0
  94. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/command.rb +38 -0
  95. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/images/404.png +0 -0
  96. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/images/500.png +0 -0
  97. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/loader.rb +210 -0
  98. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/cs.yml +34 -0
  99. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/da.yml +34 -0
  100. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/de.yml +34 -0
  101. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/en.yml +34 -0
  102. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/es.yml +34 -0
  103. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/fr.yml +34 -0
  104. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/hu.yml +34 -0
  105. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/it.yml +40 -0
  106. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ja.yml +34 -0
  107. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/lv.yml +34 -0
  108. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/nl.yml +34 -0
  109. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/no.yml +35 -0
  110. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pl.yml +34 -0
  111. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pt_br.yml +40 -0
  112. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ru.yml +35 -0
  113. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/tr.yml +34 -0
  114. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/uk.yml +34 -0
  115. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_cn.yml +34 -0
  116. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_tw.yml +34 -0
  117. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/logger.rb +345 -0
  118. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/mounter.rb +224 -0
  119. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/reloader.rb +254 -0
  120. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/router.rb +98 -0
  121. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/server.rb +79 -0
  122. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite.rb +199 -0
  123. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/tasks.rb +21 -0
  124. data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/version.rb +20 -0
  125. data/lib/middleman/vendor/padrino-core-0.10.5/padrino-core.gemspec +38 -0
  126. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/.components +6 -0
  127. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/.gitignore +7 -0
  128. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/complex.rb +32 -0
  129. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/simple.rb +33 -0
  130. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/a.rb +9 -0
  131. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/b.rb +4 -0
  132. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/c.rb +1 -0
  133. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/e.rb +13 -0
  134. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/f.rb +2 -0
  135. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/g.rb +2 -0
  136. data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/d.rb +4 -0
  137. data/lib/middleman/vendor/padrino-core-0.10.5/test/helper.rb +81 -0
  138. data/lib/middleman/vendor/padrino-core-0.10.5/test/mini_shoulda.rb +45 -0
  139. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_application.rb +108 -0
  140. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_core.rb +79 -0
  141. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_dependencies.rb +44 -0
  142. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_filters.rb +278 -0
  143. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_locale.rb +21 -0
  144. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_logger.rb +100 -0
  145. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_mounter.rb +177 -0
  146. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_reloader_complex.rb +75 -0
  147. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_reloader_simple.rb +98 -0
  148. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_rendering.rb +461 -0
  149. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_restful_routing.rb +33 -0
  150. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_router.rb +146 -0
  151. data/lib/middleman/vendor/padrino-core-0.10.5/test/test_routing.rb +1673 -0
  152. data/lib/middleman/vendor/padrino-helpers-0.10.5/.document +5 -0
  153. data/lib/middleman/vendor/padrino-helpers-0.10.5/.gitignore +21 -0
  154. data/lib/middleman/vendor/padrino-helpers-0.10.5/.yardopts +1 -0
  155. data/lib/middleman/vendor/padrino-helpers-0.10.5/LICENSE.txt +20 -0
  156. data/lib/middleman/vendor/padrino-helpers-0.10.5/README.rdoc +239 -0
  157. data/lib/middleman/vendor/padrino-helpers-0.10.5/Rakefile +5 -0
  158. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers.rb +58 -0
  159. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/asset_tag_helpers.rb +420 -0
  160. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/abstract_form_builder.rb +220 -0
  161. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/standard_form_builder.rb +43 -0
  162. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_helpers.rb +602 -0
  163. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/format_helpers.rb +381 -0
  164. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/cs.yml +103 -0
  165. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/da.yml +91 -0
  166. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/de.yml +81 -0
  167. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/en.yml +103 -0
  168. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/es.yml +103 -0
  169. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/fr.yml +80 -0
  170. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/hu.yml +103 -0
  171. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/it.yml +89 -0
  172. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ja.yml +103 -0
  173. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/lv.yml +103 -0
  174. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/nl.yml +82 -0
  175. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/no.yml +91 -0
  176. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pl.yml +95 -0
  177. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pt_br.yml +103 -0
  178. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ru.yml +103 -0
  179. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/tr.yml +103 -0
  180. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/uk.yml +103 -0
  181. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_cn.yml +104 -0
  182. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_tw.yml +103 -0
  183. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/number_helpers.rb +288 -0
  184. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers.rb +175 -0
  185. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/abstract_handler.rb +98 -0
  186. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/erb_handler.rb +79 -0
  187. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/haml_handler.rb +63 -0
  188. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/slim_handler.rb +81 -0
  189. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/render_helpers.rb +60 -0
  190. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/tag_helpers.rb +103 -0
  191. data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/translation_helpers.rb +38 -0
  192. data/lib/middleman/vendor/padrino-helpers-0.10.5/padrino-helpers.gemspec +27 -0
  193. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/app.rb +73 -0
  194. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.erb +14 -0
  195. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.haml +12 -0
  196. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.slim +13 -0
  197. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.erb +14 -0
  198. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.haml +12 -0
  199. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.slim +12 -0
  200. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.erb +11 -0
  201. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.haml +9 -0
  202. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.slim +9 -0
  203. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.erb +5 -0
  204. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.haml +5 -0
  205. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.slim +5 -0
  206. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.erb +20 -0
  207. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.haml +15 -0
  208. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.slim +15 -0
  209. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.erb +56 -0
  210. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.haml +47 -0
  211. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.slim +47 -0
  212. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.erb +56 -0
  213. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.haml +45 -0
  214. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.slim +45 -0
  215. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.erb +5 -0
  216. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.haml +4 -0
  217. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.slim +4 -0
  218. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.erb +3 -0
  219. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.haml +3 -0
  220. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.slim +3 -0
  221. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.erb +3 -0
  222. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.haml +3 -0
  223. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.slim +3 -0
  224. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_erb.erb +1 -0
  225. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_haml.haml +1 -0
  226. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_slim.slim +1 -0
  227. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.erb +1 -0
  228. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.haml +1 -0
  229. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.slim +1 -0
  230. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/app.rb +50 -0
  231. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engine.haml +5 -0
  232. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_erb.erb +1 -0
  233. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_haml.haml +1 -0
  234. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_slim.slim +1 -0
  235. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/erb/test.erb +1 -0
  236. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/explicit_engine.haml +5 -0
  237. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/haml/test.haml +1 -0
  238. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/_user.haml +7 -0
  239. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/haml_template.haml +1 -0
  240. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/some_template.haml +2 -0
  241. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/helper.rb +66 -0
  242. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_asset_tag_helpers.rb +320 -0
  243. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_form_builder.rb +996 -0
  244. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_form_helpers.rb +645 -0
  245. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_format_helpers.rb +227 -0
  246. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_locale.rb +20 -0
  247. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_number_helpers.rb +136 -0
  248. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_output_helpers.rb +153 -0
  249. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_render_helpers.rb +76 -0
  250. data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_tag_helpers.rb +105 -0
  251. data/lib/middleman/version.rb +1 -1
  252. data/middleman-x86-mingw32.gemspec +16 -33
  253. data/middleman.gemspec +16 -31
  254. metadata +590 -349
  255. data/features/sinatra.feature +0 -6
  256. data/lib/middleman/core_extensions/rack_map.rb +0 -35
  257. data/lib/middleman/renderers/coffee_script.rb +0 -8
  258. data/lib/middleman/renderers/haml.rb +0 -31
  259. data/lib/middleman/renderers/slim.rb +0 -8
@@ -1,53 +1,56 @@
1
1
  module Middleman::Features::DirectoryIndexes
2
2
  class << self
3
3
  def registered(app)
4
- app.set :ignored_directory_indexes, []
5
- app.extend ClassMethods
4
+ app.send :include, InstanceMethods
5
+ app.before do
6
+ prefix = @original_path.sub(/\/$/, "")
7
+ indexed_path = prefix + "/" + self.index_file
8
+ indexed_exists = resolve_template(indexed_path)
9
+
10
+ extensioned_path = prefix + File.extname(self.index_file)
11
+ is_ignored = self.ignored_directory_indexes.include?(extensioned_path)
12
+
13
+ if !indexed_exists && !is_ignored
14
+ parts = @original_path.split("/")
15
+ last_part = parts.last
16
+ last_part_ext = File.extname(last_part)
17
+
18
+ if last_part_ext.blank?
19
+ # This is a folder, redirect to index
20
+ @request_path = extensioned_path
21
+ end
22
+ end
23
+ end
6
24
 
7
25
  app.build_reroute do |destination, request_path|
8
- index_ext = File.extname(app.settings.index_file)
9
- new_index_path = "/#{app.settings.index_file}"
26
+ index_ext = File.extname(self.index_file)
27
+ new_index_path = "/#{self.index_file}"
10
28
 
11
- indexed_path = request_path.gsub(/\/$/, "") + index_ext
29
+ indexed_path = request_path.sub(/\/$/, "") + index_ext
12
30
 
13
- if app.settings.ignored_directory_indexes.include?(request_path)
31
+ if self.ignored_directory_indexes.include?(request_path)
14
32
  false
15
33
  elsif request_path =~ /#{new_index_path}$/
16
34
  false
17
35
  else
18
36
  [
19
- destination.gsub(/#{index_ext.gsub(".", "\\.")}$/, new_index_path),
37
+ destination.sub(/#{index_ext.gsub(".", "\\.")}$/, new_index_path),
20
38
  request_path
21
39
  ]
22
40
  end
23
41
  end
24
-
25
- app.before do
26
- indexed_path = request.path_info.gsub(/\/$/, "") + "/" + app.settings.index_file
27
- indexed_exists = resolve_template(indexed_path, :raise_exceptions => false)
28
-
29
- extensioned_path = request.path_info.gsub(/\/$/, "") + File.extname(app.settings.index_file)
30
- is_ingored = settings.ignored_directory_indexes.include?(extensioned_path)
31
-
32
- if !indexed_exists && !is_ingored
33
- parts = request.path_info.split("/")
34
- last_part = parts.last
35
- last_part_ext = File.extname(last_part)
36
-
37
- if last_part_ext.blank?
38
- # This is a folder, redirect to index
39
- request.path_info = extensioned_path
40
- end
41
- end
42
- end
43
42
  end
44
43
  alias :included :registered
45
44
  end
46
45
 
47
- module ClassMethods
46
+ module InstanceMethods
47
+ def ignored_directory_indexes
48
+ @_ignored_directory_indexes ||= []
49
+ end
50
+
48
51
  def page(url, options={}, &block)
49
52
  if options.has_key?(:directory_index) && !options["directory_index"]
50
- settings.ignored_directory_indexes << url
53
+ ignored_directory_indexes << url
51
54
  else
52
55
  super
53
56
  end
@@ -1,8 +1,9 @@
1
1
  module Middleman::Features::MinifyCss
2
2
  class << self
3
3
  def registered(app)
4
- app.compass_config do |config|
5
- config.output_style = :compressed
4
+ require "middleman/features/minify_css/cssmin"
5
+ app.after_configuration do
6
+ set :css_compressor, ::CSSMin
6
7
  end
7
8
  end
8
9
  alias :included :registered
@@ -0,0 +1,55 @@
1
+ #--
2
+ # Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
3
+ # All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # * Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ # * Redistributions in binary form must reproduce the above copyright notice,
11
+ # this list of conditions and the following disclaimer in the documentation
12
+ # and/or other materials provided with the distribution.
13
+ # * Neither the name of this project nor the names of its contributors may be
14
+ # used to endorse or promote products derived from this software without
15
+ # specific prior written permission.
16
+ #
17
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
21
+ # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
+ # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
+ # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
+ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
+ #++
28
+
29
+ module CSSMin
30
+ def self.compress(input)
31
+ css = input.is_a?(IO) ? input.read : input.dup.to_s
32
+ css.gsub!(/\/\*[\s\S]*?\*\//, '')
33
+ css.gsub!(/\s+/, ' ')
34
+ css.gsub!(/"\\"\}\\""/, '___BMH___')
35
+ css.gsub!(/(?:^|\})[^\{:]+\s+:+[^\{]*\{/) do |match|
36
+ match.gsub(':', '___PSEUDOCLASSCOLON___')
37
+ end
38
+ css.gsub!(/\s+([!\{\};:>+\(\)\],])/, '\1')
39
+ css.gsub!('___PSEUDOCLASSCOLON___', ':')
40
+ css.gsub!(/([!\{\}:;>+\(\[,])\s+/, '\1')
41
+ css.gsub!(/([^;\}])\}/, '\1;}')
42
+ css.gsub!(/([\s:])([+-]?0)(?:%|em|ex|px|in|cm|mm|pt|pc)/i, '\1\2')
43
+ css.gsub!(/:(?:0 )+0;/, ':0;')
44
+ css.gsub!('background-position:0;', 'background-position:0 0;')
45
+ css.gsub!(/(:|\s)0+\.(\d+)/, '\1.\2')
46
+ css.gsub!(/rgb\s*\(\s*([0-9,\s]+)\s*\)/) do |match|
47
+ '#' << $1.scan(/\d+/).map{|n| n.to_i.to_s(16).rjust(2, '0') }.join
48
+ end
49
+ css.gsub!(/([^"'=\s])\s*#([0-9a-f])\2([0-9a-f])\3([0-9a-f])\4/i, '\1 #\2\3\4')
50
+ css.gsub!(/[^\}]+\{;\}\n/, '')
51
+ css.gsub!('___BMH___', '"\"}\""')
52
+ css.gsub!(/;;+/, ';')
53
+ css.strip
54
+ end
55
+ end
@@ -2,7 +2,9 @@ module Middleman::Features::MinifyJavascript
2
2
  class << self
3
3
  def registered(app)
4
4
  require 'uglifier'
5
- app.set :js_compressor, ::Uglifier.new
5
+ app.after_configuration do
6
+ set :js_compressor, ::Uglifier.new
7
+ end
6
8
  app.use InlineJavascriptRack
7
9
  end
8
10
  alias :included :registered
@@ -19,10 +21,15 @@ module Middleman::Features::MinifyJavascript
19
21
  if env["PATH_INFO"].match(/\.html$/)
20
22
  compressor = ::Uglifier.new
21
23
 
22
- if response.is_a?(::Rack::File)# or response.is_a?(::Sinatra::Helpers::StaticFile)
23
- uncompressed_source = File.read(response.path)
24
- else
25
- uncompressed_source = response.join
24
+ uncompressed_source = case(response)
25
+ when String
26
+ response
27
+ when Array
28
+ response.join
29
+ when Rack::Response
30
+ response.body.join
31
+ when Rack::File
32
+ File.read(response.path)
26
33
  end
27
34
 
28
35
  minified = uncompressed_source.gsub(/(<scri.*?\/\/<!\[CDATA\[\n)(.*?)(\/\/\]\].*?<\/script>)/m) do |m|
@@ -4,36 +4,39 @@ module Middleman::Features::RelativeAssets
4
4
  app.compass_config do |config|
5
5
  config.relative_assets = true
6
6
  end
7
+
8
+ app.send :include, InstanceMethods
9
+ end
10
+ alias :included :registered
11
+ end
12
+
13
+ module InstanceMethods
14
+ def asset_url(path, prefix="")
15
+ begin
16
+ prefix = self.images_dir if prefix == self.http_images_path
17
+ rescue
18
+ end
7
19
 
8
- app.register_asset_handler :relative_assets do |path, prefix, request|
9
- begin
10
- prefix = app.images_dir if prefix == app.http_images_path
11
- rescue
12
- end
20
+ if path.include?("://")
21
+ super(path, prefix)
22
+ elsif path[0,1] == "/"
23
+ path
24
+ else
25
+ path = File.join(prefix, path) if prefix.length > 0
26
+ request_path = @request_path.dup
27
+ request_path << self.index_file if path.match(%r{/$})
28
+ request_path.gsub!(%r{^/}, '')
29
+ parts = request_path.split('/')
13
30
 
14
- if path.include?("://")
15
- app.before_asset_handler(:relative_assets, path, prefix, request)
16
- elsif path[0,1] == "/"
17
- path
31
+ if parts.length > 1
32
+ arry = []
33
+ (parts.length - 1).times { arry << ".." }
34
+ arry << path
35
+ File.join(*arry)
18
36
  else
19
- path = app.before_asset_handler(:relative_assets, path, prefix, request).sub(%r{^/}, '')
20
- # path = File.join(prefix, path) if prefix.length > 0
21
- request_path = request.path_info.dup
22
- request_path << app.index_file if path.match(%r{/$})
23
- request_path.gsub!(%r{^/}, '')
24
- parts = request_path.split('/')
25
-
26
- if parts.length > 1
27
- arry = []
28
- (parts.length - 1).times { arry << ".." }
29
- arry << path
30
- File.join(*arry)
31
- else
32
- path
33
- end
37
+ path
34
38
  end
35
39
  end
36
40
  end
37
- alias :included :registered
38
41
  end
39
42
  end
@@ -0,0 +1,34 @@
1
+ module Middleman::Features::SitemapTree
2
+ class << self
3
+ def registered(app)
4
+ app.helpers Helpers
5
+ end
6
+ alias :included :registered
7
+ end
8
+
9
+ module Helpers
10
+ def sitemap_tree(regex=nil)
11
+ @sitemap_tree_cache = {}
12
+
13
+ key = regex.nil? ? "all" : regex
14
+
15
+ if !@sitemap_tree_cache.has_key?(key)
16
+ auto_hash = Hash.new{ |h,k| h[k] = Hash.new &h.default_proc }
17
+
18
+ app.sitemap.all_paths.each do |path|
19
+ next if !regex.nil? && !path.match(regex)
20
+ sub = auto_hash
21
+ path.split( "/" ).each{ |dir| sub[dir]; sub = sub[dir] }
22
+ end
23
+
24
+ @sitemap_tree_cache[key] = auto_hash
25
+ end
26
+
27
+ @sitemap_tree_cache[key]
28
+ end
29
+
30
+ def html_sitemap
31
+ sitemap_tree(/\.html$/)
32
+ end
33
+ end
34
+ end
@@ -2,40 +2,30 @@ require "guard"
2
2
  require "guard/guard"
3
3
  require "rbconfig"
4
4
 
5
- if RbConfig::CONFIG['host_os'].downcase =~ %r{mingw}
5
+ if Config::CONFIG['host_os'].downcase =~ %r{mingw}
6
6
  require "win32/process"
7
7
  end
8
-
8
+
9
9
  module Middleman
10
10
  module Guard
11
11
  def self.add_guard(&block)
12
- @additional_guards ||= []
13
- @additional_guards << block
12
+ # Deprecation Warning
13
+ puts "== Middleman::Guard.add_guard has been removed. Update your extensions to versions which support this change."
14
14
  end
15
15
 
16
- def self.start(options={}, livereload={})
16
+ def self.start(options={})
17
17
  options_hash = ""
18
18
  options.each do |k,v|
19
19
  options_hash << ", :#{k} => '#{v}'"
20
20
  end
21
-
21
+
22
22
  guardfile_contents = %Q{
23
23
  guard 'middleman'#{options_hash} do
24
- watch("config.rb")
25
- watch(%r{^lib/^[^\.](.*)\.rb$})
24
+ watch(%r{(.*)})
26
25
  end
27
26
  }
28
-
29
- (@additional_guards || []).each do |block|
30
- result = block.call(options, livereload)
31
- guardfile_contents << result unless result.nil?
32
- end
33
-
34
- begin
35
- ::Guard.start({ :guardfile_contents => guardfile_contents })
36
- rescue Interrupt
37
- ::Guard.stop
38
- end
27
+
28
+ ::Guard.start({ :guardfile_contents => guardfile_contents })
39
29
  end
40
30
  end
41
31
  end
@@ -50,16 +40,60 @@ module Guard
50
40
  def start
51
41
  server_start
52
42
  end
53
-
54
- def run_on_changes(paths)
43
+
44
+ def reload
55
45
  server_stop
56
46
  server_start
57
47
  end
48
+
49
+ def run_on_change(paths)
50
+ needs_to_restart = false
51
+
52
+ paths.each do |path|
53
+ if path.match(%{^config\.rb}) || path.match(%r{^lib/^[^\.](.*)\.rb$})
54
+ needs_to_restart = true
55
+ break
56
+ end
57
+ end
58
+
59
+ if needs_to_restart
60
+ reload
61
+ elsif !@app.nil?
62
+ paths.each do |path|
63
+ @app.logger.debug :file_change, Time.now, path if @app.settings.logging?
64
+ @app.file_did_change(path)
65
+ end
66
+ end
67
+ end
58
68
 
69
+ def run_on_deletion(paths)
70
+ if !@app.nil?
71
+ paths.each do |path|
72
+ @app.logger.debug :file_remove, Time.now, path if @app.settings.logging?
73
+ @app.file_did_delete(path)
74
+ end
75
+ end
76
+ end
77
+
59
78
  private
60
79
  def server_start
80
+ # Quiet down Guard
81
+ # ENV['GUARD_ENV'] = 'test' if @options[:debug] == "true"
82
+
83
+ env = (@options[:environment] || "development").to_sym
84
+ is_logging = @options.has_key?(:debug) && (@options[:debug] == "true")
85
+ @app = ::Middleman.server.inst do
86
+ set :environment, env
87
+ set :logging, is_logging
88
+ end
89
+
90
+ app_rack = @app.class.to_rack_app
91
+
61
92
  @server_job = fork do
62
- ::Middleman.start_server(@options)
93
+ opts = @options.dup
94
+ opts[:app] = app_rack
95
+ puts "== The Middleman is standing watch on port #{opts[:Port]||4567}"
96
+ ::Middleman.start_server(opts)
63
97
  end
64
98
  end
65
99
 
@@ -68,7 +102,7 @@ module Guard
68
102
  Process.kill("KILL", @server_job)
69
103
  Process.wait @server_job
70
104
  @server_job = nil
71
- # @server_options[:app] = nil
105
+ @app = nil
72
106
  end
73
107
  end
74
108
  end
@@ -0,0 +1,29 @@
1
+ require "tilt"
2
+
3
+ module Middleman::Renderers::ERb
4
+ class << self
5
+ def registered(app)
6
+ app.send :include, InstanceMethods
7
+
8
+ app.set :erb_engine, :erb
9
+ app.set :erb_engine_prefix, ::Tilt
10
+
11
+ app.after_configuration do
12
+ if erb_engine.is_a? Symbol
13
+ erb_engine = erb_tilt_template_from_symbol(erb_engine)
14
+ end
15
+
16
+ ::Tilt.prefer(erb_engine)
17
+ end
18
+ end
19
+ alias :included :registered
20
+ end
21
+
22
+ module InstanceMethods
23
+ def erb_tilt_template_from_symbol(engine)
24
+ engine = engine.to_s
25
+ engine = engine == "erb" ? "ERB" : engine.camelize
26
+ erb_engine_prefix.const_get("#{engine}Template")
27
+ end
28
+ end
29
+ end
@@ -7,19 +7,10 @@ module Middleman::Renderers::Liquid
7
7
  require "liquid"
8
8
 
9
9
  app.after_configuration do
10
- full_path = app.views
11
- full_path = File.join(app.root, app.views) unless app.views.include?(app.root)
12
-
13
- Liquid::Template.file_system = Liquid::LocalFileSystem.new(full_path)
10
+ Liquid::Template.file_system = Liquid::LocalFileSystem.new(self.source_dir)
14
11
 
15
- app.before_processing(:liquid) do |result|
16
- if result && result[1] == :liquid
17
- request['custom_locals'] ||= {}
18
- request['custom_locals'][:data] = data.to_h
19
- # request['custom_locals'].merge(data.to_h)
20
- end
21
-
22
- true
12
+ provides_metadata %r{\.liquid$} do |path|
13
+ @locals.merge!(:data => data.to_h)
23
14
  end
24
15
  end
25
16
  rescue LoadError