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,190 +1,211 @@
1
1
  # Used for merging results of metadata callbacks
2
2
  require "active_support/core_ext/hash/deep_merge"
3
3
 
4
- # Sitemap namespace
5
- module Middleman::Sitemap
4
+ module Middleman
6
5
 
7
- # The Store class
8
- #
9
- # The Store manages a collection of Resource objects, which represent
10
- # individual items in the sitemap. Resources are indexed by "source path",
11
- # which is the path relative to the source directory, minus any template
12
- # extensions. All "path" parameters used in this class are source paths.
13
- class Store
6
+ # Sitemap namespace
7
+ module Sitemap
8
+
9
+ # The Store class
10
+ #
11
+ # The Store manages a collection of Resource objects, which represent
12
+ # individual items in the sitemap. Resources are indexed by "source path",
13
+ # which is the path relative to the source directory, minus any template
14
+ # extensions. All "path" parameters used in this class are source paths.
15
+ class Store
14
16
 
15
- # @return [Middleman::Application]
16
- attr_accessor :app
17
+ # @return [Middleman::Application]
18
+ attr_accessor :app
17
19
 
18
- # Initialize with parent app
19
- # @param [Middleman::Application] app
20
- def initialize(app)
21
- @app = app
22
- @resources = []
23
-
24
- @_lookup_cache = { :path => {}, :destination_path => {} }
25
- @resource_list_manipulators = []
26
-
27
- # Register classes which can manipulate the main site map list
28
- register_resource_list_manipulator(:on_disk, Middleman::Sitemap::Extensions::OnDisk.new(self), false)
20
+ # Initialize with parent app
21
+ # @param [Middleman::Application] app
22
+ def initialize(app)
23
+ @app = app
24
+ @resources = []
25
+ @_cached_metadata = {}
26
+ @_lookup_cache = { :path => {}, :destination_path => {} }
27
+ @resource_list_manipulators = []
29
28
 
30
- # Proxies
31
- register_resource_list_manipulator(:proxies, @app.proxy_manager, false)
29
+ # Register classes which can manipulate the main site map list
30
+ register_resource_list_manipulator(:on_disk, Middleman::Sitemap::Extensions::OnDisk.new(self), false)
32
31
 
33
- # Ignores
34
- register_resource_list_manipulator(:ignores, @app.ignore_manager, false)
35
-
36
- rebuild_resource_list!(:after_base_init)
37
- end
32
+ # Proxies
33
+ register_resource_list_manipulator(:proxies, @app.proxy_manager, false)
34
+ end
38
35
 
39
- # Register a klass which can manipulate the main site map list
40
- # @param [Class] klass
41
- # @param [Boolean] immediately_rebuild
42
- # @return [void]
43
- def register_resource_list_manipulator(name, inst, immediately_rebuild=true)
44
- @resource_list_manipulators << [name, inst]
45
- rebuild_resource_list!(:registered_new) if immediately_rebuild
46
- end
47
-
48
- # Rebuild the list of resources from scratch, using registed manipulators
49
- # @return [void]
50
- def rebuild_resource_list!(reason=nil)
51
- @resources = @resource_list_manipulators.inject([]) do |result, (_, inst)|
52
- inst.manipulate_resource_list(result)
36
+ # Register a klass which can manipulate the main site map list
37
+ # @param [Symbol] name Name of the manipulator for debugging
38
+ # @param [Class, Module] inst Abstract namespace which can update the resource list
39
+ # @param [Boolean] immediately_rebuild Whether the resource list should be immediately recalculated
40
+ # @return [void]
41
+ def register_resource_list_manipulator(name, inst, immediately_rebuild=true)
42
+ @resource_list_manipulators << [name, inst]
43
+ rebuild_resource_list!(:registered_new) if immediately_rebuild
53
44
  end
45
+
46
+ # Rebuild the list of resources from scratch, using registed manipulators
47
+ # @return [void]
48
+ def rebuild_resource_list!(reason=nil)
49
+ @resources = @resource_list_manipulators.inject([]) do |result, (_, inst)|
50
+ inst.manipulate_resource_list(result)
51
+ end
54
52
 
