middleman 2.0.16.1 → 3.0.0.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/CHANGELOG +16 -8
- data/features/builder.feature +2 -5
- data/features/cache_buster.feature +1 -1
- data/features/clean_build.feature +0 -1
- data/features/coffee-script.feature +3 -3
- data/features/custom_layout_engines.feature +10 -0
- data/features/directory_index.feature +0 -1
- data/features/dynamic_pages.feature +0 -1
- data/features/fonts.feature +0 -1
- data/features/{padrino_helpers.feature → former_padrino_helpers.feature} +1 -1
- data/features/sprockets.feature +34 -5
- data/features/sprockets_gems.feature +7 -4
- data/features/step_definitions/asset_host_steps.rb +7 -6
- data/features/step_definitions/builder_steps.rb +4 -0
- data/features/step_definitions/middleman_steps.rb +22 -16
- data/features/step_definitions/page_layout_steps.rb +10 -8
- data/fixtures/custom-layout-app/config.rb +1 -0
- data/fixtures/custom-layout-app/source/index.html.erb +1 -0
- data/fixtures/custom-layout-app/source/layout.haml +6 -0
- data/fixtures/sprockets-app/config.rb +2 -1
- data/fixtures/sprockets-app/source/library/css/bootstrap_include.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/plain.css +3 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_base1.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_base2.css.scss +1 -0
- data/fixtures/sprockets-app/source/library/css/sprockets_sub.css.scss +1 -0
- data/fixtures/sprockets-app/source/{jquery_include.js → library/js/jquery_include.js} +0 -0
- data/fixtures/sprockets-app/source/library/js/plain.js +3 -0
- data/fixtures/sprockets-app/source/library/{javascripts → js}/sprockets_base.js +0 -0
- data/fixtures/sprockets-app/source/library/{javascripts → js}/sprockets_sub.js +0 -0
- data/fixtures/test-app/config.rb +5 -4
- data/fixtures/test-app/source/{padrino_test.html.haml → former_padrino_test.html.haml} +0 -0
- data/fixtures/test-app/source/stylesheets/sprockets_base1.css.scss +1 -0
- data/fixtures/test-app/source/stylesheets/sprockets_base2.css.scss +1 -0
- data/fixtures/test-app/source/stylesheets/sprockets_sub.css.scss +1 -0
- data/lib/middleman.rb +27 -25
- data/lib/middleman/base.rb +408 -166
- data/lib/middleman/builder.rb +78 -162
- data/lib/middleman/cli.rb +61 -32
- data/lib/middleman/core_extensions/assets.rb +4 -44
- data/lib/middleman/core_extensions/builder.rb +12 -16
- data/lib/middleman/core_extensions/compass.rb +28 -57
- data/lib/middleman/core_extensions/data.rb +65 -49
- data/lib/middleman/core_extensions/default_helpers.rb +33 -18
- data/lib/middleman/core_extensions/features.rb +48 -26
- data/lib/middleman/core_extensions/file_watcher.rb +66 -0
- data/lib/middleman/core_extensions/front_matter.rb +91 -86
- data/lib/middleman/core_extensions/rendering.rb +9 -8
- data/lib/middleman/core_extensions/routing.rb +19 -53
- data/lib/middleman/core_extensions/sitemap.rb +229 -0
- data/lib/middleman/core_extensions/sprockets.rb +53 -37
- data/lib/middleman/features/asset_host.rb +20 -10
- data/lib/middleman/features/automatic_image_sizes.rb +12 -9
- data/lib/middleman/features/cache_buster.rb +38 -25
- data/lib/middleman/features/directory_indexes.rb +31 -28
- data/lib/middleman/features/minify_css.rb +3 -2
- data/lib/middleman/features/minify_css/cssmin.rb +55 -0
- data/lib/middleman/features/minify_javascript.rb +12 -5
- data/lib/middleman/features/relative_assets.rb +28 -25
- data/lib/middleman/features/sitemap_tree.rb +34 -0
- data/lib/middleman/guard.rb +57 -23
- data/lib/middleman/renderers/erb.rb +29 -0
- data/lib/middleman/renderers/liquid.rb +3 -12
- data/lib/middleman/renderers/markdown.rb +16 -15
- data/lib/middleman/renderers/sass.rb +34 -38
- data/lib/middleman/vendor/hooks-0.2.0/CHANGES.textile +9 -0
- data/lib/middleman/vendor/hooks-0.2.0/Gemfile +3 -0
- data/lib/middleman/vendor/hooks-0.2.0/README.rdoc +107 -0
- data/lib/middleman/vendor/hooks-0.2.0/Rakefile +12 -0
- data/lib/middleman/vendor/hooks-0.2.0/hooks.gemspec +22 -0
- data/lib/middleman/vendor/hooks-0.2.0/lib/hooks.rb +109 -0
- data/lib/middleman/vendor/hooks-0.2.0/lib/hooks/inheritable_attribute.rb +33 -0
- data/lib/middleman/vendor/hooks-0.2.0/test/hooks_test.rb +141 -0
- data/lib/middleman/vendor/hooks-0.2.0/test/inheritable_attribute_test.rb +55 -0
- data/lib/middleman/vendor/hooks-0.2.0/test/test_helper.rb +10 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/.document +5 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/.gitignore +22 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/.yardopts +1 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/LICENSE.txt +20 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/README.rdoc +294 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/Rakefile +5 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/bin/padrino +9 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core.rb +167 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application.rb +270 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/rendering.rb +292 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/routing.rb +934 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/application/showexceptions.rb +20 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/caller.rb +53 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/adapter.rb +24 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/base.rb +151 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/console.rb +20 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake.rb +24 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake_tasks.rb +59 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/command.rb +38 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/images/404.png +0 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/images/500.png +0 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/loader.rb +210 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/cs.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/da.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/de.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/en.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/es.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/fr.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/hu.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/it.yml +40 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ja.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/lv.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/nl.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/no.yml +35 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pl.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pt_br.yml +40 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ru.yml +35 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/tr.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/uk.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_cn.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_tw.yml +34 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/logger.rb +345 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/mounter.rb +224 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/reloader.rb +254 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/router.rb +98 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/server.rb +79 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite.rb +199 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/tasks.rb +21 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/lib/padrino-core/version.rb +20 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/padrino-core.gemspec +38 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/.components +6 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/.gitignore +7 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/complex.rb +32 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/apps/simple.rb +33 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/a.rb +9 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/b.rb +4 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/c.rb +1 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/e.rb +13 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/f.rb +2 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/g.rb +2 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/fixtures/dependencies/d.rb +4 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/helper.rb +81 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/mini_shoulda.rb +45 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_application.rb +108 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_core.rb +79 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_dependencies.rb +44 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_filters.rb +278 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_locale.rb +21 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_logger.rb +100 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_mounter.rb +177 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_reloader_complex.rb +75 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_reloader_simple.rb +98 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_rendering.rb +461 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_restful_routing.rb +33 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_router.rb +146 -0
- data/lib/middleman/vendor/padrino-core-0.10.5/test/test_routing.rb +1673 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/.document +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/.gitignore +21 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/.yardopts +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/LICENSE.txt +20 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/README.rdoc +239 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/Rakefile +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers.rb +58 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/asset_tag_helpers.rb +420 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/abstract_form_builder.rb +220 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/standard_form_builder.rb +43 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_helpers.rb +602 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/format_helpers.rb +381 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/cs.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/da.yml +91 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/de.yml +81 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/en.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/es.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/fr.yml +80 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/hu.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/it.yml +89 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ja.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/lv.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/nl.yml +82 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/no.yml +91 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pl.yml +95 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pt_br.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ru.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/tr.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/uk.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_cn.yml +104 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_tw.yml +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/number_helpers.rb +288 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers.rb +175 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/abstract_handler.rb +98 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/erb_handler.rb +79 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/haml_handler.rb +63 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/slim_handler.rb +81 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/render_helpers.rb +60 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/tag_helpers.rb +103 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/translation_helpers.rb +38 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/padrino-helpers.gemspec +27 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/app.rb +73 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.erb +14 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.haml +12 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.slim +13 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.erb +14 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.haml +12 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.slim +12 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.erb +11 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.haml +9 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.slim +9 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.erb +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.haml +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.slim +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.erb +20 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.haml +15 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.slim +15 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.erb +56 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.haml +47 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.slim +47 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.erb +56 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.haml +45 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.slim +45 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.erb +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.haml +4 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.slim +4 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.erb +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.haml +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.slim +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.erb +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.haml +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.slim +3 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_erb.erb +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_haml.haml +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_slim.slim +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.erb +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.haml +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.slim +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/app.rb +50 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engine.haml +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_erb.erb +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_haml.haml +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_slim.slim +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/erb/test.erb +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/explicit_engine.haml +5 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/haml/test.haml +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/_user.haml +7 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/haml_template.haml +1 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/some_template.haml +2 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/helper.rb +66 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_asset_tag_helpers.rb +320 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_form_builder.rb +996 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_form_helpers.rb +645 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_format_helpers.rb +227 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_locale.rb +20 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_number_helpers.rb +136 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_output_helpers.rb +153 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_render_helpers.rb +76 -0
- data/lib/middleman/vendor/padrino-helpers-0.10.5/test/test_tag_helpers.rb +105 -0
- data/lib/middleman/version.rb +1 -1
- data/middleman-x86-mingw32.gemspec +16 -33
- data/middleman.gemspec +16 -31
- metadata +590 -349
- data/features/sinatra.feature +0 -6
- data/lib/middleman/core_extensions/rack_map.rb +0 -35
- data/lib/middleman/renderers/coffee_script.rb +0 -8
- data/lib/middleman/renderers/haml.rb +0 -31
- data/lib/middleman/renderers/slim.rb +0 -8
@@ -2,56 +2,16 @@ module Middleman::CoreExtensions::Assets
|
|
2
2
|
class << self
|
3
3
|
def registered(app)
|
4
4
|
# Disable Padrino cache buster until explicitly enabled
|
5
|
-
app.set :asset_stamp, false
|
5
|
+
# app.set :asset_stamp, false
|
6
6
|
|
7
|
-
app.
|
8
|
-
|
9
|
-
app.helpers Helpers
|
10
|
-
|
11
|
-
app.register_asset_handler :base do |path, prefix, request|
|
12
|
-
path.include?("://") ? path : File.join(app.http_prefix || "/", prefix, path)
|
13
|
-
end
|
7
|
+
app.send :include, InstanceMethod
|
14
8
|
end
|
15
9
|
alias :included :registered
|
16
10
|
end
|
17
11
|
|
18
|
-
module
|
19
|
-
def register_asset_handler(handler_name, &block)
|
20
|
-
@asset_handler_map ||= []
|
21
|
-
@asset_handler_stack ||= []
|
22
|
-
|
23
|
-
if block_given?
|
24
|
-
@asset_handler_stack << block
|
25
|
-
@asset_handler_map << handler_name
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def asset_handler_get_url(path, prefix="", request=nil)
|
30
|
-
@asset_handler_map ||= []
|
31
|
-
@asset_handler_stack ||= []
|
32
|
-
|
33
|
-
@asset_handler_stack.last.call(path, prefix, request)
|
34
|
-
end
|
35
|
-
|
36
|
-
def before_asset_handler(position, *args)
|
37
|
-
@asset_handler_map ||= []
|
38
|
-
@asset_handler_stack ||= []
|
39
|
-
|
40
|
-
current_index = @asset_handler_map.index(position)
|
41
|
-
return nil unless current_index
|
42
|
-
|
43
|
-
previous = current_index - 1
|
44
|
-
if (previous >= 0) && (previous < @asset_handler_map.length)
|
45
|
-
@asset_handler_stack[previous].call(*args)
|
46
|
-
else
|
47
|
-
nil
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
module Helpers
|
12
|
+
module InstanceMethod
|
53
13
|
def asset_url(path, prefix="")
|
54
|
-
|
14
|
+
path.include?("://") ? path : File.join(self.http_prefix || "/", prefix, path)
|
55
15
|
end
|
56
16
|
end
|
57
17
|
end
|
@@ -1,34 +1,30 @@
|
|
1
1
|
module Middleman::CoreExtensions::Builder
|
2
2
|
class << self
|
3
3
|
def registered(app)
|
4
|
+
app.define_hook :after_build
|
4
5
|
app.extend ClassMethods
|
6
|
+
app.send :include, InstanceMethods
|
5
7
|
end
|
6
8
|
end
|
7
9
|
|
8
10
|
module ClassMethods
|
9
|
-
# Add a block/proc to be run after features have been setup
|
10
|
-
def after_build(&block)
|
11
|
-
@run_after_build ||= []
|
12
|
-
@run_after_build << block
|
13
|
-
end
|
14
|
-
|
15
|
-
def after_build_callbacks
|
16
|
-
@run_after_build ||= []
|
17
|
-
@run_after_build
|
18
|
-
end
|
19
|
-
|
20
11
|
def build_reroute(&block)
|
21
12
|
@build_rerouters ||= []
|
22
|
-
@build_rerouters << block
|
13
|
+
@build_rerouters << block if block_given?
|
14
|
+
@build_rerouters
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module InstanceMethods
|
19
|
+
def build_reroute(&block)
|
20
|
+
self.class.build_reroute(&block)
|
23
21
|
end
|
24
22
|
|
25
23
|
def reroute_builder(desination, request_path)
|
26
|
-
@build_rerouters ||= []
|
27
|
-
|
28
24
|
result = [desination, request_path]
|
29
25
|
|
30
|
-
|
31
|
-
output =
|
26
|
+
build_reroute.each do |block|
|
27
|
+
output = instance_exec(desination, request_path, &block)
|
32
28
|
if output
|
33
29
|
result = output
|
34
30
|
break
|
@@ -1,18 +1,12 @@
|
|
1
|
+
require "compass"
|
2
|
+
|
1
3
|
module Middleman::CoreExtensions::Compass
|
2
4
|
class << self
|
3
5
|
def registered(app)
|
4
6
|
# Where to look for fonts
|
5
7
|
app.set :fonts_dir, "fonts"
|
6
|
-
|
7
|
-
app.
|
8
|
-
|
9
|
-
require "compass"
|
10
|
-
|
11
|
-
# Susy grids
|
12
|
-
begin
|
13
|
-
require "susy"
|
14
|
-
rescue LoadError
|
15
|
-
end
|
8
|
+
app.define_hook :compass_config
|
9
|
+
app.define_hook :after_compass_config
|
16
10
|
|
17
11
|
app.after_configuration do
|
18
12
|
# Support a stand-alone compass config file
|
@@ -24,60 +18,51 @@ module Middleman::CoreExtensions::Compass
|
|
24
18
|
# * line_comments
|
25
19
|
# * sprite_engine
|
26
20
|
# * chunky_png_options
|
27
|
-
compass_config_file = File.join(
|
21
|
+
compass_config_file = File.join(self.root, "compass.config")
|
28
22
|
if File.exists?(compass_config_file)
|
29
23
|
::Compass.add_project_configuration(compass_config_file)
|
30
24
|
end
|
31
25
|
|
32
26
|
::Compass.configuration do |config|
|
33
|
-
config.project_path =
|
27
|
+
config.project_path = self.root
|
34
28
|
config.environment = :development
|
35
|
-
config.cache_path = File.join(
|
29
|
+
config.cache_path = File.join(self.root, ".sass-cache")
|
36
30
|
|
37
|
-
views_root = File.basename(
|
38
|
-
config.sass_dir = File.join(views_root,
|
39
|
-
config.css_dir = File.join(views_root,
|
40
|
-
config.javascripts_dir = File.join(views_root,
|
41
|
-
config.fonts_dir = File.join(views_root,
|
42
|
-
config.images_dir = File.join(views_root,
|
31
|
+
views_root = File.basename(self.views)
|
32
|
+
config.sass_dir = File.join(views_root, self.css_dir)
|
33
|
+
config.css_dir = File.join(views_root, self.css_dir)
|
34
|
+
config.javascripts_dir = File.join(views_root, self.js_dir)
|
35
|
+
config.fonts_dir = File.join(views_root, self.fonts_dir)
|
36
|
+
config.images_dir = File.join(views_root, self.images_dir)
|
43
37
|
|
44
|
-
config.http_images_path = if
|
45
|
-
|
38
|
+
config.http_images_path = if self.respond_to? :http_images_path
|
39
|
+
self.http_images_path
|
46
40
|
else
|
47
|
-
File.join(
|
48
|
-
end
|
49
|
-
|
50
|
-
# Correctly support HTTP paths with generated sprites
|
51
|
-
if config.respond_to? :http_generated_images_path
|
52
|
-
config.http_generated_images_path = if app.respond_to? :http_generated_images_path
|
53
|
-
app.http_generated_images_path
|
54
|
-
else
|
55
|
-
File.join(app.http_prefix || "/", app.images_dir)
|
56
|
-
end
|
41
|
+
File.join(self.http_prefix || "/", self.images_dir)
|
57
42
|
end
|
58
43
|
|
59
|
-
config.http_stylesheets_path = if
|
60
|
-
|
44
|
+
config.http_stylesheets_path = if self.respond_to? :http_css_path
|
45
|
+
self.http_css_path
|
61
46
|
else
|
62
|
-
File.join(
|
47
|
+
File.join(self.http_prefix || "/", self.css_dir)
|
63
48
|
end
|
64
49
|
|
65
|
-
config.http_javascripts_path = if
|
66
|
-
|
50
|
+
config.http_javascripts_path = if self.respond_to? :http_js_path
|
51
|
+
self.http_js_path
|
67
52
|
else
|
68
|
-
File.join(
|
53
|
+
File.join(self.http_prefix || "/", self.js_dir)
|
69
54
|
end
|
70
55
|
|
71
|
-
config.http_fonts_path = if
|
72
|
-
|
56
|
+
config.http_fonts_path = if self.respond_to? :http_fonts_path
|
57
|
+
self.http_fonts_path
|
73
58
|
else
|
74
|
-
File.join(
|
59
|
+
File.join(self.http_prefix || "/", self.fonts_dir)
|
75
60
|
end
|
76
61
|
|
77
62
|
config.asset_cache_buster :none
|
78
63
|
config.output_style = :nested
|
79
64
|
|
80
|
-
config.add_import_path(config.sass_dir)
|
65
|
+
# config.add_import_path(config.sass_dir)
|
81
66
|
end
|
82
67
|
|
83
68
|
# Required for relative paths
|
@@ -92,24 +77,10 @@ module Middleman::CoreExtensions::Compass
|
|
92
77
|
end
|
93
78
|
end
|
94
79
|
|
95
|
-
|
96
|
-
|
97
|
-
app.set :sass, ::Compass.configuration.to_sass_engine_options
|
80
|
+
run_hook :compass_config, ::Compass.configuration
|
81
|
+
run_hook :after_compass_config
|
98
82
|
end
|
99
83
|
end
|
100
84
|
alias :included :registered
|
101
85
|
end
|
102
|
-
|
103
|
-
module ClassMethods
|
104
|
-
# Add a block/proc to be run after features have been setup
|
105
|
-
def compass_config(&block)
|
106
|
-
@run_after_compass ||= []
|
107
|
-
@run_after_compass << block
|
108
|
-
end
|
109
|
-
|
110
|
-
def execute_after_compass_init!
|
111
|
-
@run_after_compass ||= []
|
112
|
-
@run_after_compass.each { |block| block.call(::Compass.configuration) }
|
113
|
-
end
|
114
|
-
end
|
115
86
|
end
|
@@ -6,21 +6,70 @@ module Middleman::CoreExtensions::Data
|
|
6
6
|
class << self
|
7
7
|
def registered(app)
|
8
8
|
app.set :data_dir, "data"
|
9
|
-
app.
|
10
|
-
app.helpers Helpers
|
9
|
+
app.send :include, InstanceMethods
|
11
10
|
end
|
12
11
|
alias :included :registered
|
13
12
|
end
|
14
13
|
|
15
|
-
module
|
14
|
+
module InstanceMethods
|
15
|
+
def initialize
|
16
|
+
file_changed DataStore.matcher do |file|
|
17
|
+
data.touch_file(file) if file.match(%r{^#{data_dir}\/})
|
18
|
+
end
|
19
|
+
|
20
|
+
file_deleted DataStore.matcher do |file|
|
21
|
+
data.remove_file(file) if file.match(%r{^#{data_dir}\/})
|
22
|
+
end
|
23
|
+
|
24
|
+
super
|
25
|
+
end
|
26
|
+
|
16
27
|
def data
|
17
|
-
self
|
28
|
+
@data ||= DataStore.new(self)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Makes a hash available on the data var with a given name
|
32
|
+
def data_content(name, content)
|
33
|
+
DataStore.data_content(name, content)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Makes a hash available on the data var with a given name
|
37
|
+
def data_callback(name, &block)
|
38
|
+
DataStore.data_callback(name, block)
|
18
39
|
end
|
19
40
|
end
|
20
41
|
|
21
|
-
class
|
42
|
+
class DataStore
|
43
|
+
def self.matcher
|
44
|
+
%r{[\w-]+\.(yml|yaml|json)$}
|
45
|
+
end
|
46
|
+
|
22
47
|
def initialize(app)
|
23
48
|
@app = app
|
49
|
+
@local_data = {}
|
50
|
+
end
|
51
|
+
|
52
|
+
def touch_file(file)
|
53
|
+
file = File.expand_path(file, @app.root)
|
54
|
+
extension = File.extname(file)
|
55
|
+
basename = File.basename(file, extension)
|
56
|
+
|
57
|
+
if %w(.yaml .yml).include?(extension)
|
58
|
+
data = YAML.load_file(file)
|
59
|
+
elsif extension == ".json"
|
60
|
+
data = ActiveSupport::JSON.decode(File.read(file))
|
61
|
+
else
|
62
|
+
return
|
63
|
+
end
|
64
|
+
|
65
|
+
# @app.logger.debug :data_update, Time.now, basename if @app.logging?
|
66
|
+
@local_data[basename] = recursively_enhance(data)
|
67
|
+
end
|
68
|
+
|
69
|
+
def remove_file(file)
|
70
|
+
extension = File.extname(file)
|
71
|
+
basename = File.basename(file, extension)
|
72
|
+
@local_data.delete(basename) if @local_data.has_key?(basename)
|
24
73
|
end
|
25
74
|
|
26
75
|
def data_for_path(path)
|
@@ -33,32 +82,23 @@ module Middleman::CoreExtensions::Data
|
|
33
82
|
response = @@local_sources[path.to_s]
|
34
83
|
elsif @@callback_sources.has_key?(path.to_s)
|
35
84
|
response = @@callback_sources[path.to_s].call()
|
36
|
-
else
|
37
|
-
file_path = File.join(@app.root, @app.data_dir, "#{path}.yml")
|
38
|
-
if File.exists? file_path
|
39
|
-
response = YAML.load_file(file_path)
|
40
|
-
else
|
41
|
-
file_path = File.join(@app.root, @app.data_dir, "#{path}.yaml")
|
42
|
-
if File.exists? file_path
|
43
|
-
response = YAML.load_file(file_path)
|
44
|
-
else
|
45
|
-
file_path = File.join(@app.root, @app.data_dir, "#{path}.json")
|
46
|
-
response = ActiveSupport::JSON.decode(File.read(file_path)) if File.exists? file_path
|
47
|
-
end
|
48
|
-
end
|
49
85
|
end
|
50
86
|
|
51
87
|
response
|
52
88
|
end
|
53
89
|
|
54
90
|
def method_missing(path)
|
55
|
-
|
56
|
-
|
57
|
-
if result
|
58
|
-
recursively_enhance(result)
|
91
|
+
if @local_data.has_key?(path.to_s)
|
92
|
+
return @local_data[path.to_s]
|
59
93
|
else
|
60
|
-
|
94
|
+
result = data_for_path(path)
|
95
|
+
|
96
|
+
if result
|
97
|
+
return recursively_enhance(result)
|
98
|
+
end
|
61
99
|
end
|
100
|
+
|
101
|
+
super
|
62
102
|
end
|
63
103
|
|
64
104
|
def to_h
|
@@ -75,16 +115,8 @@ module Middleman::CoreExtensions::Data
|
|
75
115
|
data[k] = data_for_path(k)
|
76
116
|
end
|
77
117
|
|
78
|
-
|
79
|
-
|
80
|
-
p = f.split("/").last.gsub(".yml", "").gsub(".yaml", "")
|
81
|
-
data[p] = data_for_path(p)
|
82
|
-
end
|
83
|
-
|
84
|
-
json_path = File.join(@app.root, @app.data_dir, "*.json")
|
85
|
-
Dir[json_path].each do |f|
|
86
|
-
p = f.split("/").last.gsub(".json", "")
|
87
|
-
data[p] = data_for_path(p)
|
118
|
+
(@local_data || {}).each do |k, v|
|
119
|
+
data[k] = v
|
88
120
|
end
|
89
121
|
|
90
122
|
data
|
@@ -118,20 +150,4 @@ module Middleman::CoreExtensions::Data
|
|
118
150
|
end
|
119
151
|
end
|
120
152
|
end
|
121
|
-
|
122
|
-
module ClassMethods
|
123
|
-
def data
|
124
|
-
@data ||= DataObject.new(self)
|
125
|
-
end
|
126
|
-
|
127
|
-
# Makes a hash available on the data var with a given name
|
128
|
-
def data_content(name, content)
|
129
|
-
DataObject.data_content(name, content)
|
130
|
-
end
|
131
|
-
|
132
|
-
# Makes a hash available on the data var with a given name
|
133
|
-
def data_callback(name, &block)
|
134
|
-
DataObject.data_callback(name, block)
|
135
|
-
end
|
136
|
-
end
|
137
153
|
end
|
@@ -1,12 +1,26 @@
|
|
1
|
-
require "padrino-
|
1
|
+
require "middleman/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite"
|
2
|
+
require 'i18n'
|
3
|
+
require 'enumerator'
|
4
|
+
require 'active_support/core_ext/string/conversions' # to_date
|
5
|
+
require 'active_support/core_ext/float/rounding' # round
|
6
|
+
require 'active_support/option_merger' # with_options
|
7
|
+
require 'active_support/core_ext/object/with_options' # with_options
|
8
|
+
require 'active_support/inflector' # humanize
|
9
|
+
|
10
|
+
FileSet.glob_require('../vendor/padrino-helpers-0.10.5/lib/padrino-helpers/**/*.rb', __FILE__)
|
2
11
|
|
3
12
|
module Middleman::CoreExtensions::DefaultHelpers
|
4
13
|
class << self
|
5
14
|
def registered(app)
|
6
|
-
|
7
|
-
app.
|
15
|
+
app.helpers ::Padrino::Helpers::OutputHelpers
|
16
|
+
app.helpers ::Padrino::Helpers::TagHelpers
|
17
|
+
app.helpers ::Padrino::Helpers::AssetTagHelpers
|
18
|
+
app.helpers ::Padrino::Helpers::FormHelpers
|
19
|
+
app.helpers ::Padrino::Helpers::FormatHelpers
|
20
|
+
app.helpers ::Padrino::Helpers::RenderHelpers
|
21
|
+
app.helpers ::Padrino::Helpers::NumberHelpers
|
22
|
+
app.helpers ::Padrino::Helpers::TranslationHelpers
|
8
23
|
|
9
|
-
# Middleman Helpers
|
10
24
|
app.helpers Helpers
|
11
25
|
end
|
12
26
|
alias :included :registered
|
@@ -28,25 +42,27 @@ module Middleman::CoreExtensions::DefaultHelpers
|
|
28
42
|
def auto_tag(asset_ext, separator="/", asset_dir=nil)
|
29
43
|
if asset_dir.nil?
|
30
44
|
asset_dir = case asset_ext
|
31
|
-
when :js then self.
|
32
|
-
when :css then self.
|
45
|
+
when :js then self.js_dir
|
46
|
+
when :css then self.css_dir
|
33
47
|
end
|
34
48
|
end
|
35
|
-
|
49
|
+
|
36
50
|
# If the basename of the request as no extension, assume we are serving a
|
37
51
|
# directory and join index_file to the path.
|
38
|
-
path =
|
39
|
-
|
52
|
+
path = full_path(current_path.dup)
|
53
|
+
|
54
|
+
path = path.sub(%r{^/}, '')
|
40
55
|
path = path.gsub(File.extname(path), ".#{asset_ext}")
|
41
56
|
path = path.gsub("/", separator)
|
42
57
|
|
43
|
-
|
44
|
-
|
58
|
+
matching_file = resolve_template(File.join(asset_dir, path))
|
59
|
+
|
60
|
+
yield path if matching_file
|
45
61
|
end
|
46
62
|
|
47
63
|
def page_classes
|
48
|
-
path =
|
49
|
-
path <<
|
64
|
+
path = current_path.dup
|
65
|
+
path << self.index_file if path.match(%r{/$})
|
50
66
|
path = path.gsub(%r{^/}, '')
|
51
67
|
|
52
68
|
classes = []
|
@@ -60,9 +76,9 @@ module Middleman::CoreExtensions::DefaultHelpers
|
|
60
76
|
def asset_path(kind, source)
|
61
77
|
return source if source =~ /^http/
|
62
78
|
asset_folder = case kind
|
63
|
-
when :css then
|
64
|
-
when :js then
|
65
|
-
when :images then
|
79
|
+
when :css then self.css_dir
|
80
|
+
when :js then self.js_dir
|
81
|
+
when :images then self.images_dir
|
66
82
|
else kind.to_s
|
67
83
|
end
|
68
84
|
source = source.to_s.gsub(/\s/, '')
|
@@ -70,8 +86,7 @@ module Middleman::CoreExtensions::DefaultHelpers
|
|
70
86
|
source << ".#{kind}" unless ignore_extension or source =~ /\.#{kind}/
|
71
87
|
result_path = source if source =~ %r{^/} # absolute path
|
72
88
|
result_path ||= asset_url(source, asset_folder)
|
73
|
-
|
74
|
-
"#{result_path}#{timestamp}"
|
89
|
+
"#{result_path}"
|
75
90
|
end
|
76
91
|
end
|
77
92
|
end
|