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,12 +1,17 @@
|
|
1
|
-
|
2
|
-
module
|
1
|
+
module Middleman
|
2
|
+
module CoreExtensions
|
3
|
+
|
4
|
+
# Convenience methods to allow config.rb to talk to the Builder
|
5
|
+
module Builder
|
3
6
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
7
|
+
# Extension registered
|
8
|
+
class << self
|
9
|
+
# @private
|
10
|
+
def registered(app)
|
11
|
+
app.define_hook :after_build
|
12
|
+
end
|
13
|
+
alias :included :registered
|
14
|
+
end
|
9
15
|
end
|
10
|
-
alias :included :registered
|
11
16
|
end
|
12
|
-
end
|
17
|
+
end
|
@@ -1,175 +1,180 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
module Middleman::CoreExtensions::Data
|
8
|
-
|
9
|
-
# Extension registered
|
10
|
-
class << self
|
11
|
-
# @private
|
12
|
-
def registered(app)
|
13
|
-
app.set :data_dir, "data"
|
14
|
-
app.send :include, InstanceMethods
|
15
|
-
end
|
16
|
-
alias :included :registered
|
17
|
-
end
|
1
|
+
module Middleman
|
2
|
+
module CoreExtensions
|
3
|
+
|
4
|
+
# The data extension parses YAML and JSON files in the data/ directory
|
5
|
+
# and makes them available to config.rb, templates and extensions
|
6
|
+
module Data
|
18
7
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
8
|
+
# Extension registered
|
9
|
+
class << self
|
10
|
+
# @private
|
11
|
+
def registered(app)
|
12
|
+
# Data formats
|
13
|
+
require "yaml"
|
14
|
+
require "active_support/json"
|
15
|
+
|
16
|
+
app.set :data_dir, "data"
|
17
|
+
app.send :include, InstanceMethods
|
18
|
+
end
|
19
|
+
alias :included :registered
|
26
20
|
end
|
21
|
+
|
22
|
+
# Instance methods
|
23
|
+
module InstanceMethods
|
24
|
+
# Setup data files before anything else so they are available when
|
25
|
+
# parsing config.rb
|
26
|
+
def initialize
|
27
|
+
self.files.changed DataStore.matcher do |file|
|
28
|
+
self.data.touch_file(file) if file.match(%r{^#{self.data_dir}\/})
|
29
|
+
end
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
self.files.deleted DataStore.matcher do |file|
|
32
|
+
self.data.remove_file(file) if file.match(%r{^#{self.data_dir}\/})
|
33
|
+
end
|
31
34
|
|
32
|
-
|
33
|
-
|
35
|
+
super
|
36
|
+
end
|
34
37
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
# The data object
|
39
|
+
#
|
40
|
+
# @return [DataStore]
|
41
|
+
def data
|
42
|
+
@_data ||= DataStore.new(self)
|
43
|
+
end
|
44
|
+
end
|
42
45
|
|
43
|
-
|
44
|
-
|
46
|
+
# The core logic behind the data extension.
|
47
|
+
class DataStore
|
45
48
|
|
46
|
-
|
47
|
-
|
49
|
+
# Static methods
|
50
|
+
class << self
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
52
|
+
# The regex which tells Middleman which files are for data
|
53
|
+
#
|
54
|
+
# @return [Regexp]
|
55
|
+
def matcher
|
56
|
+
%r{[\w-]+\.(yml|yaml|json)$}
|
57
|
+
end
|
58
|
+
end
|
56
59
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
60
|
+
# Store static data hash
|
61
|
+
#
|
62
|
+
# @param [Symbol] name Name of the data, used for namespacing
|
63
|
+
# @param [Hash] content The content for this data
|
64
|
+
# @return [void]
|
65
|
+
def store(name=nil, content=nil)
|
66
|
+
@_local_sources ||= {}
|
67
|
+
@_local_sources[name.to_s] = content unless name.nil? || content.nil?
|
68
|
+
@_local_sources
|
69
|
+
end
|
67
70
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
71
|
+
# Store callback-based data
|
72
|
+
#
|
73
|
+
# @param [Symbol] name Name of the data, used for namespacing
|
74
|
+
# @param [Proc] proc The callback which will return data
|
75
|
+
# @return [void]
|
76
|
+
def callbacks(name=nil, proc=nil)
|
77
|
+
@_callback_sources ||= {}
|
78
|
+
@_callback_sources[name.to_s] = proc unless name.nil? || proc.nil?
|
79
|
+
@_callback_sources
|
80
|
+
end
|
78
81
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
82
|
+
# Setup data store
|
83
|
+
#
|
84
|
+
# @param [Middleman::Application] app The current instance of Middleman
|
85
|
+
def initialize(app)
|
86
|
+
@app = app
|
87
|
+
@local_data = {}
|
88
|
+
end
|
86
89
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
90
|
+
# Update the internal cache for a given file path
|
91
|
+
#
|
92
|
+
# @param [String] file The file to be re-parsed
|
93
|
+
# @return [void]
|
94
|
+
def touch_file(file)
|
95
|
+
file = File.expand_path(file, @app.root)
|
96
|
+
extension = File.extname(file)
|
97
|
+
basename = File.basename(file, extension)
|
95
98
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
99
|
+
if %w(.yaml .yml).include?(extension)
|
100
|
+
data = YAML.load_file(file)
|
101
|
+
elsif extension == ".json"
|
102
|
+
data = ActiveSupport::JSON.decode(File.read(file))
|
103
|
+
else
|
104
|
+
return
|
105
|
+
end
|
103
106
|
|
104
|
-
|
105
|
-
|
107
|
+
@local_data[basename] = ::Middleman::Util.recursively_enhance(data)
|
108
|
+
end
|
106
109
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
110
|
+
# Remove a given file from the internal cache
|
111
|
+
#
|
112
|
+
# @param [String] file The file to be cleared
|
113
|
+
# @return [void]
|
114
|
+
def remove_file(file)
|
115
|
+
extension = File.extname(file)
|
116
|
+
basename = File.basename(file, extension)
|
117
|
+
@local_data.delete(basename) if @local_data.has_key?(basename)
|
118
|
+
end
|
116
119
|
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
120
|
+
# Get a hash hash from either internal static data or a callback
|
121
|
+
#
|
122
|
+
# @param [String, Symbol] path The name of the data namespace
|
123
|
+
# @return [Hash, nil]
|
124
|
+
def data_for_path(path)
|
125
|
+
response = nil
|
123
126
|
|
124
|
-
|
125
|
-
|
127
|
+
@@local_sources ||= {}
|
128
|
+
@@callback_sources ||= {}
|
126
129
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
if self.store.has_key?(path.to_s)
|
131
|
+
response = self.store[path.to_s]
|
132
|
+
elsif self.callbacks.has_key?(path.to_s)
|
133
|
+
response = self.callbacks[path.to_s].call()
|
134
|
+
end
|
132
135
|
|
133
|
-
|
134
|
-
|
136
|
+
response
|
137
|
+
end
|
135
138
|
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
139
|
+
# "Magically" find namespaces of data if they exist
|
140
|
+
#
|
141
|
+
# @param [String] path The namespace to search for
|
142
|
+
# @return [Hash, nil]
|
143
|
+
def method_missing(path)
|
144
|
+
if @local_data.has_key?(path.to_s)
|
145
|
+
return @local_data[path.to_s]
|
146
|
+
else
|
147
|
+
result = data_for_path(path)
|
145
148
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
149
|
+
if result
|
150
|
+
return ::Middleman::Util.recursively_enhance(result)
|
151
|
+
end
|
152
|
+
end
|
150
153
|
|
151
|
-
|
152
|
-
|
154
|
+
super
|
155
|
+
end
|
153
156
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
157
|
+
# Convert all the data into a static hash
|
158
|
+
#
|
159
|
+
# @return [Hash]
|
160
|
+
def to_h
|
161
|
+
data = {}
|
159
162
|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
+
self.store.each do |k, v|
|
164
|
+
data[k] = data_for_path(k)
|
165
|
+
end
|
163
166
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
+
self.callbacks.each do |k, v|
|
168
|
+
data[k] = data_for_path(k)
|
169
|
+
end
|
167
170
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
+
(@local_data || {}).each do |k, v|
|
172
|
+
data[k] = v
|
173
|
+
end
|
171
174
|
|
172
|
-
|
175
|
+
data
|
176
|
+
end
|
177
|
+
end
|
173
178
|
end
|
174
179
|
end
|
175
180
|
end
|
@@ -1,110 +1,172 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# Built-in helpers
|
4
|
-
module
|
5
|
-
|
6
|
-
# Extension registered
|
7
|
-
class << self
|
8
|
-
# @private
|
9
|
-
def registered(app)
|
10
|
-
app.helpers ::Padrino::Helpers::OutputHelpers
|
11
|
-
app.helpers ::Padrino::Helpers::TagHelpers
|
12
|
-
app.helpers ::Padrino::Helpers::AssetTagHelpers
|
13
|
-
app.helpers ::Padrino::Helpers::FormHelpers
|
14
|
-
app.helpers ::Padrino::Helpers::FormatHelpers
|
15
|
-
app.helpers ::Padrino::Helpers::RenderHelpers
|
16
|
-
app.helpers ::Padrino::Helpers::NumberHelpers
|
17
|
-
# app.helpers ::Padrino::Helpers::TranslationHelpers
|
18
|
-
|
19
|
-
app.helpers Helpers
|
20
|
-
|
21
|
-
app.ready do
|
22
|
-
::I18n.load_path += Dir["#{File.dirname(__FILE__)}/../vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/*.yml"]
|
23
|
-
end
|
24
|
-
end
|
25
|
-
alias :included :registered
|
26
|
-
end
|
1
|
+
module Middleman
|
2
|
+
module CoreExtensions
|
3
|
+
# Built-in helpers
|
4
|
+
module DefaultHelpers
|
27
5
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
6
|
+
# Extension registered
|
7
|
+
class << self
|
8
|
+
# @private
|
9
|
+
def registered(app)
|
10
|
+
require "active_support/core_ext/integer/inflections"
|
11
|
+
require 'padrino-helpers'
|
12
|
+
|
13
|
+
app.helpers ::Padrino::Helpers::OutputHelpers
|
14
|
+
app.helpers ::Padrino::Helpers::TagHelpers
|
15
|
+
app.helpers ::Padrino::Helpers::AssetTagHelpers
|
16
|
+
app.helpers ::Padrino::Helpers::FormHelpers
|
17
|
+
app.helpers ::Padrino::Helpers::FormatHelpers
|
18
|
+
app.helpers ::Padrino::Helpers::RenderHelpers
|
19
|
+
app.helpers ::Padrino::Helpers::NumberHelpers
|
20
|
+
# app.helpers ::Padrino::Helpers::TranslationHelpers
|
39
21
|
|
40
|
-
|
41
|
-
#
|
42
|
-
# @param [String] separator How to break up path in parts
|
43
|
-
# @return [String]
|
44
|
-
def auto_javascript_include_tag(separator="/")
|
45
|
-
auto_tag(:js, separator) do |path|
|
46
|
-
javascript_include_tag path
|
47
|
-
end
|
48
|
-
end
|
22
|
+
app.helpers Helpers
|
49
23
|
|
50
|
-
|
51
|
-
#
|
52
|
-
# @param [Symbol] asset_ext The type of asset
|
53
|
-
# @param [String] separator How to break up path in parts
|
54
|
-
# @param [String] asset_dir Where to look for assets
|
55
|
-
# @return [void]
|
56
|
-
def auto_tag(asset_ext, separator="/", asset_dir=nil)
|
57
|
-
if asset_dir.nil?
|
58
|
-
asset_dir = case asset_ext
|
59
|
-
when :js then js_dir
|
60
|
-
when :css then css_dir
|
24
|
+
app.set :relative_links, false
|
61
25
|
end
|
26
|
+
alias :included :registered
|
62
27
|
end
|
63
28
|
|
64
|
-
#
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
29
|
+
# The helpers
|
30
|
+
module Helpers
|
31
|
+
# Output a stylesheet link tag based on the current path
|
32
|
+
#
|
33
|
+
# @param [String] separator How to break up path in parts
|
34
|
+
# @return [String]
|
35
|
+
def auto_stylesheet_link_tag(separator="/")
|
36
|
+
auto_tag(:css, separator) do |path|
|
37
|
+
stylesheet_link_tag path
|
38
|
+
end
|
39
|
+
end
|
70
40
|
|
71
|
-
|
72
|
-
|
41
|
+
# Output a javascript tag based on the current path
|
42
|
+
#
|
43
|
+
# @param [String] separator How to break up path in parts
|
44
|
+
# @return [String]
|
45
|
+
def auto_javascript_include_tag(separator="/")
|
46
|
+
auto_tag(:js, separator) do |path|
|
47
|
+
javascript_include_tag path
|
48
|
+
end
|
49
|
+
end
|
73
50
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
51
|
+
# Output a stylesheet link tag based on the current path
|
52
|
+
#
|
53
|
+
# @param [Symbol] asset_ext The type of asset
|
54
|
+
# @param [String] separator How to break up path in parts
|
55
|
+
# @param [String] asset_dir Where to look for assets
|
56
|
+
# @return [void]
|
57
|
+
def auto_tag(asset_ext, separator="/", asset_dir=nil)
|
58
|
+
if asset_dir.nil?
|
59
|
+
asset_dir = case asset_ext
|
60
|
+
when :js then js_dir
|
61
|
+
when :css then css_dir
|
62
|
+
end
|
63
|
+
end
|
81
64
|
|
82
|
-
|
83
|
-
|
84
|
-
|
65
|
+
# If the basename of the request as no extension, assume we are serving a
|
66
|
+
# directory and join index_file to the path.
|
67
|
+
path = full_path(current_path.dup)
|
68
|
+
path = path.sub(%r{^/}, '')
|
69
|
+
path = path.gsub(File.extname(path), ".#{asset_ext}")
|
70
|
+
path = path.gsub("/", separator)
|
85
71
|
|
86
|
-
|
87
|
-
|
72
|
+
yield path if sitemap.find_resource_by_path(File.join(asset_dir, path))
|
73
|
+
end
|
88
74
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
75
|
+
# Generate body css classes based on the current path
|
76
|
+
#
|
77
|
+
# @return [String]
|
78
|
+
def page_classes
|
79
|
+
path = current_path.dup
|
80
|
+
path << index_file if path.match(%r{/$})
|
81
|
+
path = path.gsub(%r{^/}, '')
|
82
|
+
|
83
|
+
classes = []
|
84
|
+
parts = path.split('.')[0].split('/')
|
85
|
+
parts.each_with_index { |path, i| classes << parts.first(i+1).join('_') }
|
86
|
+
|
87
|
+
classes.join(' ')
|
88
|
+
end
|
89
|
+
|
90
|
+
# Get the path of a file of a given type
|
91
|
+
#
|
92
|
+
# @param [Symbol] kind The type of file
|
93
|
+
# @param [String] source The path to the file
|
94
|
+
# @return [String]
|
95
|
+
def asset_path(kind, source)
|
96
|
+
return source if source =~ /^http/
|
97
|
+
asset_folder = case kind
|
98
|
+
when :css then css_dir
|
99
|
+
when :js then js_dir
|
100
|
+
when :images then images_dir
|
101
|
+
else kind.to_s
|
102
|
+
end
|
103
|
+
source = source.to_s.gsub(/\s/, '')
|
104
|
+
ignore_extension = (kind == :images) # don't append extension
|
105
|
+
source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/
|
106
|
+
result_path = source if source =~ %r{^/} # absolute path
|
107
|
+
result_path ||= asset_url(source, asset_folder)
|
108
|
+
"#{result_path}"
|
109
|
+
end
|
110
|
+
|
111
|
+
# Overload the regular link_to to be sitemap-aware - if you
|
112
|
+
# reference a source path, either absolutely or relatively,
|
113
|
+
# you'll get that resource's nice URL. Also, there is a
|
114
|
+
# :relative option which, if set to true, will produce
|
115
|
+
# relative URLs instead of absolute URLs. You can also add
|
116
|
+
#
|
117
|
+
# set :relative_links, true
|
118
|
+
#
|
119
|
+
# to config.rb to have all links default to relative.
|
120
|
+
def link_to(*args, &block)
|
121
|
+
url_arg_index = block_given? ? 0 : 1
|
122
|
+
options_index = block_given? ? 1 : 2
|
123
|
+
|
124
|
+
if url = args[url_arg_index]
|
125
|
+
options = args[options_index] || {}
|
126
|
+
relative = options.delete(:relative)
|
127
|
+
|
128
|
+
|
129
|
+
if url.include? '://'
|
130
|
+
raise "Can't use the relative option with an external URL" if relative
|
131
|
+
else
|
132
|
+
# Handle relative urls
|
133
|
+
current_dir = Pathname('/' + current_resource.path).dirname
|
134
|
+
path = Pathname(url)
|
135
|
+
|
136
|
+
url = current_dir.join(path).to_s if path.relative?
|
137
|
+
|
138
|
+
resource = sitemap.find_resource_by_path(url)
|
139
|
+
|
140
|
+
# Allow people to turn on relative paths for all links with set :relative_links, true
|
141
|
+
# but still override on a case by case basis with the :relative parameter.
|
142
|
+
effective_relative = relative || false
|
143
|
+
if relative.nil? && relative_links
|
144
|
+
effective_relative = true
|
145
|
+
end
|
146
|
+
|
147
|
+
if resource
|
148
|
+
if effective_relative
|
149
|
+
resource_url = resource.url
|
150
|
+
new_url = Pathname(resource_url).relative_path_from(current_dir).to_s
|
151
|
+
|
152
|
+
# Put back the trailing slash to avoid unnecessary Apache redirects
|
153
|
+
if resource_url.end_with?('/') && !new_url.end_with?('/')
|
154
|
+
new_url << '/'
|
155
|
+
end
|
156
|
+
else
|
157
|
+
new_url = resource.url
|
158
|
+
end
|
159
|
+
|
160
|
+
args[url_arg_index] = new_url
|
161
|
+
else
|
162
|
+
raise "No resource exists at #{url}" if relative
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
super(*args, &block)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
end
|
109
171
|
end
|
110
172
|
end
|