55
- # Reset lookup cache
56
- @_lookup_cache = { :path => {}, :destination_path => {} }
57
- @resources.each do |resource|
58
- @_lookup_cache[:path][resource.path] = resource
59
- @_lookup_cache[:destination_path][resource.destination_path] = resource
53
+ # Reset lookup cache
54
+ @_lookup_cache = { :path => {}, :destination_path => {} }
55
+ @resources.each do |resource|
56
+ @_lookup_cache[:path][resource.path] = resource
57
+ @_lookup_cache[:destination_path][resource.destination_path] = resource
58
+ end
60
59
  end
61
- end
62
60
 
63
- # Find a resource given its original path
64
- # @param [String] request_path The original path of a resource.
65
- # @return [Middleman::Sitemap::Resource]
66
- def find_resource_by_path(request_path)
67
- request_path = ::Middleman::Util.normalize_path(request_path)
68
- @_lookup_cache[:path][request_path]
69
- end
61
+ # Find a resource given its original path
62
+ # @param [String] request_path The original path of a resource.
63
+ # @return [Middleman::Sitemap::Resource]
64
+ def find_resource_by_path(request_path)
65
+ request_path = ::Middleman::Util.normalize_path(request_path)
66
+ @_lookup_cache[:path][request_path]
67
+ end
70
68
 
71
- # Find a resource given its destination path
72
- # @param [String] request_path The destination (output) path of a resource.
73
- # @return [Middleman::Sitemap::Resource]
74
- def find_resource_by_destination_path(request_path)
75
- request_path = ::Middleman::Util.normalize_path(request_path)
76
- @_lookup_cache[:destination_path][request_path]
77
- end
69
+ # Find a resource given its destination path
70
+ # @param [String] request_path The destination (output) path of a resource.
71
+ # @return [Middleman::Sitemap::Resource]
72
+ def find_resource_by_destination_path(request_path)
73
+ request_path = ::Middleman::Util.normalize_path(request_path)
74
+ @_lookup_cache[:destination_path][request_path]
75
+ end
78
76
 
79
- # Get the array of all resources
80
- # @param [Boolean] include_ignored Whether to include ignored resources
81
- # @return [Array<Middleman::Sitemap::Resource>]
82
- def resources(include_ignored=false)
83
- if include_ignored
84
- @resources
85
- else
86
- @resources.reject(&:ignored?)
77
+ # Get the array of all resources
78
+ # @param [Boolean] include_ignored Whether to include ignored resources
79
+ # @return [Array<Middleman::Sitemap::Resource>]
80
+ def resources(include_ignored=false)
81
+ if include_ignored
82
+ @resources
83
+ else
84
+ @resources.reject(&:ignored?)
85
+ end
87
86
  end
88
- end
89
87
 
90
- # Register a handler to provide metadata on a file path
91
- # @param [Regexp] matcher
92
- # @return [Array<Array<Proc, Regexp>>]
93
- def provides_metadata(matcher=nil, &block)
94
- @_provides_metadata ||= []
95
- @_provides_metadata << [block, matcher] if block_given?
96
- @_provides_metadata
97
- end
88
+ # Register a handler to provide metadata on a file path
89
+ # @param [Regexp] matcher
90
+ # @return [Array<Array<Proc, Regexp>>]
91
+ def provides_metadata(matcher=nil, &block)
92
+ @_provides_metadata ||= []
93
+ @_provides_metadata << [block, matcher] if block_given?
94
+ @_provides_metadata
95
+ end
98
96
 
99
- # Get the metadata for a specific file
100
- # @param [String] source_file
101
- # @return [Hash]
102
- def metadata_for_file(source_file)
103
- blank_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
97
+ # Get the metadata for a specific file
98
+ # @param [String] source_file
99
+ # @return [Hash]
100
+ def metadata_for_file(source_file)
101
+ blank_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
104
102
 
105
- provides_metadata.inject(blank_metadata) do |result, (callback, matcher)|
106
- next result if !matcher.nil? && !source_file.match(matcher)
103
+ provides_metadata.inject(blank_metadata) do |result, (callback, matcher)|
104
+ next result if !matcher.nil? && !source_file.match(matcher)
107
105
 
