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.
- data/features/cli_extension.feature +13 -0
- data/features/{cli.feature → cli_init.feature} +1 -10
- data/features/directory_index.feature +29 -1
- data/features/dynamic_pages.feature +1 -0
- data/features/extensionless_text_files.feature +0 -2
- data/features/front-matter.feature +17 -1
- data/features/frontmatter_page_settings.feature +16 -1
- data/features/helpers_relative_link_to.feature +68 -0
- data/features/unicode_filenames.feature +14 -0
- data/fixtures/csspie/config.rb +0 -0
- data/fixtures/csspie/source/stylesheets/PIE.htc +96 -0
- data/fixtures/dynamic-pages-app/config.rb +3 -0
- data/fixtures/frontmatter-app/source/front-matter-auto.erb +6 -0
- data/fixtures/frontmatter-app/source/front-matter.html.erb +2 -0
- data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +7 -0
- data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +6 -0
- data/fixtures/frontmatter-app/source/json-front-matter.html.erb +6 -0
- data/fixtures/unicode-filenames-app/config.rb +1 -0
- data/fixtures/unicode-filenames-app/source/snowmen-rule-/342/230/203.html +4 -0
- data/lib/middleman-core/application.rb +43 -335
- data/lib/middleman-core/cli/build.rb +11 -4
- data/lib/middleman-core/cli/bundler.rb +40 -0
- data/lib/middleman-core/cli/extension.rb +36 -0
- data/lib/middleman-core/cli/server.rb +2 -2
- data/lib/middleman-core/cli.rb +2 -6
- data/lib/middleman-core/core_extensions/assets.rb +35 -31
- data/lib/middleman-core/core_extensions/builder.rb +14 -9
- data/lib/middleman-core/core_extensions/data.rb +150 -145
- data/lib/middleman-core/core_extensions/default_helpers.rb +159 -97
- data/lib/middleman-core/core_extensions/extensions.rb +103 -97
- data/lib/middleman-core/core_extensions/external_helpers.rb +27 -23
- data/lib/middleman-core/core_extensions/file_watcher.rb +140 -110
- data/lib/middleman-core/core_extensions/front_matter.rb +155 -175
- data/lib/middleman-core/core_extensions/i18n.rb +111 -102
- data/lib/middleman-core/core_extensions/rendering.rb +293 -295
- data/lib/middleman-core/core_extensions/request.rb +338 -0
- data/lib/middleman-core/core_extensions/routing.rb +72 -68
- data/lib/middleman-core/core_extensions/show_exceptions.rb +23 -18
- data/lib/middleman-core/core_extensions.rb +39 -0
- data/lib/middleman-core/extensions/directory_indexes.rb +1 -4
- data/lib/middleman-core/extensions/lorem.rb +10 -3
- data/lib/middleman-core/extensions.rb +2 -64
- data/lib/middleman-core/preview_server.rb +157 -0
- data/lib/middleman-core/sitemap/extensions/ignores.rb +73 -68
- data/lib/middleman-core/sitemap/extensions/on_disk.rb +65 -58
- data/lib/middleman-core/sitemap/extensions/proxies.rb +86 -75
- data/lib/middleman-core/sitemap/extensions/traversal.rb +68 -61
- data/lib/middleman-core/sitemap/resource.rb +123 -102
- data/lib/middleman-core/sitemap/store.rb +170 -149
- data/lib/middleman-core/sitemap.rb +57 -57
- data/lib/middleman-core/step_definitions/server_steps.rb +13 -3
- data/lib/middleman-core/templates/extension/Gemfile +4 -0
- data/lib/middleman-core/templates/extension/Rakefile +12 -0
- data/lib/middleman-core/templates/extension/features/support/env.rb +4 -0
- data/lib/middleman-core/templates/extension/gemspec +24 -0
- data/lib/middleman-core/templates/extension/lib/lib.rb +49 -0
- data/lib/middleman-core/templates/extension/lib/middleman_extension.rb +1 -0
- data/lib/middleman-core/templates/shared/gitignore +14 -0
- data/lib/middleman-core/templates.rb +14 -8
- data/lib/middleman-core/util.rb +31 -9
- data/lib/middleman-core/version.rb +1 -1
- data/lib/middleman-core.rb +6 -4
- data/middleman-core.gemspec +4 -6
- metadata +62 -203
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.document +0 -5
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.gitignore +0 -22
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.yardopts +0 -1
- data/lib/middleman-core/vendor/padrino-core-0.10.6/LICENSE.txt +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/README.rdoc +0 -294
- data/lib/middleman-core/vendor/padrino-core-0.10.6/Rakefile +0 -5
- data/lib/middleman-core/vendor/padrino-core-0.10.6/bin/padrino +0 -9
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/rendering.rb +0 -292
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/routing.rb +0 -943
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/showexceptions.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application.rb +0 -269
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/caller.rb +0 -53
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/adapter.rb +0 -24
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/base.rb +0 -150
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/console.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake.rb +0 -24
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake_tasks.rb +0 -59
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/command.rb +0 -38
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/404.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/500.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/loader.rb +0 -211
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/cs.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/da.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/de.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/en.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/es.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/fr.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/hu.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/it.yml +0 -40
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ja.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/lv.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/nl.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/no.yml +0 -35
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pl.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pt_br.yml +0 -40
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ru.yml +0 -35
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/tr.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/uk.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_cn.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_tw.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/logger.rb +0 -428
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/mounter.rb +0 -224
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/reloader.rb +0 -254
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/router.rb +0 -98
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/server.rb +0 -79
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/support_lite.rb +0 -199
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/tasks.rb +0 -21
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/version.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core.rb +0 -152
- data/lib/middleman-core/vendor/padrino-core-0.10.6/padrino-core.gemspec +0 -38
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.components +0 -6
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.gitignore +0 -7
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/complex.rb +0 -32
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/simple.rb +0 -33
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/a.rb +0 -9
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/b.rb +0 -4
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/c.rb +0 -1
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/e.rb +0 -13
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/f.rb +0 -2
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/g.rb +0 -2
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/d.rb +0 -4
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/helper.rb +0 -83
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/mini_shoulda.rb +0 -45
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_application.rb +0 -108
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_core.rb +0 -77
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_dependencies.rb +0 -44
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_filters.rb +0 -278
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_locale.rb +0 -21
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_logger.rb +0 -154
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_mounter.rb +0 -177
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_complex.rb +0 -75
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_simple.rb +0 -98
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_rendering.rb +0 -461
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_restful_routing.rb +0 -33
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_router.rb +0 -146
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_routing.rb +0 -1680
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.document +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.gitignore +0 -21
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.yardopts +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/LICENSE.txt +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/README.rdoc +0 -239
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/Rakefile +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/asset_tag_helpers.rb +0 -417
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/abstract_form_builder.rb +0 -251
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -43
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_helpers.rb +0 -787
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/format_helpers.rb +0 -381
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/cs.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/da.yml +0 -91
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/de.yml +0 -81
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/en.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/es.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/fr.yml +0 -80
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/hu.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/it.yml +0 -89
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ja.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/lv.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/nl.yml +0 -82
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/no.yml +0 -91
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pl.yml +0 -95
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pt_br.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ru.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/tr.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/uk.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_cn.yml +0 -104
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_tw.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/number_helpers.rb +0 -288
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -98
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/erb_handler.rb +0 -79
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -63
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/slim_handler.rb +0 -81
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers.rb +0 -175
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/render_helpers.rb +0 -60
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/tag_helpers.rb +0 -260
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/translation_helpers.rb +0 -38
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers.rb +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/padrino-helpers.gemspec +0 -27
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/app.rb +0 -73
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.erb +0 -14
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.haml +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.slim +0 -13
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.erb +0 -14
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.haml +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.slim +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.erb +0 -11
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.haml +0 -9
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.slim +0 -9
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.erb +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.slim +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.erb +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.haml +0 -15
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.slim +0 -15
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.erb +0 -72
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.haml +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.slim +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.erb +0 -86
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.haml +0 -70
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.slim +0 -70
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.erb +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.haml +0 -4
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.slim +0 -4
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.erb +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.haml +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.slim +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.erb +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.haml +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.slim +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_erb.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_haml.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/app.rb +0 -50
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_erb.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_haml.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_slim.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/erb/test.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/explicit_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/haml/test.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/_user.haml +0 -7
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/haml_template.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/some_template.haml +0 -2
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/helper.rb +0 -66
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_asset_tag_helpers.rb +0 -328
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_builder.rb +0 -1106
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_helpers.rb +0 -770
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_format_helpers.rb +0 -227
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_locale.rb +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_number_helpers.rb +0 -139
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_output_helpers.rb +0 -153
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_render_helpers.rb +0 -76
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_tag_helpers.rb +0 -106
- data/lib/middleman-core/watcher.rb +0 -196
@@ -1,97 +1,108 @@
|
|
1
|
-
module Middleman
|
1
|
+
module Middleman
|
2
|
+
|
3
|
+
module Sitemap
|
4
|
+
|
5
|
+
module Extensions
|
2
6
|
|
3
|
-
|
7
|
+
module Proxies
|
4
8
|
|
5
|
-
|
6
|
-
|
9
|
+
# Setup extension
|
10
|
+
class << self
|
7
11
|
|
8
|
-
|
9
|
-
|
10
|
-
|
12
|
+
# Once registered
|
13
|
+
def registered(app)
|
14
|
+
::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
# Include methods
|
17
|
+
app.send :include, InstanceMethods
|
18
|
+
end
|
15
19
|
|
16
|
-
|
17
|
-
|
20
|
+
alias :included :registered
|
21
|
+
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
23
|
+
module ResourceInstanceMethods
|
24
|
+
# Whether this page is a proxy
|
25
|
+
# @return [Boolean]
|
26
|
+
def proxy?
|
27
|
+
!!@proxied_to
|
28
|
+
end
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
# Set this page to proxy to a target path
|
31
|
+
# @param [String] target
|
32
|
+
# @return [void]
|
33
|
+
def proxy_to(target)
|
34
|
+
@proxied_to = target
|
35
|
+
end
|
32
36
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
37
|
+
# The path of the page this page is proxied to, or nil if it's not proxied.
|
38
|
+
# @return [String]
|
39
|
+
def proxied_to
|
40
|
+
@proxied_to
|
41
|
+
end
|
38
42
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
# Whether this page has a template file
|
44
|
+
# @return [Boolean]
|
45
|
+
def template?
|
46
|
+
if proxy?
|
47
|
+
store.find_resource_by_path(proxied_to).template?
|
48
|
+
else
|
49
|
+
super
|
50
|
+
end
|
51
|
+
end
|
48
52
|
|
49
|
-
|
50
|
-
|
51
|
-
|
53
|
+
def get_source_file
|
54
|
+
if proxy?
|
55
|
+
proxy_resource = store.find_resource_by_path(proxied_to)
|
56
|
+
|
57
|
+
unless proxy_resource
|
58
|
+
raise "Path #{path} proxies to unknown file #{proxied_to}"
|
59
|
+
end
|
60
|
+
|
61
|
+
proxy_resource.source_file
|
62
|
+
end
|
63
|
+
end
|
52
64
|
end
|
53
|
-
end
|
54
|
-
end
|
55
65
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
66
|
+
module InstanceMethods
|
67
|
+
def proxy_manager
|
68
|
+
@_proxy_manager ||= ProxyManager.new(self)
|
69
|
+
end
|
60
70
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
71
|
+
def proxy(*args)
|
72
|
+
proxy_manager.proxy(*args)
|
73
|
+
end
|
74
|
+
end
|
65
75
|
|
66
|
-
|
67
|
-
|
68
|
-
|
76
|
+
class ProxyManager
|
77
|
+
def initialize(app)
|
78
|
+
@app = app
|
69
79
|
|
70
|
-
|
71
|
-
|
80
|
+
@proxy_paths = {}
|
81
|
+
end
|
72
82
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
83
|
+
# Setup a proxy from a path to a target
|
84
|
+
# @param [String] path
|
85
|
+
# @param [String] target
|
86
|
+
# @return [void]
|
87
|
+
def proxy(path, target)
|
88
|
+
@proxy_paths[::Middleman::Util.normalize_path(path)] = ::Middleman::Util.normalize_path(target)
|
89
|
+
@app.sitemap.rebuild_resource_list!(:added_proxy)
|
90
|
+
end
|
81
91
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
+
# Update the main sitemap resource list
|
93
|
+
# @return [void]
|
94
|
+
def manipulate_resource_list(resources)
|
95
|
+
resources + @proxy_paths.map do |key, value|
|
96
|
+
p = ::Middleman::Sitemap::Resource.new(
|
97
|
+
@app.sitemap,
|
98
|
+
key
|
99
|
+
)
|
100
|
+
p.proxy_to(value)
|
101
|
+
p
|
102
|
+
end
|
103
|
+
end
|
92
104
|
end
|
93
105
|
end
|
94
106
|
end
|
95
107
|
end
|
96
|
-
|
97
108
|
end
|
@@ -1,77 +1,84 @@
|
|
1
|
-
module Middleman
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
module Middleman
|
2
|
+
|
3
|
+
module Sitemap
|
4
|
+
|
5
|
+
module Extensions
|
6
|
+
|
7
|
+
module Traversal
|
8
|
+
# This resource's parent resource
|
9
|
+
# @return [Middleman::Sitemap::Resource, nil]
|
10
|
+
def parent
|
11
|
+
parts = path.split("/")
|
12
|
+
parts.pop if path.include?(app.index_file)
|
8
13
|
|
9
|
-
|
14
|
+
return nil if parts.length < 1
|
10
15
|
|
11
|
-
|
12
|
-
|
16
|
+
parts.pop
|
17
|
+
parts << app.index_file
|
13
18
|
|
14
|
-
|
19
|
+
parent_path = "/" + parts.join("/")
|
15
20
|
|
16
|
-
|
17
|
-
|
21
|
+
store.find_resource_by_destination_path(parent_path)
|
22
|
+
end
|
18
23
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
24
|
+
# This resource's child resources
|
25
|
+
# @return [Array<Middleman::Sitemap::Resource>]
|
26
|
+
def children
|
27
|
+
return [] unless directory_index?
|
23
28
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
else
|
28
|
-
base_path = path.sub("#{app.index_file}", "")
|
29
|
-
prefix = %r|^#{base_path.sub("/", "\\/")}|
|
30
|
-
end
|
31
|
-
|
32
|
-
store.resources.select do |sub_resource|
|
33
|
-
if sub_resource.path == self.path || sub_resource.path !~ prefix
|
34
|
-
false
|
35
|
-
else
|
36
|
-
inner_path = sub_resource.path.sub(prefix, "")
|
37
|
-
parts = inner_path.split("/")
|
38
|
-
if parts.length == 1
|
39
|
-
true
|
40
|
-
elsif parts.length == 2
|
41
|
-
parts.last == app.index_file
|
29
|
+
if eponymous_directory?
|
30
|
+
base_path = eponymous_directory_path
|
31
|
+
prefix = %r|^#{base_path.sub("/", "\\/")}|
|
42
32
|
else
|
43
|
-
|
33
|
+
base_path = path.sub("#{app.index_file}", "")
|
34
|
+
prefix = %r|^#{base_path.sub("/", "\\/")}|
|
35
|
+
end
|
36
|
+
|
37
|
+
store.resources.select do |sub_resource|
|
38
|
+
if sub_resource.path == self.path || sub_resource.path !~ prefix
|
39
|
+
false
|
40
|
+
else
|
41
|
+
inner_path = sub_resource.path.sub(prefix, "")
|
42
|
+
parts = inner_path.split("/")
|
43
|
+
if parts.length == 1
|
44
|
+
true
|
45
|
+
elsif parts.length == 2
|
46
|
+
parts.last == app.index_file
|
47
|
+
else
|
48
|
+
false
|
49
|
+
end
|
50
|
+
end
|
44
51
|
end
|
45
52
|
end
|
46
|
-
end
|
47
|
-
end
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
# This resource's sibling resources
|
55
|
+
# @return [Array<Middleman::Sitemap::Resource>]
|
56
|
+
def siblings
|
57
|
+
return [] unless parent
|
58
|
+
parent.children.reject { |p| p == self }
|
59
|
+
end
|
55
60
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
# Whether this resource either a directory index, or has the same name as an existing directory in the source
|
62
|
+
# @return [Boolean]
|
63
|
+
def directory_index?
|
64
|
+
path.include?(app.index_file) || path =~ /\/$/ || eponymous_directory?
|
65
|
+
end
|
61
66
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
# Whether the resource has the same name as a directory in the source
|
68
|
+
# (e.g., if the resource is named 'gallery.html' and a path exists named 'gallery/', this would return true)
|
69
|
+
# @return [Boolean]
|
70
|
+
def eponymous_directory?
|
71
|
+
full_path = File.join(app.source_dir, eponymous_directory_path)
|
72
|
+
!!(File.exists?(full_path) && File.directory?(full_path))
|
73
|
+
end
|
69
74
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
+
# The path for this resource if it were a directory, and not a file
|
76
|
+
# (e.g., for 'gallery.html' this would return 'gallery/')
|
77
|
+
# @return [String]
|
78
|
+
def eponymous_directory_path
|
79
|
+
path.sub(ext, '/').sub(/\/$/, "") + "/"
|
80
|
+
end
|
81
|
+
end
|
75
82
|
end
|
76
83
|
end
|
77
84
|
end
|
@@ -1,126 +1,147 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require "middleman-core/sitemap/extensions/traversal"
|
2
|
+
|
3
|
+
module Middleman
|
4
|
+
|
5
|
+
# Sitemap namespace
|
6
|
+
module Sitemap
|
3
7
|
|
4
|
-
|
5
|
-
|
6
|
-
|
8
|
+
# Sitemap Resource class
|
9
|
+
class Resource
|
10
|
+
include Middleman::Sitemap::Extensions::Traversal
|
7
11
|
|
8
|
-
|
9
|
-
|
12
|
+
# @return [Middleman::Application]
|
13
|
+
attr_reader :app
|
10
14
|
|
11
|
-
|
12
|
-
|
15
|
+
# @return [Middleman::Sitemap::Store]
|
16
|
+
attr_reader :store
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
# The source path of this resource (relative to the source directory,
|
19
|
+
# without template extensions)
|
20
|
+
# @return [String]
|
21
|
+
attr_reader :path
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
# Set the on-disk source file for this resource
|
24
|
+
# @return [String]
|
25
|
+
# attr_reader :source_file
|
22
26
|
|
23
|
-
|
24
|
-
|
25
|
-
|
27
|
+
def source_file
|
28
|
+
@source_file || get_source_file
|
29
|
+
end
|
26
30
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
# Initialize resource with parent store and URL
|
32
|
+
# @param [Middleman::Sitemap::Store] store
|
33
|
+
# @param [String] path
|
34
|
+
# @param [String] source_file
|
35
|
+
def initialize(store, path, source_file=nil)
|
36
|
+
@store = store
|
37
|
+
@app = @store.app
|
38
|
+
@path = path
|
39
|
+
@source_file = source_file
|
36
40
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# @return [Boolean]
|
42
|
-
def template?
|
43
|
-
return false if source_file.nil?
|
44
|
-
!::Tilt[source_file].nil?
|
45
|
-
end
|
41
|
+
@destination_paths = [@path]
|
42
|
+
|
43
|
+
@local_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
|
44
|
+
end
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
end
|
46
|
+
# Whether this resource has a template file
|
47
|
+
# @return [Boolean]
|
48
|
+
def template?
|
49
|
+
return false if source_file.nil?
|
50
|
+
!::Tilt[source_file].nil?
|
51
|
+
end
|
54
52
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
# Get the metadata for both the current source_file and the current path
|
54
|
+
# @return [Hash]
|
55
|
+
def metadata
|
56
|
+
result = store.metadata_for_file(source_file).dup
|
57
|
+
|
58
|
+
path_meta = store.metadata_for_path(path).dup
|
59
|
+
if path_meta.has_key?(:blocks)
|
60
|
+
result[:blocks] << path_meta[:blocks]
|
61
|
+
path_meta.delete(:blocks)
|
62
|
+
end
|
63
|
+
result.deep_merge!(path_meta)
|
64
|
+
|
65
|
+
local_meta = @local_metadata.dup
|
66
|
+
if local_meta.has_key?(:blocks)
|
67
|
+
result[:blocks] << local_meta[:blocks]
|
68
|
+
local_meta.delete(:blocks)
|
69
|
+
end
|
70
|
+
result.deep_merge!(local_meta)
|
71
|
+
|
72
|
+
result
|
73
|
+
end
|
74
|
+
|
75
|
+
# Merge in new metadata specific to this resource.
|
76
|
+
# @param [Hash] metadata A metadata block like provides_metadata_for_path takes
|
77
|
+
def add_metadata(metadata={}, &block)
|
78
|
+
if metadata.has_key?(:blocks)
|
79
|
+
@local_metadata[:blocks] << metadata[:blocks]
|
80
|
+
metadata.delete(:blocks)
|
81
|
+
end
|
82
|
+
@local_metadata.deep_merge!(metadata)
|
83
|
+
@local_metadata[:blocks] << block if block_given?
|
84
|
+
end
|
60
85
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
end
|
86
|
+
# Get the output/preview URL for this resource
|
87
|
+
# @return [String]
|
88
|
+
def destination_path
|
89
|
+
@destination_paths.last
|
90
|
+
end
|
67
91
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
92
|
+
# Set the output/preview URL for this resource
|
93
|
+
# @param [String] path
|
94
|
+
# @return [void]
|
95
|
+
def destination_path=(path)
|
96
|
+
@destination_paths << path
|
97
|
+
end
|
73
98
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
99
|
+
# Extension of the path (i.e. '.js')
|
100
|
+
# @return [String]
|
101
|
+
def ext
|
102
|
+
File.extname(path)
|
103
|
+
end
|
79
104
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
105
|
+
# Mime type of the path
|
106
|
+
# @return [String]
|
107
|
+
def mime_type
|
108
|
+
app.mime_type ext
|
109
|
+
end
|
85
110
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
111
|
+
# Render this resource
|
112
|
+
# @return [String]
|
113
|
+
def render(opts={}, locs={}, &block)
|
114
|
+
return File.open(source_file).read unless template?
|
90
115
|
|
91
|
-
|
116
|
+
start_time = Time.now
|
117
|
+
puts "== Render Start: #{source_file}" if app.logging?
|
92
118
|
|
93
|
-
|
94
|
-
|
95
|
-
|
119
|
+
md = metadata.dup
|
120
|
+
opts = md[:options].deep_merge(opts)
|
121
|
+
locs = md[:locals].deep_merge(locs)
|
96
122
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
123
|
+
# Forward remaining data to helpers
|
124
|
+
if md.has_key?(:page)
|
125
|
+
app.data.store("page", md[:page])
|
126
|
+
end
|
101
127
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
128
|
+
md[:blocks].flatten.compact.each do |block|
|
129
|
+
app.instance_eval(&block)
|
130
|
+
end
|
131
|
+
|
132
|
+
app.instance_eval(&block) if block_given?
|
133
|
+
result = app.render_template(source_file, locs, opts)
|
108
134
|
|
109
|
-
|
110
|
-
|
111
|
-
|
135
|
+
puts "== Render End: #{source_file} (#{(Time.now - start_time).round(2)}s)" if app.logging?
|
136
|
+
result
|
137
|
+
end
|
112
138
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
# Get the relative path from the source
|
121
|
-
# @return [String]
|
122
|
-
def relative_path
|
123
|
-
source_file ? source_file.sub(app.source_dir, '') : nil
|
139
|
+
# A path without the directory index - so foo/index.html becomes
|
140
|
+
# just foo. Best for linking.
|
141
|
+
# @return [String]
|
142
|
+
def url
|
143
|
+
('/' + destination_path).sub(/\/#{Regexp.escape(app.index_file)}$/, '/')
|
144
|
+
end
|
124
145
|
end
|
125
146
|
end
|
126
147
|
end
|