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,45 +0,0 @@
1
- gem 'minitest'
2
- require 'minitest/spec'
3
- require 'minitest/autorun'
4
- require 'mocha' # Load mocha after minitest
5
-
6
- begin
7
- require 'ruby-debug'
8
- rescue LoadError; end
9
-
10
- class MiniTest::Spec
11
- class << self
12
- alias :setup :before unless defined?(Rails)
13
- alias :teardown :after unless defined?(Rails)
14
- alias :should :it
15
- alias :context :describe
16
- def should_eventually(desc)
17
- it("should eventually #{desc}") { skip("Should eventually #{desc}") }
18
- end
19
- end
20
- alias :assert_no_match :refute_match
21
- alias :assert_not_nil :refute_nil
22
- alias :assert_not_equal :refute_equal
23
- end
24
-
25
- class ColoredIO
26
- def initialize(io)
27
- @io = io
28
- end
29
-
30
- def print(o)
31
- case o
32
- when "." then @io.send(:print, o.green)
33
- when "E" then @io.send(:print, o.red)
34
- when "F" then @io.send(:print, o.yellow)
35
- when "S" then @io.send(:print, o.magenta)
36
- else @io.send(:print, o)
37
- end
38
- end
39
-
40
- def puts(*o)
41
- super
42
- end
43
- end
44
-
45
- MiniTest::Unit.output = ColoredIO.new(MiniTest::Unit.output)
@@ -1,108 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
2
-
3
- class PadrinoPristine < Padrino::Application; end
4
- class PadrinoTestApp < Padrino::Application; end
5
- class PadrinoTestApp2 < Padrino::Application; end
6
-
7
- describe "Application" do
8
- def setup
9
- Padrino.clear!
10
- end
11
-
12
- def teardown
13
- remove_views
14
- end
15
-
16
- context 'for application functionality' do
17
-
18
- should 'check default options' do
19
- assert File.identical?(__FILE__, PadrinoPristine.app_file)
20
- assert_equal :padrino_pristine, PadrinoPristine.app_name
21
- assert_equal :test, PadrinoPristine.environment
22
- assert_equal Padrino.root("views"), PadrinoPristine.views
23
- assert PadrinoPristine.raise_errors
24
- assert !PadrinoPristine.logging
25
- assert !PadrinoPristine.sessions
26
- assert !PadrinoPristine.dump_errors
27
- assert !PadrinoPristine.show_exceptions
28
- assert PadrinoPristine.raise_errors
29
- assert !Padrino.configure_apps
30
- end
31
-
32
- should 'check padrino specific options' do
33
- assert !PadrinoPristine.instance_variable_get(:@_configured)
34
- PadrinoPristine.send(:setup_application!)
35
- assert_equal :padrino_pristine, PadrinoPristine.app_name
36
- assert_equal 'StandardFormBuilder', PadrinoPristine.default_builder
37
- assert PadrinoPristine.instance_variable_get(:@_configured)
38
- assert !PadrinoPristine.reload?
39
- assert !PadrinoPristine.flash
40
- end
41
-
42
- should 'set global project settings' do
43
- Padrino.configure_apps { enable :sessions; set :foo, "bar" }
44
- PadrinoTestApp.send(:default_configuration!)
45
- PadrinoTestApp2.send(:default_configuration!)
46
- assert PadrinoTestApp.sessions, "should have sessions enabled"
47
- assert_equal "bar", PadrinoTestApp.settings.foo, "should have foo assigned"
48
- assert_equal PadrinoTestApp.session_secret, PadrinoTestApp2.session_secret
49
- end
50
-
51
- should "have shared sessions accessible in project" do
52
- Padrino.configure_apps { enable :sessions; set :session_secret, 'secret' }
53
- Padrino.mount("PadrinoTestApp").to("/write")
54
- Padrino.mount("PadrinoTestApp2").to("/read")
55
- PadrinoTestApp.tap { |app| app.send(:default_configuration!)
56
- app.get("/") { session[:foo] = "shared" } }
57
- PadrinoTestApp2.tap { |app| app.send(:default_configuration!)
58
- app.get("/") { session[:foo] } }
59
- browser = Rack::Test::Session.new(Rack::MockSession.new(Padrino.application))
60
- browser.get '/write'
61
- browser.get '/read'
62
- assert_equal 'shared', browser.last_response.body
63
- end
64
-
65
- # compare to: test_routing: allow global provides
66
- should "set content_type to :html if none can be determined" do
67
- mock_app do
68
- provides :xml
69
-
70
- get("/foo"){ "Foo in #{content_type}" }
71
- get("/bar"){ "Foo in #{content_type}" }
72
- end
73
-
74
- get '/foo', {}, { 'HTTP_ACCEPT' => 'application/xml' }
75
- assert_equal 'Foo in xml', body
76
- get '/foo'
77
- assert_equal 'Foo in xml', body
78
-
79
- get '/bar', {}, { 'HTTP_ACCEPT' => 'application/xml' }
80
- assert_equal "Foo in html", body
81
- end # content_type to :html
82
-
83
- context "errors" do
84
- should "haven't mapped errors on development" do
85
- mock_app { get('/'){ 'HI' } }
86
- get "/"
87
- assert @app.errors.empty?
88
- end
89
-
90
- should "have mapped errors on production" do
91
- mock_app { set :environment, :production; get('/'){ 'HI' } }
92
- get "/"
93
- assert_equal 1, @app.errors.size
94
- end
95
-
96
- should "overide errors" do
97
- mock_app do
98
- set :environment, :production
99
- get('/'){ raise }
100
- error(::Exception){ 'custom error' }
101
- end
102
- get "/"
103
- assert_equal 1, @app.errors.size
104
- assert_equal 'custom error', body
105
- end
106
- end
107
- end # application functionality
108
- end
@@ -1,77 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
2
-
3
- describe "Core" do
4
- def setup
5
- Padrino.clear!
6
- end
7
-
8
- context 'for core functionality' do
9
-
10
- should 'check some global methods' do
11
- assert_respond_to Padrino, :root
12
- assert_respond_to Padrino, :env
13
- assert_respond_to Padrino, :application
14
- assert_respond_to Padrino, :set_encoding
15
- assert_respond_to Padrino, :load!
16
- assert_respond_to Padrino, :reload!
17
- assert_respond_to Padrino, :version
18
- assert_respond_to Padrino, :configure_apps
19
- end
20
-
21
-
22
- should 'validate global helpers' do
23
- assert_equal :test, Padrino.env
24
- assert_match /\/test/, Padrino.root
25
- assert_not_nil Padrino.version
26
- end
27
-
28
- should 'set correct utf-8 encoding' do
29
- Padrino.set_encoding
30
- if RUBY_VERSION <'1.9'
31
- assert_equal 'UTF8', $KCODE
32
- else
33
- assert_equal Encoding.default_external, Encoding::UTF_8
34
- assert_equal Encoding.default_internal, Encoding::UTF_8
35
- end
36
- end
37
-
38
- should 'have load paths' do
39
- assert_equal [Padrino.root('lib'), Padrino.root('models'), Padrino.root('shared')], Padrino.load_paths
40
- end
41
-
42
- should 'raise application error if I instantiate a new padrino application without mounted apps' do
43
- assert_raises(Padrino::ApplicationLoadError) { Padrino.application.new }
44
- end
45
-
46
- should "check before/after padrino load hooks" do
47
- Padrino.before_load { @_foo = 1 }
48
- Padrino.after_load { @_foo += 1 }
49
- Padrino.load!
50
- assert_equal 1, Padrino.before_load.size
51
- assert_equal 1, Padrino.after_load.size
52
- assert_equal 2, @_foo
53
- end
54
-
55
- should "add middlewares in front if specified" do
56
- test = Class.new {
57
- def initialize(app)
58
- @app = app
59
- end
60
-
61
- def call(env)
62
- status, headers, body = @app.call(env)
63
- headers["Middleware-Called"] = "yes"
64
- return status, headers, body
65
- end
66
- }
67
-
68
- class Foo < Padrino::Application; end
69
-
70
- Padrino.use(test)
71
- Padrino.mount(Foo).to("/")
72
-
73
- res = Rack::MockRequest.new(Padrino.application).get("/")
74
- assert_equal "yes", res["Middleware-Called"]
75
- end
76
- end
77
- end
@@ -1,44 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
2
-
3
- describe "Dependencies" do
4
- context 'when we require a dependency that have another dependency' do
5
-
6
- should 'raise an error without reloading it twice' do
7
- capture_io do
8
- assert_raises(RuntimeError) do
9
- Padrino.require_dependencies(
10
- Padrino.root("fixtures/dependencies/a.rb"),
11
- Padrino.root("fixtures/dependencies/b.rb"),
12
- Padrino.root("fixtures/dependencies/c.rb"),
13
- Padrino.root("fixtures/dependencies/d.rb")
14
- )
15
- end
16
- end
17
- assert_equal 1, D
18
- end
19
-
20
- should 'resolve dependency problems' do
21
- capture_io do
22
- Padrino.require_dependencies(
23
- Padrino.root("fixtures/dependencies/a.rb"),
24
- Padrino.root("fixtures/dependencies/b.rb"),
25
- Padrino.root("fixtures/dependencies/c.rb")
26
- )
27
- end
28
- assert_equal ["B", "C"], A_result
29
- assert_equal "C", B_result
30
- end
31
-
32
- should 'remove partially loaded constants' do
33
- capture_io do
34
- Padrino.require_dependencies(
35
- Padrino.root("fixtures/dependencies/circular/e.rb"),
36
- Padrino.root("fixtures/dependencies/circular/f.rb"),
37
- Padrino.root("fixtures/dependencies/circular/g.rb")
38
- )
39
- end
40
-
41
- assert_equal ["name"], F.fields
42
- end
43
- end
44
- end
@@ -1,278 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
2
-
3
- describe "Filters" do
4
- should "filters by accept header" do
5
- mock_app do
6
- get '/foo', :provides => [:xml, :js] do
7
- request.env['HTTP_ACCEPT']
8
- end
9
- end
10
-
11
- get '/foo', {}, { 'HTTP_ACCEPT' => 'application/xml' }
12
- assert ok?
13
- assert_equal 'application/xml', body
14
- assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
15
-
16
- get '/foo.xml'
17
- assert ok?
18
- assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
19
-
20
- get '/foo', {}, { 'HTTP_ACCEPT' => 'application/javascript' }
21
- assert ok?
22
- assert_equal 'application/javascript', body
23
- assert_equal 'application/javascript;charset=utf-8', response.headers['Content-Type']
24
-
25
- get '/foo.js'
26
- assert ok?
27
- assert_equal 'application/javascript;charset=utf-8', response.headers['Content-Type']
28
-
29
- get '/foo', {}, { "HTTP_ACCEPT" => 'text/html' }
30
- assert_equal 406, status
31
- end
32
-
33
- should "allow passing & halting in before filters" do
34
- mock_app do
35
- controller do
36
- before { env['QUERY_STRING'] == 'secret' or pass }
37
- get :index do
38
- "secret index"
39
- end
40
- end
41
-
42
- controller do
43
- before { env['QUERY_STRING'] == 'halt' and halt 401, 'go away!' }
44
- get :index do
45
- "index"
46
- end
47
- end
48
- end
49
-
50
- get "/?secret"
51
- assert_equal "secret index", body
52
-
53
- get "/?halt"
54
- assert_equal "go away!", body
55
- assert_equal 401, status
56
-
57
- get "/"
58
- assert_equal "index", body
59
- end
60
-
61
- should 'scope filters in the given controller' do
62
- mock_app do
63
- before { @global = 'global' }
64
- after { @global = nil }
65
-
66
- controller :foo do
67
- before { @foo = :foo }
68
- after { @foo = nil }
69
- get("/") { [@foo, @bar, @global].compact.join(" ") }
70
- end
71
-
72
- get("/") { [@foo, @bar, @global].compact.join(" ") }
73
-
74
- controller :bar do
75
- before { @bar = :bar }
76
- after { @bar = nil }
77
- get("/") { [@foo, @bar, @global].compact.join(" ") }
78
- end
79
- end
80
-
81
- get "/bar"
82
- assert_equal "bar global", body
83
-
84
- get "/foo"
85
- assert_equal "foo global", body
86
-
87
- get "/"
88
- assert_equal "global", body
89
- end
90
-
91
- should 'be able to access params in a before filter' do
92
- username_from_before_filter = nil
93
-
94
- mock_app do
95
- before do
96
- username_from_before_filter = params[:username]
97
- end
98
-
99
- get :users, :with => :username do
100
- end
101
- end
102
- get '/users/josh'
103
- assert_equal 'josh', username_from_before_filter
104
- end
105
-
106
- should "be able to access params normally when a before filter is specified" do
107
- mock_app do
108
- before { }
109
- get :index do
110
- params.inspect
111
- end
112
- end
113
- get '/?test=what'
114
- assert_equal '{"test"=>"what"}', body
115
- end
116
-
117
- should "be able to filter based on a path" do
118
- mock_app do
119
- before('/') { @test = "#{@test}before"}
120
- get :index do
121
- @test
122
- end
123
- get :main do
124
- @test
125
- end
126
- end
127
- get '/'
128
- assert_equal 'before', body
129
- get '/main'
130
- assert_equal '', body
131
- end
132
-
133
- should "be able to filter based on a symbol" do
134
- mock_app do
135
- before(:index) { @test = 'before'}
136
- get :index do
137
- @test
138
- end
139
- get :main do
140
- @test
141
- end
142
- end
143
- get '/'
144
- assert_equal 'before', body
145
- get '/main'
146
- assert_equal '', body
147
- end
148
-
149
- should "be able to filter based on a symbol for a controller" do
150
- mock_app do
151
- controller :foo do
152
- before(:test) { @test = 'foo'}
153
- get :test do
154
- @test.to_s + " response"
155
- end
156
- end
157
- controller :bar do
158
- before(:test) { @test = 'bar'}
159
- get :test do
160
- @test.to_s + " response"
161
- end
162
- end
163
- end
164
- get '/foo/test'
165
- assert_equal 'foo response', body
166
- get '/bar/test'
167
- assert_equal 'bar response', body
168
- end
169
-
170
- should "be able to filter based on a symbol or path" do
171
- mock_app do
172
- before(:index, '/main') { @test = 'before'}
173
- get :index do
174
- @test
175
- end
176
- get :main do
177
- @test
178
- end
179
- end
180
- get '/'
181
- assert_equal 'before', body
182
- get '/main'
183
- assert_equal 'before', body
184
- end
185
-
186
- should "be able to filter based on a symbol or regexp" do
187
- mock_app do
188
- before(:index, /main/) { @test = 'before'}
189
- get :index do
190
- @test
191
- end
192
- get :main do
193
- @test
194
- end
195
- get :profile do
196
- @test
197
- end
198
- end
199
- get '/'
200
- assert_equal 'before', body
201
- get '/main'
202
- assert_equal 'before', body
203
- get '/profile'
204
- assert_equal '', body
205
- end
206
-
207
- should "be able to filter excluding based on a symbol" do
208
- mock_app do
209
- before(:except => :index) { @test = 'before'}
210
- get :index do
211
- @test
212
- end
213
- get :main do
214
- @test
215
- end
216
- end
217
- get '/'
218
- assert_equal '', body
219
- get '/main'
220
- assert_equal 'before', body
221
- end
222
-
223
- should "be able to filter based on a request param" do
224
- mock_app do
225
- before(:agent => /IE/) { @test = 'before'}
226
- get :index do
227
- @test
228
- end
229
- end
230
- get '/'
231
- assert_equal '', body
232
- get "/", {}, {'HTTP_USER_AGENT' => 'This is IE'}
233
- assert_equal 'before', body
234
- end
235
-
236
- should "be able to filter based on a symbol or path in multiple controller" do
237
- mock_app do
238
- controllers :foo do
239
- before(:index, '/foo/main') { @test = 'before' }
240
- get :index do
241
- @test
242
- end
243
- get :main do
244
- @test
245
- end
246
- end
247
- controllers :bar do
248
- before(:index, '/bar/main') { @test = 'also before' }
249
- get :index do
250
- @test
251
- end
252
- get :main do
253
- @test
254
- end
255
- end
256
- end
257
- get '/foo'
258
- assert_equal 'before', body
259
- get '/bar'
260
- assert_equal 'also before', body
261
- get '/foo/main'
262
- assert_equal 'before', body
263
- get '/bar/main'
264
- assert_equal 'also before', body
265
- end
266
-
267
- should "call before filters even if there was no match" do
268
- test = nil
269
- mock_app do
270
- before(:index, '/foo') { test = 'before' }
271
- get :index do
272
- ''
273
- end
274
- end
275
- get '/foo'
276
- assert_equal 'before', test
277
- end
278
- end
@@ -1,21 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/helper')
2
-
3
- describe "Locales" do
4
- Dir[File.expand_path("../../lib/padrino-core/locale/*.yml", __FILE__)].each do |file|
5
- base_original = YAML.load_file(file)
6
- name = File.basename(file, '.yml')
7
- should "should have correct locale for #{name}" do
8
- base = base_original[name]['date']['formats']
9
- assert base['default'].present?
10
- assert base['short'].present?
11
- assert base['long'].present?
12
- assert base['only_day'].present?
13
- base = base_original[name]['date']
14
- assert base['day_names'].present?
15
- assert base['abbr_day_names'].present?
16
- assert base['month_names'].present?
17
- assert base['abbr_month_names'].present?
18
- assert base['order'].present?
19
- end
20
- end
21
- end