108
- metadata = callback.call(source_file)
109
- result.deep_merge(metadata)
106
+ metadata = callback.call(source_file)
107
+
108
+ if metadata.has_key?(:blocks)
109
+ result[:blocks] << metadata[:blocks]
110
+ metadata.delete(:blocks)
111
+ end
112
+
113
+ result.deep_merge(metadata)
114
+ end
110
115
  end
111
- end
112
116
 
113
- # Register a handler to provide metadata on a url path
114
- # @param [Regexp] matcher
115
- # @return [Array<Array<Proc, Regexp>>]
116
- def provides_metadata_for_path(matcher=nil, &block)
117
- @_provides_metadata_for_path ||= []
118
- @_provides_metadata_for_path << [block, matcher] if block_given?
119
- @_provides_metadata_for_path
120
- end
117
+ # Register a handler to provide metadata on a url path
118
+ # @param [Regexp] matcher
119
+ # @param [Symbol] origin an indicator of where this metadata came from - only one
120
+ # block per [matcher, origin] pair may exist.
121
+ # @return [Array<Array<Proc, Regexp>>]
122
+ def provides_metadata_for_path(matcher=nil, origin=nil, &block)
123
+ @_provides_metadata_for_path ||= []
124
+ if block_given?
125
+ if origin
126
+ existing_provider = @_provides_metadata_for_path.find {|b,m,o| o == origin && m == matcher}
127
+ end
128
+
129
+ if existing_provider
130
+ existing_provider[0] = block
131
+ else
132
+ @_provides_metadata_for_path << [block, matcher, origin]
133
+ end
134
+
135
+ @_cached_metadata = {}
136
+ end
137
+ @_provides_metadata_for_path
138
+ end
121
139
 
122
- # Get the metadata for a specific URL
123
- # @param [String] request_path
124
- # @return [Hash]
125
- def metadata_for_path(request_path)
126
- blank_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
140
+ # Get the metadata for a specific URL
141
+ # @param [String] request_path
142
+ # @return [Hash]
143
+ def metadata_for_path(request_path)
144
+ return @_cached_metadata[request_path] if @_cached_metadata[request_path]
145
+
146
+ blank_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
127
147
 
128
- provides_metadata_for_path.inject(blank_metadata) do |result, (callback, matcher)|
129
- case matcher
130
- when Regexp
131
- next result unless request_path.match(matcher)
132
- when String
133
- next result unless File.fnmatch("/" + matcher.sub(%r{^/}, ''), "/#{request_path}")
134
- end
148
+ @_cached_metadata[request_path] = provides_metadata_for_path.inject(blank_metadata) do |result, (callback, matcher)|
149
+ case matcher
150
+ when Regexp
151
+ next result unless request_path.match(matcher)
152
+ when String
153
+ next result unless File.fnmatch("/" + matcher.sub(%r{^/}, ''), "/#{request_path}")
154
+ end
135
155
 
136
- metadata = callback.call(request_path)
156
+ metadata = callback.call(request_path)
137
157
 
138
- if metadata.has_key?(:blocks)
139
- result[:blocks] << metadata[:blocks]
140
- metadata.delete(:blocks)
141
- end
158
+ if metadata.has_key?(:blocks)
159
+ result[:blocks] << metadata[:blocks]
160
+ metadata.delete(:blocks)
161
+ end
142
162
 
143
- result.deep_merge(metadata)
163
+ result.deep_merge(metadata)
164
+ end
144
165
  end
145
- end
146
166
 
147
- # Get the URL path for an on-disk file
148
- # @param [String] file
149
- # @return [String]
150
- def file_to_path(file)
151
- file = File.expand_path(file, @app.root)
167
+ # Get the URL path for an on-disk file
168
+ # @param [String] file
169
+ # @return [String]
170
+ def file_to_path(file)
171
+ file = File.expand_path(file, @app.root)
152
172
 
153
- prefix = @app.source_dir.sub(/\/$/, "") + "/"
154
- return false unless file.include?(prefix)
173
+ prefix = @app.source_dir.sub(/\/$/, "") + "/"
174
+ return false unless file.include?(prefix)
155
175
 
