middleman-core 3.1.0.rc.2 → 3.1.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +2 -1
- data/features/capture_html.feature +18 -0
- data/features/content_for.feature +3 -3
- data/features/v4_extension_callbacks.feature +8 -0
- data/fixtures/capture-html-app/config.rb +7 -0
- data/fixtures/capture-html-app/source/capture_html_erb.html.erb +5 -0
- data/fixtures/capture-html-app/source/capture_html_haml.html.haml +4 -0
- data/fixtures/capture-html-app/source/capture_html_slim.html.slim +4 -0
- data/fixtures/capture-html-app/source/layouts/capture_html.erb +4 -0
- data/fixtures/content-for-app/source/content_for_erb.html.erb +1 -1
- data/fixtures/content-for-app/source/content_for_haml.html.haml +1 -1
- data/fixtures/content-for-app/source/content_for_slim.html.slim +2 -1
- data/fixtures/v4-extension-callbacks/config.rb +26 -0
- data/fixtures/v4-extension-callbacks/source/index.html.erb +2 -0
- data/lib/middleman-core/core_extensions/extensions.rb +6 -1
- data/lib/middleman-core/core_extensions/file_watcher.rb +1 -0
- data/lib/middleman-core/core_extensions/rendering.rb +1 -2
- data/lib/middleman-core/core_extensions/request.rb +2 -2
- data/lib/middleman-core/extensions.rb +21 -0
- data/lib/middleman-core/meta_pages/sitemap_resource.rb +4 -1
- data/lib/middleman-core/version.rb +1 -1
- data/lib/middleman-more/core_extensions/default_helpers.rb +17 -3
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.document +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/.yardopts +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/LICENSE.txt +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/README.rdoc +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/Rakefile +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/bin/padrino +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core.rb +58 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application.rb +40 -16
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/flash.rb +229 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/rendering.rb +39 -11
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/erubis.rb +55 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/haml.rb +26 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/application/rendering/extensions/slim.rb +14 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/routing.rb +133 -37
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/application/showexceptions.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/caller.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/adapter.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/base.rb +41 -38
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/console.rb +0 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/cli/rake.rb +47 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/cli/rake_tasks.rb +9 -14
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/command.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/images/404.png +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/images/500.png +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/loader.rb +23 -9
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/cs.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/da.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/de.yml +6 -6
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/en.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/es.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/fr.yml +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/hu.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/it.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ja.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/lv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/nl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/no.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/pl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/pt_br.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ro.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/ru.yml +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/sv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/tr.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/uk.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/zh_cn.yml +11 -11
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/locale/zh_tw.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/logger.rb +48 -32
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/module.rb +58 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/mounter.rb +15 -5
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/reloader.rb +139 -52
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/router.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/server.rb +5 -5
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/support_lite.rb +59 -6
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/tasks.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core/version.rb +1 -1
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/padrino-core.gemspec +10 -5
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/Gemfile +4 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/app/app.rb +3 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/app_gem.gemspec +17 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/lib/app_gem.rb +7 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/fixtures/app_gem/lib/app_gem/version.rb +3 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/.components +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/complex.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/apps/simple.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/a.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/b.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/c.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/e.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/f.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/circular/g.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/fixtures/dependencies/d.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/helper.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/mini_shoulda.rb +2 -2
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_application.rb +38 -21
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_core.rb +0 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_csrf_protection.rb +80 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_dependencies.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_filters.rb +70 -0
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_flash.rb +168 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_locale.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_logger.rb +27 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_mounter.rb +24 -2
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_reloader_complex.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_reloader_simple.rb +4 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_rendering.rb +75 -4
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_restful_routing.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_router.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/test/test_routing.rb +209 -35
- data/lib/vendored-middleman-deps/padrino-core-0.11.2/test/test_support_lite.rb +56 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.document +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.gitignore +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/.yardopts +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/LICENSE.txt +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/README.rdoc +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/Rakefile +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers.rb +2 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/asset_tag_helpers.rb +58 -66
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers/breadcrumb_helpers.rb +171 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_builder/abstract_form_builder.rb +84 -26
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/form_helpers.rb +94 -19
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/format_helpers.rb +9 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/cs.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/da.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/de.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/en.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/es.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/fr.yml +12 -12
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/hu.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/it.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ja.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/lv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/nl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/no.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/pl.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/pt_br.yml +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ro.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/ru.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/sv.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/tr.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/uk.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/zh_cn.yml +13 -14
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/locale/zh_tw.yml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/number_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers.rb +45 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/erb_handler.rb +3 -3
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/output_helpers/slim_handler.rb +6 -7
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/render_helpers.rb +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/tag_helpers.rb +34 -6
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/lib/padrino-helpers/translation_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/padrino-helpers.gemspec +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/app.rb +13 -6
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.erb +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.haml +2 -2
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/capture_concat.slim +4 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_for.slim +4 -4
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/content_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/content_tag.slim +9 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.haml +1 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/current_engine.slim +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/fields_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/fields_for.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/fields_for.slim +15 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_for.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_for.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_for.slim +59 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/form_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/form_tag.slim +70 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/link_to.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/link_to.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/link_to.slim +4 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/mail_to.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/mail_to.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/mail_to.slim +3 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/meta_tag.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/meta_tag.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/meta_tag.slim +3 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/partials/_erb.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/partials/_haml.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/partials/_slim.slim +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/simple_partial.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/markup_app/views/simple_partial.haml +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/markup_app/views/simple_partial.slim +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/app.rb +7 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engine.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_erb.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_haml.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/current_engines/_slim.slim +0 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_erb.erb +3 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_haml.haml +2 -0
- data/lib/vendored-middleman-deps/padrino-helpers-0.11.2/test/fixtures/render_app/views/double_capture_slim.slim +2 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/erb/test.erb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/explicit_engine.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/haml/test.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/_user.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/haml_template.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/fixtures/render_app/views/template/some_template.haml +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/helper.rb +1 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_asset_tag_helpers.rb +24 -5
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_form_builder.rb +41 -1
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_form_helpers.rb +36 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_format_helpers.rb +14 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_locale.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_number_helpers.rb +0 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_output_helpers.rb +5 -3
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_render_helpers.rb +18 -0
- data/lib/vendored-middleman-deps/{padrino-helpers-0.10.7 → padrino-helpers-0.11.2}/test/test_tag_helpers.rb +11 -0
- data/middleman-core.gemspec +1 -1
- metadata +218 -184
- data/lib/vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/cli/rake.rb +0 -25
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/content_tag.slim +0 -9
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/fields_for.slim +0 -15
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/form_for.slim +0 -59
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/form_tag.slim +0 -70
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/link_to.slim +0 -4
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/mail_to.slim +0 -3
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/meta_tag.slim +0 -3
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
- data/lib/vendored-middleman-deps/padrino-helpers-0.10.7/test/fixtures/markup_app/views/simple_partial.slim +0 -1
- data/spec/middleman-core/sitemap_spec.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d409fa4b4685ed3179880f7ec5f6b3d738b02cb5
|
4
|
+
data.tar.gz: 85297e96e43c14c1cdc4f08acb9c909f5eef6e04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb1fc2f29f119b5972c274f85bad7601e981aeba564a33ea0ec97fe3be68e84da70e5db0e08e6120f73e4c9c4f740b2f38c78aeb87b971c0cfa3e715a66de476
|
7
|
+
data.tar.gz: d5487e80ecd0b193602ab72ea0de5764685998a1838c8bfca0f3fd1a320c21e542dd568abd660085aa5acc33d32fd74f50d61f16f17edc272fd878f20f1f88bc
|
data/.simplecov
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
@wip
|
2
|
+
|
3
|
+
Feature: Support capture_html and yield_content helpers
|
4
|
+
|
5
|
+
Scenario: content_for works as expected in erb
|
6
|
+
Given the Server is running at "capture-html-app"
|
7
|
+
When I go to "/capture_html_erb.html"
|
8
|
+
Then I should see "In Layout: <h1>I am the yielded content erb</h1>"
|
9
|
+
|
10
|
+
Scenario: content_for works as expected in haml
|
11
|
+
Given the Server is running at "capture-html-app"
|
12
|
+
When I go to "/capture_html_haml.html"
|
13
|
+
Then I should see "In Layout: <h1>I am the yielded content haml</h1>"
|
14
|
+
|
15
|
+
Scenario: content_for works as expected in slim
|
16
|
+
Given the Server is running at "capture-html-app"
|
17
|
+
When I go to "/capture_html_slim.html"
|
18
|
+
Then I should see "In Layout: <h1>I am the yielded content slim</h1>"
|
@@ -3,14 +3,14 @@ Feature: Support content_for and yield_content helpers
|
|
3
3
|
Scenario: content_for works as expected in erb
|
4
4
|
Given the Server is running at "content-for-app"
|
5
5
|
When I go to "/content_for_erb.html"
|
6
|
-
Then I should see "In Layout: I am the yielded content erb"
|
6
|
+
Then I should see "In Layout: I am the yielded content erb <s>with html tags</s>"
|
7
7
|
|
8
8
|
Scenario: content_for works as expected in haml
|
9
9
|
Given the Server is running at "content-for-app"
|
10
10
|
When I go to "/content_for_haml.html"
|
11
|
-
Then I should see "In Layout: I am the yielded content haml"
|
11
|
+
Then I should see "In Layout: I am the yielded content haml <s>with html tags</s>"
|
12
12
|
|
13
13
|
Scenario: content_for works as expected in slim
|
14
14
|
Given the Server is running at "content-for-app"
|
15
15
|
When I go to "/content_for_slim.html"
|
16
|
-
Then I should see "In Layout: I am the yielded content slim"
|
16
|
+
Then I should see "In Layout: I am the yielded content slim <s>with html tags</s>"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Feature: v4 Extensions should have after_activated hooks
|
2
|
+
|
3
|
+
Scenario: Hello Helper
|
4
|
+
Given the Server is running at "v4-extension-callbacks"
|
5
|
+
Then going to "/index.html" should not raise an exception
|
6
|
+
And I should see "Extension One: true"
|
7
|
+
And I should see "Extension Two: true"
|
8
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class ExtensionOne < ::Middleman::Extension
|
2
|
+
def initialize(app, options_hash={})
|
3
|
+
super
|
4
|
+
|
5
|
+
after_extension_activated :extension_two do
|
6
|
+
app.set :extension_two_was_activated, true
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
ExtensionOne.register
|
12
|
+
|
13
|
+
class ExtensionTwo < ::Middleman::Extension
|
14
|
+
def initialize(app, options_hash={})
|
15
|
+
super
|
16
|
+
|
17
|
+
after_extension_activated :extension_one do
|
18
|
+
app.set :extension_one_was_activated, true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
ExtensionTwo.register
|
24
|
+
|
25
|
+
activate :extension_one
|
26
|
+
activate :extension_two
|
@@ -142,6 +142,7 @@ module Middleman
|
|
142
142
|
# Search the root of the project for required files
|
143
143
|
$LOAD_PATH.unshift(root)
|
144
144
|
|
145
|
+
::Middleman::Extension.clear_after_extension_callbacks
|
145
146
|
run_hook :initialized
|
146
147
|
|
147
148
|
if config[:autoload_sprockets]
|
@@ -178,7 +179,7 @@ module Middleman
|
|
178
179
|
run_hook :after_configuration
|
179
180
|
|
180
181
|
logger.debug "Loaded extensions:"
|
181
|
-
self.extensions.each do |ext,
|
182
|
+
self.extensions.each do |ext, klass|
|
182
183
|
if ext.is_a?(Hash)
|
183
184
|
ext.each do |k,_|
|
184
185
|
logger.debug "== Extension: #{k}"
|
@@ -186,6 +187,10 @@ module Middleman
|
|
186
187
|
else
|
187
188
|
logger.debug "== Extension: #{ext}"
|
188
189
|
end
|
190
|
+
|
191
|
+
if klass.is_a?(::Middleman::Extension)
|
192
|
+
::Middleman::Extension.activated_extension(klass)
|
193
|
+
end
|
189
194
|
end
|
190
195
|
end
|
191
196
|
end
|
@@ -413,8 +413,7 @@ module Middleman
|
|
413
413
|
@_out_buf = _buf_was
|
414
414
|
end
|
415
415
|
|
416
|
-
|
417
|
-
concat_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content }
|
416
|
+
concat_safe_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content }
|
418
417
|
ensure
|
419
418
|
@current_engine = engine_was
|
420
419
|
end
|
@@ -130,7 +130,7 @@ module Middleman
|
|
130
130
|
def server(&block)
|
131
131
|
@@servercounter ||= 0
|
132
132
|
@@servercounter += 1
|
133
|
-
const_set("MiddlemanApplication#{@@servercounter}", Class.new(Middleman::Application))
|
133
|
+
const_set("MiddlemanApplication#{@@servercounter}", Class.new(Middleman::Application, &block))
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
@@ -142,7 +142,7 @@ module Middleman
|
|
142
142
|
#
|
143
143
|
# @return [Class]
|
144
144
|
def server(&block)
|
145
|
-
::Middleman::Application.server
|
145
|
+
::Middleman::Application.server(&block)
|
146
146
|
end
|
147
147
|
end
|
148
148
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require "active_support/core_ext/class/attribute"
|
2
|
+
require "active_support/core_ext/module/delegation"
|
2
3
|
|
3
4
|
module Middleman
|
4
5
|
|
@@ -131,11 +132,31 @@ module Middleman
|
|
131
132
|
def activate
|
132
133
|
new(::Middleman::Application)
|
133
134
|
end
|
135
|
+
|
136
|
+
def clear_after_extension_callbacks
|
137
|
+
@_extension_activation_callbacks = {}
|
138
|
+
end
|
139
|
+
|
140
|
+
def after_extension_activated(name, &block)
|
141
|
+
@_extension_activation_callbacks ||= {}
|
142
|
+
@_extension_activation_callbacks[name] ||= []
|
143
|
+
@_extension_activation_callbacks[name] << block if block_given?
|
144
|
+
end
|
145
|
+
|
146
|
+
def activated_extension(instance)
|
147
|
+
name = instance.class.extension_name
|
148
|
+
return unless @_extension_activation_callbacks && @_extension_activation_callbacks[name]
|
149
|
+
@_extension_activation_callbacks[name].each do |block|
|
150
|
+
block.arity == 1 ? block.call(instance) : block.call()
|
151
|
+
end
|
152
|
+
end
|
134
153
|
end
|
135
154
|
|
136
155
|
attr_accessor :options
|
137
156
|
attr_reader :app
|
138
157
|
|
158
|
+
delegate :after_extension_activated, :to => :"::Middleman::Extension"
|
159
|
+
|
139
160
|
def initialize(klass, options_hash={}, &block)
|
140
161
|
@_helpers = []
|
141
162
|
@klass = klass
|
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
if !defined?(::Padrino::Helpers)
|
2
|
+
require 'vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/support_lite'
|
3
|
+
require 'vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers'
|
4
|
+
end
|
2
5
|
|
3
6
|
module Middleman
|
4
7
|
module MetaPages
|
@@ -1,11 +1,25 @@
|
|
1
|
+
if !defined?(::Padrino::Helpers)
|
2
|
+
require 'vendored-middleman-deps/padrino-core-0.11.2/lib/padrino-core/support_lite'
|
3
|
+
require 'vendored-middleman-deps/padrino-helpers-0.11.2/lib/padrino-helpers'
|
4
|
+
end
|
5
|
+
|
6
|
+
class Padrino::Helpers::OutputHelpers::ErbHandler
|
7
|
+
# Force Erb capture not to use safebuffer
|
8
|
+
def capture_from_template(*args, &block)
|
9
|
+
self.output_buffer, _buf_was = "", self.output_buffer
|
10
|
+
captured_block = block.call(*args)
|
11
|
+
ret = eval("@_out_buf", block.binding)
|
12
|
+
self.output_buffer = _buf_was
|
13
|
+
[ ret, captured_block ]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
1
17
|
class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension
|
2
18
|
|
3
19
|
def initialize(app, options_hash={}, &block)
|
4
20
|
super
|
5
21
|
|
6
22
|
require 'active_support/core_ext/object/to_query'
|
7
|
-
require 'vendored-middleman-deps/padrino-core-0.10.7/lib/padrino-core/support_lite'
|
8
|
-
require 'vendored-middleman-deps/padrino-helpers-0.10.7/lib/padrino-helpers'
|
9
23
|
|
10
24
|
app.helpers ::Padrino::Helpers::OutputHelpers
|
11
25
|
app.helpers ::Padrino::Helpers::TagHelpers
|
@@ -15,7 +29,7 @@ class Middleman::CoreExtensions::DefaultHelpers < ::Middleman::Extension
|
|
15
29
|
app.helpers ::Padrino::Helpers::RenderHelpers
|
16
30
|
app.helpers ::Padrino::Helpers::NumberHelpers
|
17
31
|
# app.helpers ::Padrino::Helpers::TranslationHelpers
|
18
|
-
|
32
|
+
app.helpers ::Padrino::Helpers::Breadcrumbs
|
19
33
|
|
20
34
|
app.config.define_setting :relative_links, false, 'Whether to generate relative links instead of absolute ones'
|
21
35
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/vendored-middleman-deps/{padrino-core-0.10.7 → padrino-core-0.11.2}/lib/padrino-core.rb
RENAMED
@@ -1,8 +1,19 @@
|
|
1
1
|
require 'sinatra/base'
|
2
|
-
require 'padrino-core/
|
2
|
+
require 'padrino-core/version'
|
3
|
+
require 'padrino-core/support_lite'
|
4
|
+
require 'padrino-core/application'
|
5
|
+
|
6
|
+
require 'padrino-core/caller'
|
7
|
+
require 'padrino-core/command'
|
8
|
+
require 'padrino-core/loader'
|
9
|
+
require 'padrino-core/logger'
|
10
|
+
require 'padrino-core/mounter'
|
11
|
+
require 'padrino-core/reloader'
|
12
|
+
require 'padrino-core/router'
|
13
|
+
require 'padrino-core/server'
|
14
|
+
require 'padrino-core/tasks'
|
15
|
+
require 'padrino-core/module'
|
3
16
|
|
4
|
-
FileSet.glob_require('padrino-core/application/*.rb', __FILE__)
|
5
|
-
FileSet.glob_require('padrino-core/*.rb', __FILE__)
|
6
17
|
|
7
18
|
# The Padrino environment (falls back to the rack env or finally develop)
|
8
19
|
PADRINO_ENV = ENV["PADRINO_ENV"] ||= ENV["RACK_ENV"] ||= "development" unless defined?(PADRINO_ENV)
|
@@ -80,7 +91,14 @@ module Padrino
|
|
80
91
|
# end
|
81
92
|
#
|
82
93
|
def configure_apps(&block)
|
83
|
-
|
94
|
+
return unless block_given?
|
95
|
+
@@_global_configurations ||= []
|
96
|
+
@@_global_configurations << block
|
97
|
+
@_global_configuration = lambda do |app|
|
98
|
+
@@_global_configurations.each do |configuration|
|
99
|
+
app.class_eval(&configuration)
|
100
|
+
end
|
101
|
+
end
|
84
102
|
end
|
85
103
|
|
86
104
|
##
|
@@ -148,5 +166,41 @@ module Padrino
|
|
148
166
|
def use(m, *args, &block)
|
149
167
|
middleware << [m, args, block]
|
150
168
|
end
|
169
|
+
|
170
|
+
##
|
171
|
+
# Registers a gem with padrino. This relieves the caller from setting up
|
172
|
+
# loadpaths by himself and enables Padrino to look up apps in gem folder.
|
173
|
+
#
|
174
|
+
# The name given has to be the proper gem name as given in the gemspec.
|
175
|
+
#
|
176
|
+
# @param [String] name
|
177
|
+
# The name of the gem being registered.
|
178
|
+
#
|
179
|
+
# @param [Module] main_module
|
180
|
+
# The main module of the gem.
|
181
|
+
#
|
182
|
+
# @returns The root path of the loaded gem
|
183
|
+
def gem(name, main_module)
|
184
|
+
_,spec = Gem.loaded_specs.find { |spec_name, spec| spec_name == name }
|
185
|
+
gems << spec
|
186
|
+
modules << main_module
|
187
|
+
spec.full_gem_path
|
188
|
+
end
|
189
|
+
|
190
|
+
##
|
191
|
+
# Returns all currently known padrino gems.
|
192
|
+
#
|
193
|
+
# @returns [Gem::Specification]
|
194
|
+
def gems
|
195
|
+
@gems ||= []
|
196
|
+
end
|
197
|
+
|
198
|
+
##
|
199
|
+
# All loaded Padrino modules.
|
200
|
+
#
|
201
|
+
# @returns [<Padrino::Module>]
|
202
|
+
def modules
|
203
|
+
@modules ||= []
|
204
|
+
end
|
151
205
|
end # self
|
152
206
|
end # Padrino
|
@@ -1,3 +1,8 @@
|
|
1
|
+
require 'padrino-core/application/rendering'
|
2
|
+
require 'padrino-core/application/routing'
|
3
|
+
require 'padrino-core/application/flash'
|
4
|
+
require 'padrino-core/application/showexceptions'
|
5
|
+
|
1
6
|
module Padrino
|
2
7
|
class ApplicationSetupError < RuntimeError # @private
|
3
8
|
end
|
@@ -173,17 +178,21 @@ module Padrino
|
|
173
178
|
set :method_override, true
|
174
179
|
set :sessions, false
|
175
180
|
set :public_folder, Proc.new { Padrino.root('public', uri_root) }
|
176
|
-
set :views, Proc.new { File.join(root,
|
177
|
-
set :images_path, Proc.new { File.join(
|
178
|
-
set :protection,
|
181
|
+
set :views, Proc.new { File.join(root, 'views') }
|
182
|
+
set :images_path, Proc.new { File.join(public_folder, 'images') }
|
183
|
+
set :protection, true
|
184
|
+
# Haml specific
|
185
|
+
set :haml, { :ugly => (Padrino.env == :production) } if defined?(Haml)
|
179
186
|
# Padrino specific
|
180
187
|
set :uri_root, '/'
|
181
188
|
set :app_name, settings.to_s.underscore.to_sym
|
182
189
|
set :default_builder, 'StandardFormBuilder'
|
183
|
-
set :flash, defined?(Sinatra::Flash) || defined?(Rack::Flash)
|
184
190
|
set :authentication, false
|
185
191
|
# Padrino locale
|
186
192
|
set :locale_path, Proc.new { Dir[File.join(settings.root, '/locale/**/*.{rb,yml}')] }
|
193
|
+
# Authenticity token
|
194
|
+
set :protect_from_csrf, false
|
195
|
+
set :allow_disabled_csrf, false
|
187
196
|
# Load the Global Configurations
|
188
197
|
class_eval(&Padrino.apps_configuration) if Padrino.apps_configuration
|
189
198
|
end
|
@@ -241,27 +250,42 @@ module Padrino
|
|
241
250
|
# Also initializes the application after setting up the middleware
|
242
251
|
def setup_default_middleware(builder)
|
243
252
|
setup_sessions builder
|
244
|
-
setup_flash builder
|
245
253
|
builder.use Padrino::ShowExceptions if show_exceptions?
|
246
254
|
builder.use Padrino::Logger::Rack, uri_root if Padrino.logger && logging?
|
247
255
|
builder.use Padrino::Reloader::Rack if reload?
|
248
256
|
builder.use Rack::MethodOverride if method_override?
|
249
257
|
builder.use Rack::Head
|
258
|
+
register Padrino::Flash
|
250
259
|
setup_protection builder
|
260
|
+
setup_csrf_protection builder
|
251
261
|
setup_application!
|
252
262
|
end
|
253
263
|
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
264
|
+
# sets up csrf protection for the app
|
265
|
+
def setup_csrf_protection(builder)
|
266
|
+
if protect_from_csrf? && !sessions?
|
267
|
+
raise(<<-ERROR)
|
268
|
+
`protect_from_csrf` is activated, but `sessions` are not. To enable csrf
|
269
|
+
protection, use:
|
270
|
+
|
271
|
+
enable :sessions
|
272
|
+
|
273
|
+
or deactivate protect_from_csrf:
|
274
|
+
|
275
|
+
disable :protect_from_csrf
|
276
|
+
ERROR
|
277
|
+
end
|
278
|
+
|
279
|
+
if protect_from_csrf?
|
280
|
+
if allow_disabled_csrf?
|
281
|
+
builder.use Rack::Protection::AuthenticityToken,
|
282
|
+
:reaction => :report,
|
283
|
+
:report_key => 'protection.csrf.failed',
|
284
|
+
:logger => logger
|
285
|
+
else
|
286
|
+
builder.use Rack::Protection::AuthenticityToken,
|
287
|
+
:logger => logger
|
288
|
+
end
|
265
289
|
end
|
266
290
|
end
|
267
291
|
end # self
|