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,20 +0,0 @@
1
- module Padrino
2
- ##
3
- # This module extend Sinatra::ShowExceptions adding Padrino as "Framework".
4
- #
5
- # @private
6
- class ShowExceptions < Sinatra::ShowExceptions
7
- private
8
- def frame_class(frame)
9
- if frame.filename =~ /lib\/sinatra.*\.rb|lib\/padrino.*\.rb/
10
- "framework"
11
- elsif (defined?(Gem) && frame.filename.include?(Gem.dir)) ||
12
- frame.filename =~ /\/bin\/(\w+)$/ ||
13
- frame.filename =~ /Ruby\/Gems/
14
- "system"
15
- else
16
- "app"
17
- end
18
- end
19
- end # ShowExceptions
20
- end # Padrino
@@ -1,269 +0,0 @@
1
- module Padrino
2
- class ApplicationSetupError < RuntimeError # @private
3
- end
4
-
5
- ##
6
- # Subclasses of this become independent Padrino applications (stemming from Sinatra::Application)
7
- # These subclassed applications can be easily mounted into other Padrino applications as well.
8
- #
9
- class Application < Sinatra::Base
10
- # Support for advanced routing, controllers, url_for
11
- register Padrino::Routing
12
-
13
- ##
14
- # Returns the logger for this application.
15
- #
16
- # @return [Padrino::Logger] Logger associated with this app.
17
- #
18
- def logger
19
- Padrino.logger
20
- end
21
-
22
- class << self
23
-
24
- def inherited(base) # @private
25
- begun_at = Time.now
26
- CALLERS_TO_IGNORE.concat(PADRINO_IGNORE_CALLERS)
27
- base.default_configuration!
28
- base.prerequisites.concat([
29
- File.join(base.root, '/models.rb'),
30
- File.join(base.root, '/models/**/*.rb'),
31
- File.join(base.root, '/lib.rb'),
32
- File.join(base.root, '/lib/**/*.rb')
33
- ]).uniq!
34
- Padrino.require_dependencies(base.prerequisites)
35
- logger.devel :setup, begun_at, base
36
- super(base) # Loading the subclass inherited method
37
- end
38
-
39
- ##
40
- # Reloads the application files from all defined load paths
41
- #
42
- # This method is used from our Padrino Reloader during development mode
43
- # in order to reload the source files.
44
- #
45
- # @return [TrueClass]
46
- #
47
- # @example
48
- # MyApp.reload!
49
- #
50
- def reload!
51
- logger.devel "Reloading #{settings}"
52
- reset! # Reset sinatra app
53
- reset_router! # Reset all routes
54
- Padrino.require_dependencies(settings.app_file, :force => true) # Reload the app file
55
- require_dependencies # Reload dependencies
56
- default_filters! # Reload filters
57
- default_routes! # Reload default routes
58
- default_errors! # Reload our errors
59
- I18n.reload! if defined?(I18n) # Reload also our translations
60
- true
61
- end
62
-
63
- ##
64
- # Resets application routes to only routes not defined by the user
65
- #
66
- # @return [TrueClass]
67
- #
68
- # @example
69
- # MyApp.reset_routes!
70
- #
71
- def reset_routes!
72
- reset_router!
73
- default_routes!
74
- true
75
- end
76
-
77
- ##
78
- # Returns the routes of our app.
79
- #
80
- # @example
81
- # MyApp.routes
82
- #
83
- def routes
84
- router.routes
85
- end
86
-
87
- ##
88
- # Setup the application by registering initializers, load paths and logger
89
- # Invoked automatically when an application is first instantiated
90
- #
91
- # @return [TrueClass]
92
- #
93
- def setup_application!
94
- return if @_configured
95
- settings.require_dependencies
96
- settings.default_filters!
97
- settings.default_routes!
98
- settings.default_errors!
99
- if defined?(I18n)
100
- I18n.load_path << settings.locale_path
101
- I18n.reload!
102
- end
103
- @_configured = true
104
- @_configured
105
- end
106
-
107
- ##
108
- # Run the Padrino app as a self-hosted server using
109
- # Thin, Mongrel or WEBrick (in that order)
110
- #
111
- # @see Padrino::Server#start
112
- #
113
- def run!(options={})
114
- return unless Padrino.load!
115
- Padrino.mount(settings.to_s).to('/')
116
- Padrino.run!(options)
117
- end
118
-
119
- ##
120
- # @return [Array]
121
- # directory that need to be added to +$LOAD_PATHS+ from this application
122
- #
123
- def load_paths
124
- @_load_paths ||= %w[models lib mailers controllers helpers].map { |path| File.join(settings.root, path) }
125
- end
126
-
127
- ##
128
- # Returns default list of path globs to load as dependencies
129
- # Appends custom dependency patterns to the be loaded for your Application
130
- #
131
- # @return [Array]
132
- # list of path globs to load as dependencies
133
- #
134
- # @example
135
- # MyApp.dependencies << "#{Padrino.root}/uploaders/**/*.rb"
136
- # MyApp.dependencies << Padrino.root('other_app', 'controllers.rb')
137
- #
138
- def dependencies
139
- [
140
- 'urls.rb', 'config/urls.rb', 'mailers/*.rb', 'mailers.rb',
141
- 'controllers/**/*.rb', 'controllers.rb', 'helpers/**/*.rb', 'helpers.rb'
142
- ].map { |file| Dir[File.join(settings.root, file)] }.flatten
143
- end
144
-
145
- ##
146
- # An array of file to load before your app.rb, basically are files wich our app depends on.
147
- #
148
- # By default we look for files:
149
- #
150
- # # List of default files that we are looking for:
151
- # yourapp/models.rb
152
- # yourapp/models/**/*.rb
153
- # yourapp/lib.rb
154
- # yourapp/lib/**/*.rb
155
- #
156
- # @example Adding a custom perequisite
157
- # MyApp.prerequisites << Padrino.root('my_app', 'custom_model.rb')
158
- #
159
- def prerequisites
160
- @_prerequisites ||= []
161
- end
162
-
163
- protected
164
- ##
165
- # Defines default settings for Padrino application
166
- #
167
- def default_configuration!
168
- # Overwriting Sinatra defaults
169
- set :app_file, File.expand_path(caller_files.first || $0) # Assume app file is first caller
170
- set :environment, Padrino.env
171
- set :reload, Proc.new { development? }
172
- set :logging, Proc.new { development? }
173
- set :method_override, true
174
- set :sessions, false
175
- set :public_folder, Proc.new { Padrino.root('public', uri_root) }
176
- set :views, Proc.new { File.join(root, "views") }
177
- set :images_path, Proc.new { File.join(public, "images") }
178
- set :protection, false
179
- # Padrino specific
180
- set :uri_root, '/'
181
- set :app_name, settings.to_s.underscore.to_sym
182
- set :default_builder, 'StandardFormBuilder'
183
- set :flash, defined?(Sinatra::Flash) || defined?(Rack::Flash)
184
- set :authentication, false
185
- # Padrino locale
186
- set :locale_path, Proc.new { Dir[File.join(settings.root, '/locale/**/*.{rb,yml}')] }
187
- # Load the Global Configurations
188
- class_eval(&Padrino.apps_configuration) if Padrino.apps_configuration
189
- end
190
-
191
- ##
192
- # We need to add almost __sinatra__ images.
193
- #
194
- def default_routes!
195
- configure :development do
196
- get '*__sinatra__/:image.png' do
197
- content_type :png
198
- filename = File.dirname(__FILE__) + "/images/#{params[:image]}.png"
199
- send_file filename
200
- end
201
- end
202
- end
203
-
204
- ##
205
- # This filter it's used for know the format of the request, and automatically set the content type.
206
- #
207
- def default_filters!
208
- before do
209
- unless @_content_type
210
- @_content_type = :html
211
- response['Content-Type'] = 'text/html;charset=utf-8'
212
- end
213
- end
214
- end
215
-
216
- ##
217
- # This log errors for production environments
218
- #
219
- def default_errors!
220
- configure :production do
221
- error ::Exception do
222
- boom = env['sinatra.error']
223
- logger.error ["#{boom.class} - #{boom.message}:", *boom.backtrace].join("\n ")
224
- response.status = 500
225
- content_type 'text/html'
226
- '<h1>Internal Server Error</h1>'
227
- end unless errors.has_key?(::Exception)
228
- end
229
- end
230
-
231
- ##
232
- # Requires all files within the application load paths
233
- #
234
- def require_dependencies
235
- Padrino.set_load_paths(*load_paths)
236
- Padrino.require_dependencies(dependencies, :force => true)
237
- end
238
-
239
- private
240
- # Overrides the default middleware for Sinatra based on Padrino conventions
241
- # Also initializes the application after setting up the middleware
242
- def setup_default_middleware(builder)
243
- setup_sessions builder
244
- setup_flash builder
245
- builder.use Padrino::ShowExceptions if show_exceptions?
246
- builder.use Padrino::Logger::Rack, uri_root if Padrino.logger && logging?
247
- builder.use Padrino::Reloader::Rack if reload?
248
- builder.use Rack::MethodOverride if method_override?
249
- builder.use Rack::Head
250
- setup_protection builder
251
- setup_application!
252
- end
253
-
254
- # TODO Remove this in a few versions (rack-flash deprecation)
255
- # Move register Sinatra::Flash into setup_default_middleware
256
- # Initializes flash using sinatra-flash or rack-flash
257
- def setup_flash(builder)
258
- register Sinatra::Flash if flash? && defined?(Sinatra::Flash)
259
- if defined?(Rack::Flash) && !defined?(Sinatra::Flash)
260
- logger.warn %Q{
261
- [Deprecation] In Gemfile, 'rack-flash' should be replaced with 'sinatra-flash'!
262
- Rack-Flash is not compatible with later versions of Rack and should be replaced.
263
- }
264
- builder.use Rack::Flash, :sweep => true if flash?
265
- end
266
- end
267
- end # self
268
- end # Application
269
- end # Padrino
@@ -1,53 +0,0 @@
1
- module Padrino
2
-
3
- # List of callers in a Padrino application that should be ignored as part of a stack trace.
4
- PADRINO_IGNORE_CALLERS = [
5
- %r{lib/padrino-.*$}, # all padrino code
6
- %r{/padrino-.*/(lib|bin)}, # all padrino code
7
- %r{/bin/padrino$}, # all padrino code
8
- %r{/sinatra(/(base|main|showexceptions))?\.rb$}, # all sinatra code
9
- %r{lib/tilt.*\.rb$}, # all tilt code
10
- %r{lib/rack.*\.rb$}, # all rack code
11
- %r{lib/mongrel.*\.rb$}, # all mongrel code
12
- %r{lib/shotgun.*\.rb$}, # all shotgun lib
13
- %r{bin/shotgun$}, # shotgun binary
14
- %r{\(.*\)}, # generated code
15
- %r{shoulda/context\.rb$}, # shoulda hacks
16
- %r{mocha/integration}, # mocha hacks
17
- %r{test/unit}, # test unit hacks
18
- %r{rake_test_loader\.rb}, # rake hacks
19
- %r{custom_require\.rb$}, # rubygems require hacks
20
- %r{active_support}, # active_support require hacks
21
- %r{/thor} # thor require hacks
22
- ] unless defined?(PADRINO_IGNORE_CALLERS)
23
-
24
- ##
25
- # Add rubinius (and hopefully other VM implementations) ignore patterns ...
26
- #
27
- PADRINO_IGNORE_CALLERS.concat(RUBY_IGNORE_CALLERS) if defined?(RUBY_IGNORE_CALLERS)
28
-
29
- private
30
- ##
31
- # The filename for the file that is the direct caller (first caller).
32
- #
33
- # @return [String]
34
- # The file the caller method exists in.
35
- #
36
- def self.first_caller
37
- caller_files.first
38
- end
39
-
40
- #
41
- # Like +Kernel#caller+ but excluding certain magic entries and without
42
- # line / method information; the resulting array contains filenames only.
43
- #
44
- # @return [Array<String>]
45
- # The files of the calling methods.
46
- #
47
- def self.caller_files
48
- caller(1).
49
- map { |line| line.split(/:(?=\d|in )/)[0,2] }.
50
- reject { |file,line| PADRINO_IGNORE_CALLERS.any? { |pattern| file =~ pattern } }.
51
- map { |file,line| file }
52
- end
53
- end # Padrino
@@ -1,24 +0,0 @@
1
- module Padrino
2
- module Cli
3
- module Adapter
4
- class << self
5
- # Start for the given options a rackup handler
6
- def start(options)
7
- Padrino.run!(options.symbolize_keys)
8
- end
9
-
10
- # Method that stop (if exist) a running Padrino.application
11
- def stop(options)
12
- options.symbolize_keys!
13
- if File.exist?(options[:pid])
14
- pid = File.read(options[:pid]).to_i
15
- print "=> Sending INT to process with pid #{pid} wait "
16
- Process.kill(2, pid) rescue nil
17
- else
18
- puts "=> #{options[:pid]} not found!"
19
- end
20
- end
21
- end # self
22
- end # Adapter
23
- end # Cli
24
- end # Padrino
@@ -1,150 +0,0 @@
1
- require 'thor'
2
-
3
- module Padrino
4
- module Cli
5
-
6
- class Base < Thor
7
- include Thor::Actions
8
-
9
- class_option :chdir, :type => :string, :aliases => "-c", :desc => "Change to dir before starting"
10
- class_option :environment, :type => :string, :aliases => "-e", :required => true, :default => :development, :desc => "Padrino Environment"
11
- class_option :help, :type => :boolean, :desc => "Show help usage"
12
-
13
- desc "start", "Starts the Padrino application"
14
- method_option :server, :type => :string, :aliases => "-a", :desc => "Rack Handler (default: autodetect)"
15
- method_option :host, :type => :string, :aliases => "-h", :required => true, :default => "0.0.0.0", :desc => "Bind to HOST address"
16
- method_option :port, :type => :numeric, :aliases => "-p", :required => true, :default => 3000, :desc => "Use PORT"
17
- method_option :daemonize, :type => :boolean, :aliases => "-d", :desc => "Run daemonized in the background"
18
- method_option :pid, :type => :string, :aliases => "-i", :desc => "File to store pid"
19
- method_option :debug, :type => :boolean, :desc => "Set debugging flags"
20
- def start
21
- prepare :start
22
- require File.expand_path("../adapter", __FILE__)
23
- require File.expand_path('config/boot.rb')
24
- Padrino::Cli::Adapter.start(options)
25
- end
26
-
27
- desc "s", "Starts the Padrino application"
28
- def s
29
- invoke :start
30
- end
31
-
32
- desc "stop", "Stops the Padrino application"
33
- method_option :pid, :type => :string, :aliases => "-p", :desc => "File to store pid", :default => 'tmp/pids/server.pid'
34
- def stop
35
- prepare :stop
36
- require File.expand_path("../adapter", __FILE__)
37
- Padrino::Cli::Adapter.stop(options)
38
- end
39
-
40
- desc "rake", "Execute rake tasks"
41
- method_option :environment, :type => :string, :aliases => "-e", :required => true, :default => :development
42
- method_option :list, :type => :string, :aliases => "-T", :desc => "Display the tasks (matching optional PATTERN) with descriptions, then exit."
43
- method_option :trace, :type => :boolean, :aliases => "-t", :desc => "Turn on invoke/execute tracing, enable full backtrace."
44
- def rake(*args)
45
- prepare :rake
46
- args << "-T" if options[:list]
47
- args << options[:list] unless options[:list].nil? || options[:list].to_s == "list"
48
- args << "--trace" if options[:trace]
49
- args << "--verbose" if options[:verbose]
50
- ARGV.clear
51
- ARGV.concat(args)
52
- puts "=> Executing Rake #{ARGV.join(' ')} ..."
53
- load File.expand_path('../rake.rb', __FILE__)
54
- require File.expand_path('config/boot.rb')
55
- PadrinoTasks.init(true)
56
- end
57
-
58
- desc "console", "Boots up the Padrino application irb console"
59
- def console
60
- prepare :console
61
- require File.expand_path("../../version", __FILE__)
62
- ARGV.clear
63
- require 'irb'
64
- require "irb/completion"
65
- require File.expand_path('config/boot.rb')
66
- puts "=> Loading #{Padrino.env} console (Padrino v.#{Padrino.version})"
67
- require File.expand_path('../console', __FILE__)
68
- IRB.start
69
- end
70
-
71
- desc "generate", "Executes the Padrino generator with given options."
72
- def generate(*args)
73
- # Build Padrino g as an alias of padrino-gen
74
- begin
75
- # We try to load the vendored padrino-gen if exist
76
- padrino_gen_path = File.expand_path('../../../../../padrino-gen/lib', __FILE__)
77
- $:.unshift(padrino_gen_path) if File.directory?(padrino_gen_path) && !$:.include?(padrino_gen_path)
78
- require 'padrino-core/command'
79
- require 'padrino-gen/command'
80
- ARGV.shift
81
- ARGV << 'help' if ARGV.empty?
82
- Padrino.bin_gen(*ARGV)
83
- rescue
84
- puts "<= You need padrino-gen! Run: gem install padrino-gen"
85
- end
86
- end
87
-
88
- desc "g", "Executes the Padrino generator with given options."
89
- def g(*args)
90
- invoke(:generate, args)
91
- end
92
-
93
- desc "gen", "Executes the Padrino generator with given options."
94
- def gen(*args)
95
- invoke(:generate, args)
96
- end
97
-
98
- desc "version", "Show current Padrino Version"
99
- map "-v" => :version, "--version" => :version
100
- def version
101
- require 'padrino-core/version'
102
- puts "Padrino v. #{Padrino.version}"
103
- end
104
-
105
- private
106
- def prepare(task)
107
- if options.help?
108
- help(task.to_s)
109
- raise SystemExit
110
- end
111
- ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= options.environment.to_s
112
- chdir(options.chdir)
113
- unless File.exist?('config/boot.rb')
114
- puts "=> Could not find boot file in: #{options.chdir}/config/boot.rb !!!"
115
- raise SystemExit
116
- end
117
- end
118
-
119
- protected
120
- def self.banner(task=nil, *args)
121
- "padrino #{task.name}"
122
- end
123
-
124
- def chdir(dir)
125
- return unless dir
126
- begin
127
- Dir.chdir(dir.to_s)
128
- rescue Errno::ENOENT
129
- puts "=> Specified Padrino root '#{dir}' does not appear to exist!"
130
- rescue Errno::EACCES
131
- puts "=> Specified Padrino root '#{dir}' cannot be accessed by the current user!"
132
- end
133
- end
134
-
135
- def capture(stream)
136
- begin
137
- stream = stream.to_s
138
- eval "$#{stream} = StringIO.new"
139
- yield
140
- result = eval("$#{stream}").string
141
- ensure
142
- eval("$#{stream} = #{stream.upcase}")
143
- end
144
-
145
- result
146
- end
147
- alias :silence :capture
148
- end # Base
149
- end # Cli
150
- end # Padrino
@@ -1,20 +0,0 @@
1
- # Reloads classes
2
- def reload!
3
- Padrino.reload!
4
- end
5
-
6
- # Show applications
7
- def applications
8
- puts "==== List of Mounted Applications ====\n\n"
9
- Padrino.mounted_apps.each do |app|
10
- puts " * %-10s mapped to %s" % [app.name, app.uri_root]
11
- end
12
- puts
13
- Padrino.mounted_apps.map { |app| "#{app.name} => #{app.uri_root}" }
14
- end
15
-
16
- # Load apps
17
- Padrino.mounted_apps.each do |app|
18
- puts "=> Loading Application #{app.app_class}"
19
- app.app_obj.setup_application!
20
- end
@@ -1,24 +0,0 @@
1
- require File.expand_path('../../tasks', __FILE__)
2
- require 'rake'
3
- require 'thor'
4
- require 'securerandom' unless defined?(SecureRandom)
5
-
6
- module PadrinoTasks
7
- def self.init(init=false)
8
- Padrino::Tasks.files.flatten.uniq.each { |rakefile| Rake.application.add_import(rakefile) rescue puts "<= Failed load #{ext}" }
9
- if init
10
- Rake.application.init
11
- Rake.application.instance_variable_set(:@rakefile, __FILE__)
12
- load(File.expand_path('../rake_tasks.rb', __FILE__))
13
- Rake.application.load_imports
14
- Rake.application.top_level
15
- else
16
- load(File.expand_path('../rake_tasks.rb', __FILE__))
17
- Rake.application.load_imports
18
- end
19
- end
20
- end
21
-
22
- def shell
23
- @_shell ||= Thor::Base.shell.new
24
- end
@@ -1,59 +0,0 @@
1
- # Load rake tasks from common rake task definition locations
2
- Dir["lib/tasks/**/*.rake"].
3
- concat(Dir["tasks/**/*.rake"]).
4
- concat(Dir["{test,spec}/*.rake"]).each { |rake| load(rake) }
5
-
6
- # Loads the Padrino applications mounted within the project
7
- # setting up the required environment for Padrino
8
- task :environment do
9
- Padrino.mounted_apps.each do |app|
10
- app.app_obj.setup_application!
11
- end
12
- end
13
-
14
- desc "Generate a secret key"
15
- task :secret do
16
- shell.say SecureRandom.hex(32)
17
- end
18
-
19
- # lists all routes of a given app
20
- def list_app_routes(app, args)
21
- app_routes = app.named_routes
22
- app_routes.reject! { |r| r.identifier.to_s !~ /#{args.query}/ } if args.query.present?
23
- app_routes.map! { |r| [r.verb, r.name, r.path] }
24
- return if app_routes.empty?
25
- shell.say "\nApplication: #{app.app_class}", :yellow
26
- app_routes.unshift(["REQUEST", "URL", "PATH"])
27
- max_col_1 = app_routes.max { |a, b| a[0].size <=> b[0].size }[0].size
28
- max_col_2 = app_routes.max { |a, b| a[1].size <=> b[1].size }[1].size
29
- app_routes.each_with_index do |row, i|
30
- message = [row[1].ljust(max_col_2+2), row[0].center(max_col_1+2), row[2]]
31
- shell.say(" " + message.join(" "), i==0 ? :bold : nil)
32
- end
33
- end
34
-
35
- desc "Displays a listing of the named routes within a project, optionally only those matched by [query]"
36
- task :routes, [:query] => :environment do |t, args|
37
- Padrino.mounted_apps.each do |app|
38
- list_app_routes(app, args)
39
- end
40
- end
41
-
42
- desc "Displays a listing of the named routes a given app [app]"
43
- namespace :routes do
44
- task :app, [:app] => :environment do |t, args|
45
- app = Padrino.mounted_apps.find { |app| app.app_class == args.app }
46
- list_app_routes(app, args) if app
47
- end
48
- end
49
-
50
- desc "Generate the Rakefile"
51
- task :gen do
52
- File.open(Padrino.root("Rakefile"), "w") do |file|
53
- file.puts <<-RUBY.gsub(/^ {6}/, '')
54
- require File.expand_path('../config/boot.rb', __FILE__)
55
- require 'padrino-core/cli/rake'
56
- PadrinoTasks.init
57
- RUBY
58
- end
59
- end
@@ -1,38 +0,0 @@
1
- require 'rbconfig'
2
-
3
- module Padrino
4
- ##
5
- # This method return the correct location of padrino bin or
6
- # exec it using Kernel#system with the given args
7
- #
8
- # @param [Array] args
9
- # command or commands to execute
10
- #
11
- # @return [Boolean]
12
- #
13
- # @example
14
- # Padrino.bin('start', '-e production')
15
- #
16
- def self.bin(*args)
17
- @_padrino_bin ||= [self.ruby_command, File.expand_path("../../../bin/padrino", __FILE__)]
18
- args.empty? ? @_padrino_bin : system(args.unshift(@_padrino_bin).join(" "))
19
- end
20
-
21
- ##
22
- # Return the path to the ruby interpreter taking into account multiple
23
- # installations and windows extensions.
24
- #
25
- # @return [String]
26
- # path to ruby bin executable
27
- #
28
- def self.ruby_command
29
- @ruby_command ||= begin
30
- ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
31
- ruby << RbConfig::CONFIG['EXEEXT']
32
-
33
- # escape string in case path to ruby executable contain spaces.
34
- ruby.sub!(/.*\s.*/m, '"\&"')
35
- ruby
36
- end
37
- end
38
- end # Padrino