156
- path = file.sub(prefix, "")
157
- extensionless_path(path)
158
- end
176
+ path = file.sub(prefix, "")
177
+ extensionless_path(path)
178
+ end
159
179
 
160
- # Get a path without templating extensions
161
- # @param [String] file
162
- # @return [String]
163
- def extensionless_path(file)
164
- path = file.dup
180
+ # Get a path without templating extensions
181
+ # @param [String] file
182
+ # @return [String]
183
+ def extensionless_path(file)
184
+ path = file.dup
165
185
 
166
- end_of_the_line = false
167
- while !end_of_the_line
168
- if !::Tilt[path].nil?
169
- path = path.sub(File.extname(path), "")
170
- else
171
- end_of_the_line = true
186
+ end_of_the_line = false
187
+ while !end_of_the_line
188
+ if !::Tilt[path].nil?
189
+ path = path.sub(File.extname(path), "")
190
+ else
191
+ end_of_the_line = true
192
+ end
172
193
  end
173
- end
174
194
 
175
- # If there is no extension, look for one
176
- if File.extname(path).empty?
177
- input_ext = File.extname(file)
195
+ # If there is no extension, look for one
196
+ if File.extname(path).empty?
197
+ input_ext = File.extname(file)
178
198
 
179
- if !input_ext.empty?
180
- input_ext = input_ext.split(".").last.to_sym
181
- if @app.template_extensions.has_key?(input_ext)
182
- path << ".#{@app.template_extensions[input_ext]}"
199
+ if !input_ext.empty?
200
+ input_ext = input_ext.split(".").last.to_sym
201
+ if @app.template_extensions.has_key?(input_ext)
202
+ path << ".#{@app.template_extensions[input_ext]}"
203
+ end
183
204
  end
184
205
  end
185
- end
186
206
 
187
- path
207
+ path
208
+ end
188
209
  end
189
210
  end
190
- end
211
+ end
@@ -1,78 +1,78 @@
1
+ require "middleman-core/sitemap/store"
2
+ require "middleman-core/sitemap/resource"
3
+
4
+ require "middleman-core/sitemap/extensions/on_disk"
5
+ require "middleman-core/sitemap/extensions/proxies"
6
+ require "middleman-core/sitemap/extensions/ignores"
7
+
1
8
  # Core Sitemap Extensions
2
- module Middleman::Sitemap
9
+ module Middleman
3
10
 
4
- autoload :Store, "middleman-core/sitemap/store"
5
- autoload :Resource, "middleman-core/sitemap/resource"
11
+ module Sitemap
6
12
 
7
- module Extensions
8
- autoload :OnDisk, "middleman-core/sitemap/extensions/on_disk"
9
- autoload :Proxies, "middleman-core/sitemap/extensions/proxies"
10
- autoload :Ignores, "middleman-core/sitemap/extensions/ignores"
11
- autoload :Traversal, "middleman-core/sitemap/extensions/traversal"
12
- end
13
-
14
- # Setup Extension
15
- class << self
13
+ # Setup Extension
14
+ class << self
16
15
 
17
- # Once registered
18
- def registered(app)
16
+ # Once registered
17
+ def registered(app)
19
18
 
20
- app.register Middleman::Sitemap::Extensions::Proxies
21
- app.register Middleman::Sitemap::Extensions::Ignores
19
+ app.register Middleman::Sitemap::Extensions::Proxies
20
+ app.register Middleman::Sitemap::Extensions::Ignores
22
21
 
23
- # Setup callbacks which can exclude paths from the sitemap
24
- app.set :ignored_sitemap_matchers, {
25
- # dotfiles and folders in the root
26
- :root_dotfiles => proc { |file, path| file.match(/^\./) },
22
+ # Setup callbacks which can exclude paths from the sitemap
23
+ app.set :ignored_sitemap_matchers, {
24
+ # dotfiles and folders in the root
25
+ :root_dotfiles => proc { |file, path| file.match(/^\./) },
27
26
 
28
- # Files starting with an dot, but not .htaccess
29
- :source_dotfiles => proc { |file, path|
30
- (file.match(/\/\./) && !file.match(/\/\.htaccess/))
31
- },
27
+ # Files starting with an dot, but not .htaccess
28
+ :source_dotfiles => proc { |file, path|
29
+ (file.match(/\/\./) && !file.match(/\/\.htaccess/))
30
+ },
32
31
 
33
- # Files starting with an underscore, but not a double-underscore
34
- :partials => proc { |file, path| (file.match(/\/_/) && !file.match(/\/__/)) },
32
+ # Files starting with an underscore, but not a double-underscore
33
+ :partials => proc { |file, path| (file.match(/\/_/) && !file.match(/\/__/)) },
35
34
 
36
- :layout => proc { |file, path|
37
- file.match(/^source\/layout\./) || file.match(/^source\/layouts\//)
38
- },
35
+ :layout => proc { |file, path|
36
+ file.match(/^source\/layout\./) || file.match(/^source\/layouts\//)
37
+ },
39
38
 
40
- # Files without any output extension (layouts, partials)
41
- # :extensionless => proc { |file, path| !path.match(/\./) },
42
- }
39
+ # Files without any output extension (layouts, partials)
40
+ # :extensionless => proc { |file, path| !path.match(/\./) },
41
+ }
43
42
 
44
- # Include instance methods
45
- app.send :include, InstanceMethods
43
+ # Include instance methods
44
+ app.send :include, InstanceMethods
46
45
 
47
- # Initialize Sitemap
48
- app.before_configuration do
49
- sitemap
46
+ # Initialize Sitemap
47
+ app.before_configuration do
48
+ sitemap
49
+ end
50
50
  end
51
- end
52
- alias :included :registered
51
+ alias :included :registered
53
52
 
54
- end
53
+ end
55
54
 
56
- # Sitemap instance methods
57
- module InstanceMethods
55
+ # Sitemap instance methods
56
+ module InstanceMethods
58
57
 
59
- # Get the sitemap class instance
60
- # @return [Middleman::Sitemap::Store]
61
- def sitemap
62
- @_sitemap ||= Store.new(self)
63
- end
58
+ # Get the sitemap class instance
59
+ # @return [Middleman::Sitemap::Store]
60
+ def sitemap
61
+ @_sitemap ||= Store.new(self)
62
+ end
64
63
 
65
- # Get the resource object for the current path
66
- # @return [Middleman::Sitemap::Resource]
67
- def current_page
68
- current_resource
69
- end
64
+ # Get the resource object for the current path
65
+ # @return [Middleman::Sitemap::Resource]
66
+ def current_page
67
+ current_resource
68
+ end
70
69
 
71
- # Get the resource object for the current path
72
- # @return [Middleman::Sitemap::Resource]
73
- def current_resource
74
- sitemap.find_resource_by_destination_path(current_path)
75
- end
70
+ # Get the resource object for the current path
71
+ # @return [Middleman::Sitemap::Resource]
72
+ def current_resource
73
+ sitemap.find_resource_by_destination_path(current_path)
74
+ end
76
75
 
76
+ end
77
77
  end
78
78
  end
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require "rack/test"
2
4
 
3
5
  Given /^a clean server$/ do
@@ -12,6 +14,14 @@ Given /^"([^\"]*)" feature is "([^\"]*)"$/ do |feature, state|
12
14
  end
13
15
  end
14
16
 
17
+ Given /^"([^\"]*)" feature is "enabled" with "([^\"]*)"$/ do |feature, options_str|
18
+ @initialize_commands ||= []
19
+
20
+ options = eval("{#{options_str}}")
21
+
22
+ @initialize_commands << lambda { activate(feature.to_sym, options) }
23
+ end
24
+
15
25
  Given /^"([^\"]*)" is set to "([^\"]*)"$/ do |variable, value|
16
26
  @initialize_commands ||= []
17
27
  @initialize_commands << lambda { set(variable.to_sym, value) }
@@ -37,7 +47,7 @@ Given /^the Server is running$/ do
37
47
  set :show_exceptions, false
38
48
  }
39
49
 
40
- @server_inst = Middleman.server.inst do
50
+ @server_inst = Middleman::Application.server.inst do
41
51
  initialize_commands.each do |p|
42
52
  instance_exec(&p)
43
53
  end
@@ -53,11 +63,11 @@ Given /^the Server is running at "([^\"]*)"$/ do |app_path|
53
63
  end
54
64
 
55
65
  When /^I go to "([^\"]*)"$/ do |url|
56
- @browser.get(url)
66
+ @browser.get(URI.escape(url))
57
67
  end
58
68
 
59
69
  Then /^going to "([^\"]*)" should not raise an exception$/ do |url|
60
- lambda { @browser.get(url) }.should_not raise_exception
70
+ lambda { @browser.get(URI.escape(url)) }.should_not raise_exception
61
71
  end
62
72
 
63
73
  Then /^I should see "([^\"]*)"$/ do |expected|
@@ -0,0 +1,4 @@
1
+ source :rubygems
2
+
3
+ # Specify your gem's dependencies in <%= name %>.gemspec
4
+ gemspec
@@ -0,0 +1,12 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'cucumber/rake/task'
5
+
6
+ Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
+ t.cucumber_opts = "--color --tags ~@wip --strict --format #{ENV['CUCUMBER_FORMAT'] || 'Fivemat'}"
8
+ end
9
+
10
+ require 'rake/clean'
11
+
12
+ task :test => ["cucumber"]
@@ -0,0 +1,4 @@
1
+ PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
2
+ require "middleman-core"
3
+ require "middleman-core/step_definitions"
4
+ require File.join(PROJECT_ROOT_PATH, 'lib', '<%= name %>')
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "<%= name %>"
6
+ s.version = "0.0.1"
7
+ s.platform = Gem::Platform::RUBY
8
+ # s.authors = ["Your Name"]
9
+ # s.email = ["email@example.com"]
10
+ # s.homepage = "http://example.com"
11
+ # s.summary = %q{A short summary of your extension}
12
+ # s.description = %q{A longer description of your extension}
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
16
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
17
+ s.require_paths = ["lib"]
18
+
19
+ # The version of middleman-core your extension depends on
20
+ s.add_runtime_dependency("middleman-core", [">= 3.0.0.beta.2"])
21
+
22
+ # Additional dependencies
23
+ # s.add_runtime_dependency("gem-name", "gem-version")
24
+ end
@@ -0,0 +1,49 @@
1
+ # Require core library
2
+ require "middleman-core"
3
+
4
+ # Extension namespace
5
+ module MyExtension
6
+ class << self
7
+
8
+ # Called when user `activate`s your extension
9
+ def registered(app, options={})
10
+ # Setup extension-specific config
11
+ app.set :config_variable, false
12
+
13
+ # Include class methods
14
+ # app.extend ClassMethods
15
+
16
+ # Include instance methods
17
+ # app.send :include, InstanceMethods
18
+
19
+ app.after_configuration do
20
+ # Do something
21
+
22
+ # config_variable is now either the default or the user's
23
+ # setting from config.rb
24
+ end
25
+ end
26
+ alias :included :registered
27
+ end
28
+
29
+ # module ClassMethods
30
+ # def a_class_method
31
+ # end
32
+ # end
33
+
34
+ # module InstanceMethods
35
+ # def an_instance_method
36
+ # end
37
+ # end
38
+
39
+ end
40
+
41
+
42
+ # Register extensions which can be activated
43
+ # Make sure we have the version of Middleman we expect
44
+ # ::Middleman::Extensions.register(:extension_name, ">= 3.0.0.beta.2") do
45
+ #
46
+ # # Return the extension module
47
+ # ::MyExtension
48
+ #
49
+ # end
@@ -0,0 +1 @@
1
+ require "<%= name %>"
@@ -0,0 +1,14 @@
1
+ # See http://help.github.com/ignore-files/ for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile ~/.gitignore_global
6
+
7
+ # Ignore bundler config
8
+ /.bundle
9
+
10
+ # Ignore the build directory
11
+ /build
12
+
13
+ # Ignore Sass' cache
14
+ /.sass-cache