middleman-core 3.0.0.alpha.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -0
- data/bin/middleman +52 -0
- data/features/3rd_party_cli.feature +5 -0
- data/features/asset_host.feature +7 -0
- data/features/auto_layout.feature +36 -0
- data/features/automatic_image_sizes.feature +16 -0
- data/features/builder.feature +50 -0
- data/features/chained_templates.feature +19 -0
- data/features/clean_build.feature +31 -0
- data/features/cli.feature +120 -0
- data/features/content_for.feature +6 -0
- data/features/current_page_request_path_backwards.feature +6 -0
- data/features/custom_layout_engines.feature +8 -0
- data/features/custom_layouts.feature +44 -0
- data/features/data.feature +22 -0
- data/features/directory_index.feature +36 -0
- data/features/dynamic_pages.feature +95 -0
- data/features/feature_params.feature +6 -0
- data/features/former_padrino_helpers.feature +10 -0
- data/features/front-matter.feature +35 -0
- data/features/helpers_auto_javascript_include_tag.feature +27 -0
- data/features/helpers_auto_stylesheet_link_tag.feature +27 -0
- data/features/helpers_external.feature +6 -0
- data/features/helpers_lorem.feature +6 -0
- data/features/helpers_page_classes.feature +17 -0
- data/features/instance_vars.feature +20 -0
- data/features/mount_rack.feature +8 -0
- data/features/nested_layouts.feature +24 -0
- data/features/partials.feature +41 -0
- data/features/preview_changes.feature +18 -0
- data/features/sitemap_traversal.features +73 -0
- data/features/static_server.feature +6 -0
- data/features/step_definitions/page_layout_steps.rb +15 -0
- data/features/support/env.rb +3 -0
- data/features/wildcard_page_helper.feature +19 -0
- data/fixtures/3rd-party-command/config.rb +10 -0
- data/fixtures/asset-host-app/config.rb +6 -0
- data/fixtures/asset-host-app/source/.htaccess +1 -0
- data/fixtures/asset-host-app/source/asset_host.html.erb +1 -0
- data/fixtures/asset-host-app/source/images/blank.gif +0 -0
- data/fixtures/auto-css-app/config.rb +11 -0
- data/fixtures/auto-css-app/source/auto-css.html.erb +1 -0
- data/fixtures/auto-css-app/source/auto-css/auto-css.html.erb +1 -0
- data/fixtures/auto-css-app/source/auto-css/index.html.erb +1 -0
- data/fixtures/auto-css-app/source/auto-css/sub/auto-css.html.erb +1 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css.css +3 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css/auto-css.css +3 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css/index.css +0 -0
- data/fixtures/auto-css-app/source/stylesheets/auto-css/sub/auto-css.css +3 -0
- data/fixtures/auto-js-app/config.rb +11 -0
- data/fixtures/auto-js-app/source/auto-js.html.erb +1 -0
- data/fixtures/auto-js-app/source/auto-js/auto-js.html.erb +1 -0
- data/fixtures/auto-js-app/source/auto-js/index.html.erb +1 -0
- data/fixtures/auto-js-app/source/auto-js/sub/auto-js.html.erb +1 -0
- data/fixtures/auto-js-app/source/javascripts/auto-js.js +1 -0
- data/fixtures/auto-js-app/source/javascripts/auto-js/auto-js.js +1 -0
- data/fixtures/auto-js-app/source/javascripts/auto-js/index.js +1 -0
- data/fixtures/auto-js-app/source/javascripts/auto-js/sub/auto-js.js +1 -0
- data/fixtures/automatic-image-size-app/config.rb +0 -0
- data/fixtures/automatic-image-size-app/source/auto-image-sizes.html.erb +1 -0
- data/fixtures/automatic-image-size-app/source/images/blank.gif +0 -0
- data/fixtures/basic-data-app/config.rb +4 -0
- data/fixtures/basic-data-app/data/test.yml +4 -0
- data/fixtures/basic-data-app/data/test2.json +4 -0
- data/fixtures/basic-data-app/source/data.html.erb +1 -0
- data/fixtures/basic-data-app/source/data3.html.erb +1 -0
- data/fixtures/build-with-errors-app/config.rb +1 -0
- data/fixtures/build-with-errors-app/source/index.html.erb +1 -0
- data/fixtures/chained-app/config.rb +0 -0
- data/fixtures/chained-app/data/article.yml +2 -0
- data/fixtures/chained-app/source/index.html.str.erb +8 -0
- data/fixtures/clean-app/config-complications.rb +11 -0
- data/fixtures/clean-app/config-empty.rb +0 -0
- data/fixtures/clean-app/config.rb +11 -0
- data/fixtures/clean-app/source/index.html.erb +1 -0
- data/fixtures/clean-app/source/layout.erb +9 -0
- data/fixtures/clean-app/source/layouts/custom.erb +8 -0
- data/fixtures/clean-app/source/real.html +1 -0
- data/fixtures/clean-app/source/real/index.html.erb +5 -0
- data/fixtures/clean-app/source/should_be_ignored.html +1 -0
- data/fixtures/clean-app/source/should_be_ignored2.html +1 -0
- data/fixtures/clean-app/source/should_be_ignored3.html +1 -0
- data/fixtures/clean-app/source/static.html +1 -0
- data/fixtures/clean-dir-app/config.rb +1 -0
- data/fixtures/clean-dir-app/source/about.html +1 -0
- data/fixtures/content-for-app/config.rb +3 -0
- data/fixtures/content-for-app/source/content_for_erb.html.erb +5 -0
- data/fixtures/content-for-app/source/layouts/content_for.erb +4 -0
- data/fixtures/current-page-app/config.rb +3 -0
- data/fixtures/current-page-app/source/request-path.html.erb +1 -0
- 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.str +9 -0
- data/fixtures/custom-layout-app2/config.rb +0 -0
- data/fixtures/custom-layout-app2/source/custom-layout-dir/index.html.erb +1 -0
- data/fixtures/custom-layout-app2/source/custom-layout.html.erb +1 -0
- data/fixtures/custom-layout-app2/source/layouts/custom.erb +8 -0
- data/fixtures/data-app/config.rb +3 -0
- data/fixtures/data-app/data/pages.yml +6 -0
- data/fixtures/data-app/source/index.html.erb +1 -0
- data/fixtures/data-app/source/layout.erb +5 -0
- data/fixtures/different-engine-layout/config.rb +0 -0
- data/fixtures/different-engine-layout/source/index.html.str +1 -0
- data/fixtures/different-engine-layout/source/layout.erb +9 -0
- data/fixtures/different-engine-partial/config.rb +0 -0
- data/fixtures/different-engine-partial/source/index.html.erb +1 -0
- data/fixtures/different-engine-partial/source/layouts/layout.erb +7 -0
- data/fixtures/different-engine-partial/source/shared/_footer.str +1 -0
- data/fixtures/different-engine-partial/source/shared/_header.erb +1 -0
- data/fixtures/dynamic-pages-app/config.rb +29 -0
- data/fixtures/dynamic-pages-app/source/real.html +1 -0
- data/fixtures/dynamic-pages-app/source/real/index.html.erb +5 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored2.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored3.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored4.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored5.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored6.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored7.html +1 -0
- data/fixtures/dynamic-pages-app/source/should_be_ignored8.html +1 -0
- data/fixtures/empty-app/not-config.rb +0 -0
- data/fixtures/engine-matching-layout/config.rb +0 -0
- data/fixtures/engine-matching-layout/source/index.html.erb +1 -0
- data/fixtures/engine-matching-layout/source/layout.erb +9 -0
- data/fixtures/external-helpers/config.rb +4 -0
- data/fixtures/external-helpers/lib/hello_helper.rb +5 -0
- data/fixtures/external-helpers/source/index.html.erb +1 -0
- data/fixtures/feature-params-app/config.rb +12 -0
- data/fixtures/feature-params-app/source/index.html.erb +3 -0
- data/fixtures/frontmatter-app/config.rb +0 -0
- data/fixtures/frontmatter-app/source/front-matter-2.php.erb +7 -0
- data/fixtures/frontmatter-app/source/front-matter-change.html.erb +5 -0
- data/fixtures/frontmatter-app/source/front-matter.html.erb +6 -0
- data/fixtures/generator-test/config.rb +80 -0
- data/fixtures/generator-test/source/index.html.erb +10 -0
- data/fixtures/glob-app/config.rb +1 -0
- data/fixtures/glob-app/source/index.html.erb +4 -0
- data/fixtures/glob-app/source/stylesheets/site.css.str +3 -0
- data/fixtures/ignore-app/config.rb +2 -0
- data/fixtures/ignore-app/source/articles/template.html.erb +1 -0
- data/fixtures/ignore-app/source/template.html.erb +1 -0
- data/fixtures/indexable-app/config.rb +2 -0
- data/fixtures/indexable-app/source/.htaccess +1 -0
- data/fixtures/indexable-app/source/a_folder/needs_index.html +1 -0
- data/fixtures/indexable-app/source/leave_me_alone.html +1 -0
- data/fixtures/indexable-app/source/needs_index.html +1 -0
- data/fixtures/indexable-app/source/regular/index.html +1 -0
- data/fixtures/instance-vars-app/config.rb +0 -0
- data/fixtures/instance-vars-app/source/_vartial.erb +5 -0
- data/fixtures/instance-vars-app/source/instance-var-set.html.erb +2 -0
- data/fixtures/instance-vars-app/source/layout.erb +3 -0
- data/fixtures/instance-vars-app/source/no-instance-var.html.erb +1 -0
- data/fixtures/large-build-app/config.rb +3 -0
- data/fixtures/large-build-app/source/.htaccess +1 -0
- data/fixtures/large-build-app/source/_partial.erb +1 -0
- data/fixtures/large-build-app/source/images/Child folder/regular_file(example).txt +1 -0
- data/fixtures/large-build-app/source/images/Read me (example).txt +1 -0
- data/fixtures/large-build-app/source/images/blank.gif +0 -0
- data/fixtures/large-build-app/source/index.html.erb +1 -0
- data/fixtures/large-build-app/source/layout.erb +9 -0
- data/fixtures/large-build-app/source/layouts/content_for.erb +4 -0
- data/fixtures/large-build-app/source/layouts/custom.erb +8 -0
- data/fixtures/large-build-app/source/other_layout.erb +1 -0
- data/fixtures/large-build-app/source/services/index.html.erb +1 -0
- data/fixtures/large-build-app/source/spaces in file.html.erb +1 -0
- data/fixtures/large-build-app/source/static.html +1 -0
- data/fixtures/large-build-app/source/stylesheets/static.css +2 -0
- data/fixtures/lorem-app/config.rb +0 -0
- data/fixtures/lorem-app/source/lorem.html.erb +13 -0
- data/fixtures/manual-layout-missing/config.rb +1 -0
- data/fixtures/manual-layout-missing/source/index.html.erb +1 -0
- data/fixtures/manual-layout-override/config.rb +3 -0
- data/fixtures/manual-layout-override/source/index.html.erb +1 -0
- data/fixtures/manual-layout-override/source/layouts/another.erb +9 -0
- data/fixtures/manual-layout-override/source/layouts/custom.erb +9 -0
- data/fixtures/manual-layout/config.rb +1 -0
- data/fixtures/manual-layout/source/index.html.erb +1 -0
- data/fixtures/manual-layout/source/layouts/custom.erb +9 -0
- data/fixtures/multiple-layouts/config.rb +0 -0
- data/fixtures/multiple-layouts/source/index.html.erb +1 -0
- data/fixtures/multiple-layouts/source/layout.erb +9 -0
- data/fixtures/multiple-layouts/source/layout.str +9 -0
- data/fixtures/nested-layout-app/config.rb +1 -0
- data/fixtures/nested-layout-app/source/data-one.html.erb +5 -0
- data/fixtures/nested-layout-app/source/data-two.html.erb +5 -0
- data/fixtures/nested-layout-app/source/index.html.erb +1 -0
- data/fixtures/nested-layout-app/source/layouts/inner.erb +4 -0
- data/fixtures/nested-layout-app/source/layouts/master.erb +3 -0
- data/fixtures/nested-layout-app/source/layouts/outer.erb +4 -0
- data/fixtures/no-layout/config.rb +0 -0
- data/fixtures/no-layout/source/index.html.erb +1 -0
- data/fixtures/padrino-helpers-app/config.rb +0 -0
- data/fixtures/padrino-helpers-app/source/former_padrino_test.html.erb +4 -0
- data/fixtures/page-classes-app/config.rb +4 -0
- data/fixtures/page-classes-app/source/page-classes.html.erb +1 -0
- data/fixtures/page-classes-app/source/sub1/page-classes.html.erb +1 -0
- data/fixtures/page-classes-app/source/sub1/sub2/page-classes.html.erb +1 -0
- data/fixtures/partials-app/config.rb +0 -0
- data/fixtures/partials-app/source/_locals.erb +1 -0
- data/fixtures/partials-app/source/_main.erb +1 -0
- data/fixtures/partials-app/source/_main.str +1 -0
- data/fixtures/partials-app/source/index.html.erb +3 -0
- data/fixtures/partials-app/source/locals.html.erb +1 -0
- data/fixtures/partials-app/source/second.html.str +3 -0
- data/fixtures/partials-app/source/shared/_footer.erb +1 -0
- data/fixtures/partials-app/source/shared/_header.erb +1 -0
- data/fixtures/partials-app/source/sub/_local.erb +1 -0
- data/fixtures/partials-app/source/sub/index.html.erb +3 -0
- data/fixtures/plain-app/index.html +1 -0
- data/fixtures/preview-app/config.rb +0 -0
- data/fixtures/preview-app/source/content.html.erb +1 -0
- data/fixtures/preview-app/source/layout.erb +1 -0
- data/fixtures/sinatra-app/config.rb +11 -0
- data/fixtures/sinatra-app/source/index.html.erb +5 -0
- data/fixtures/traversal-app/config.rb +7 -0
- data/fixtures/traversal-app/source/directory-indexed.html.erb +0 -0
- data/fixtures/traversal-app/source/directory-indexed/sibling.html.erb +3 -0
- data/fixtures/traversal-app/source/directory-indexed/sibling2.html.erb +3 -0
- data/fixtures/traversal-app/source/directory-indexed/sub2/index.html.erb +0 -0
- data/fixtures/traversal-app/source/directory-indexed/sub3/deep.html.erb +0 -0
- data/fixtures/traversal-app/source/index.html.erb +0 -0
- data/fixtures/traversal-app/source/layout.erb +19 -0
- data/fixtures/traversal-app/source/proxied.html.erb +0 -0
- data/fixtures/traversal-app/source/root.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/index.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sibling.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sibling2.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sub2/index.html.erb +0 -0
- data/fixtures/traversal-app/source/sub/sub3/deep.html.erb +0 -0
- data/fixtures/wildcard-app/config.rb +1 -0
- data/fixtures/wildcard-app/source/admin/index.html.erb +1 -0
- data/fixtures/wildcard-app/source/admin/page.html.erb +1 -0
- data/fixtures/wildcard-app/source/index.html.erb +1 -0
- data/fixtures/wildcard-app/source/layouts/admin.erb +2 -0
- data/fixtures/wildcard-app/source/layouts/layout.erb +2 -0
- data/fixtures/wildcard-directory-index-app/config.rb +2 -0
- data/fixtures/wildcard-directory-index-app/source/admin/index.html.erb +1 -0
- data/fixtures/wildcard-directory-index-app/source/admin/page.html.erb +1 -0
- data/fixtures/wildcard-directory-index-app/source/index.html.erb +1 -0
- data/fixtures/wildcard-directory-index-app/source/layouts/admin.erb +2 -0
- data/fixtures/wildcard-directory-index-app/source/layouts/layout.erb +2 -0
- data/lib/middleman-core.rb +259 -0
- data/lib/middleman-core/base.rb +494 -0
- data/lib/middleman-core/cache.rb +57 -0
- data/lib/middleman-core/cli.rb +57 -0
- data/lib/middleman-core/cli/build.rb +229 -0
- data/lib/middleman-core/cli/init.rb +52 -0
- data/lib/middleman-core/cli/server.rb +52 -0
- data/lib/middleman-core/core_extensions/assets.rb +30 -0
- data/lib/middleman-core/core_extensions/builder.rb +49 -0
- data/lib/middleman-core/core_extensions/data.rb +193 -0
- data/lib/middleman-core/core_extensions/default_helpers.rb +119 -0
- data/lib/middleman-core/core_extensions/extensions.rb +148 -0
- data/lib/middleman-core/core_extensions/file_watcher.rb +83 -0
- data/lib/middleman-core/core_extensions/front_matter.rb +145 -0
- data/lib/middleman-core/core_extensions/rendering.rb +247 -0
- data/lib/middleman-core/core_extensions/routing.rb +69 -0
- data/lib/middleman-core/core_extensions/show_exceptions.rb +16 -0
- data/lib/middleman-core/core_extensions/sitemap.rb +72 -0
- data/lib/middleman-core/extensions/asset_host.rb +29 -0
- data/lib/middleman-core/extensions/automatic_image_sizes.rb +38 -0
- data/lib/middleman-core/extensions/automatic_image_sizes/fastimage.rb +287 -0
- data/lib/middleman-core/extensions/directory_indexes.rb +62 -0
- data/lib/middleman-core/extensions/lorem.rb +140 -0
- data/lib/middleman-core/guard.rb +148 -0
- data/lib/middleman-core/renderers/erb.rb +19 -0
- data/lib/middleman-core/sitemap/page.rb +186 -0
- data/lib/middleman-core/sitemap/store.rb +139 -0
- data/lib/middleman-core/sitemap/template.rb +82 -0
- data/lib/middleman-core/step_definitions.rb +12 -0
- data/lib/middleman-core/step_definitions/builder_steps.rb +42 -0
- data/lib/middleman-core/step_definitions/middleman_steps.rb +15 -0
- data/lib/middleman-core/step_definitions/server_steps.rb +73 -0
- data/lib/middleman-core/templates.rb +82 -0
- data/lib/middleman-core/templates/default.rb +29 -0
- data/lib/middleman-core/templates/default/source/images/background.png +0 -0
- data/lib/middleman-core/templates/default/source/images/middleman.png +0 -0
- data/lib/middleman-core/templates/default/source/index.html.erb +10 -0
- data/lib/middleman-core/templates/default/source/javascripts/all.js +1 -0
- data/lib/middleman-core/templates/default/source/layouts/layout.erb +19 -0
- data/lib/middleman-core/templates/default/source/stylesheets/_animate.scss +23 -0
- data/lib/middleman-core/templates/default/source/stylesheets/_normalize.scss +431 -0
- data/lib/middleman-core/templates/default/source/stylesheets/all.css.scss +40 -0
- data/lib/middleman-core/templates/html5.rb +25 -0
- data/lib/middleman-core/templates/html5/source/404.html +38 -0
- data/lib/middleman-core/templates/html5/source/README.md +388 -0
- data/lib/middleman-core/templates/html5/source/apple-touch-icon-114x114-precomposed.png +0 -0
- data/lib/middleman-core/templates/html5/source/apple-touch-icon-57x57-precomposed.png +0 -0
- data/lib/middleman-core/templates/html5/source/apple-touch-icon-72x72-precomposed.png +0 -0
- data/lib/middleman-core/templates/html5/source/apple-touch-icon-precomposed.png +0 -0
- data/lib/middleman-core/templates/html5/source/apple-touch-icon.png +0 -0
- data/lib/middleman-core/templates/html5/source/crossdomain.xml +25 -0
- data/lib/middleman-core/templates/html5/source/css/style.css +293 -0
- data/lib/middleman-core/templates/html5/source/favicon.ico +0 -0
- data/lib/middleman-core/templates/html5/source/humans.txt +43 -0
- data/lib/middleman-core/templates/html5/source/img/.gitignore +2 -0
- data/lib/middleman-core/templates/html5/source/index.html +79 -0
- data/lib/middleman-core/templates/html5/source/js/libs/jquery-1.6.2.js +8981 -0
- data/lib/middleman-core/templates/html5/source/js/libs/jquery-1.6.2.min.js +18 -0
- data/lib/middleman-core/templates/html5/source/js/libs/modernizr-2.0.6.min.js +4 -0
- data/lib/middleman-core/templates/html5/source/js/mylibs/.gitignore +2 -0
- data/lib/middleman-core/templates/html5/source/js/plugins.js +20 -0
- data/lib/middleman-core/templates/html5/source/js/script.js +8 -0
- data/lib/middleman-core/templates/html5/source/robots.txt +5 -0
- data/lib/middleman-core/templates/html5/source/test/index.html +31 -0
- data/lib/middleman-core/templates/html5/source/test/qunit/qunit.css +148 -0
- data/lib/middleman-core/templates/html5/source/test/qunit/qunit.js +1265 -0
- data/lib/middleman-core/templates/html5/source/test/tests.js +24 -0
- data/lib/middleman-core/templates/local.rb +21 -0
- data/lib/middleman-core/templates/mobile.rb +25 -0
- data/lib/middleman-core/templates/mobile/source/404.html +37 -0
- data/lib/middleman-core/templates/mobile/source/README.markdown +21 -0
- data/lib/middleman-core/templates/mobile/source/crossdomain.xml +25 -0
- data/lib/middleman-core/templates/mobile/source/css/style.css +315 -0
- data/lib/middleman-core/templates/mobile/source/humans.txt +43 -0
- data/lib/middleman-core/templates/mobile/source/img/h/apple-touch-icon.png +0 -0
- data/lib/middleman-core/templates/mobile/source/img/h/splash.png +0 -0
- data/lib/middleman-core/templates/mobile/source/img/l/apple-touch-icon-precomposed.png +0 -0
- data/lib/middleman-core/templates/mobile/source/img/l/apple-touch-icon.png +0 -0
- data/lib/middleman-core/templates/mobile/source/img/l/splash.png +0 -0
- data/lib/middleman-core/templates/mobile/source/img/m/apple-touch-icon.png +0 -0
- data/lib/middleman-core/templates/mobile/source/index.html +92 -0
- data/lib/middleman-core/templates/mobile/source/js/libs/modernizr-custom.js +14 -0
- data/lib/middleman-core/templates/mobile/source/js/libs/respond.min.js +7 -0
- data/lib/middleman-core/templates/mobile/source/js/mylibs/helper.js +171 -0
- data/lib/middleman-core/templates/mobile/source/js/plugins.js +20 -0
- data/lib/middleman-core/templates/mobile/source/js/script.js +0 -0
- data/lib/middleman-core/templates/mobile/source/robots.txt +4 -0
- data/lib/middleman-core/templates/mobile/source/sitemap.xml +9 -0
- data/lib/middleman-core/templates/mobile/source/test/index.html +31 -0
- data/lib/middleman-core/templates/mobile/source/test/qunit/qunit.css +148 -0
- data/lib/middleman-core/templates/mobile/source/test/qunit/qunit.js +1265 -0
- data/lib/middleman-core/templates/mobile/source/test/tests.js +21 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/Readme.PDF +0 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/aspx/aspx1.snippet +31 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/aspx/aspx2.snippet +2 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/aspx/ga.aspx +195 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/aspx/sample.aspx +44 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/ga.jsp +225 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet +35 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp2.snippet +2 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/sample.jsp +51 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/php/ga.php +176 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/php/php1.snippet +30 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/php/php2.snippet +4 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/php/sample.php +44 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/pl/ga.pl +195 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/pl/perl1.snippet +27 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/pl/perl2.snippet +1 -0
- data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/pl/sample.pl +38 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/COPYING +202 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/bookmark_bubble.js +559 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/example/example.html +43 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/example/example.js +57 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/images/arrow.png +0 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/images/close.png +0 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/images/generate_base64_images +33 -0
- data/lib/middleman-core/templates/mobile/source/tools/mobile-bookmark-bubble/images/icon_calendar.png +0 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/README +27 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/databasefactory.js +45 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbworker.js +324 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbworker_test.html +393 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbworkerstarter.js +32 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapper_gears.js +595 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapper_gears_test.html +404 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapper_html5.js +203 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapper_html5_test.html +468 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapperapi.js +202 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/dbwrapperapi_test.html +51 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gears_resultset.js +71 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gears_resultset_test.html +86 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gears_transaction.js +196 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gears_transaction_test.html +221 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gearsutils.js +94 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/gearsutils_test.html +84 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/global_functions.js +72 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/simplenotes/index.html +347 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/simplenotes/simplenotes.js +503 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/simplenotes/styles.css +66 -0
- data/lib/middleman-core/templates/mobile/source/tools/wspl/simplenotes/template.js +75 -0
- data/lib/middleman-core/templates/shared/Gemfile.tt +3 -0
- data/lib/middleman-core/templates/shared/config.ru +4 -0
- data/lib/middleman-core/templates/shared/config.tt +92 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/CHANGES.textile +9 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/Gemfile +3 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/README.rdoc +107 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/Rakefile +12 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/hooks.gemspec +22 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/lib/hooks.rb +109 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/lib/hooks/inheritable_attribute.rb +33 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/test/hooks_test.rb +141 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/test/inheritable_attribute_test.rb +55 -0
- data/lib/middleman-core/vendor/hooks-0.2.0/test/test_helper.rb +10 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/.document +5 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/.gitignore +22 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/.yardopts +1 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/LICENSE.txt +20 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/README.rdoc +294 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/Rakefile +5 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/bin/padrino +9 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core.rb +167 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/application.rb +270 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/application/rendering.rb +292 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/application/routing.rb +934 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/application/showexceptions.rb +20 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/caller.rb +53 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/cli/adapter.rb +24 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/cli/base.rb +151 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/cli/console.rb +20 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake.rb +24 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/cli/rake_tasks.rb +59 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/command.rb +38 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/images/404.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/images/500.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/loader.rb +210 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/cs.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/da.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/de.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/en.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/es.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/fr.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/hu.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/it.yml +40 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ja.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/lv.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/nl.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/no.yml +35 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pl.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/pt_br.yml +40 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/ru.yml +35 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/tr.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/uk.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_cn.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/locale/zh_tw.yml +34 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/logger.rb +345 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/mounter.rb +224 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/reloader.rb +254 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/router.rb +98 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/server.rb +79 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/support_lite.rb +200 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/tasks.rb +21 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/lib/padrino-core/version.rb +20 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/padrino-core.gemspec +38 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/apps/.components +6 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/apps/.gitignore +7 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/apps/complex.rb +32 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/apps/simple.rb +33 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/a.rb +9 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/b.rb +4 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/c.rb +1 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/e.rb +13 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/f.rb +2 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/circular/g.rb +2 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/fixtures/dependencies/d.rb +4 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/helper.rb +81 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/mini_shoulda.rb +45 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_application.rb +108 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_core.rb +79 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_dependencies.rb +44 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_filters.rb +278 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_locale.rb +21 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_logger.rb +100 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_mounter.rb +177 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_reloader_complex.rb +75 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_reloader_simple.rb +98 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_rendering.rb +461 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_restful_routing.rb +33 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_router.rb +146 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.5/test/test_routing.rb +1673 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/.document +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/.gitignore +21 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/.yardopts +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/LICENSE.txt +20 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/README.rdoc +239 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/Rakefile +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers.rb +58 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/asset_tag_helpers.rb +420 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/abstract_form_builder.rb +220 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_builder/standard_form_builder.rb +43 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/form_helpers.rb +602 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/format_helpers.rb +381 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/cs.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/da.yml +91 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/de.yml +81 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/en.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/es.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/fr.yml +80 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/hu.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/it.yml +89 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ja.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/lv.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/nl.yml +82 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/no.yml +91 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pl.yml +95 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/pt_br.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/ru.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/tr.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/uk.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_cn.yml +104 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/locale/zh_tw.yml +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/number_helpers.rb +288 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers.rb +175 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/abstract_handler.rb +98 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/erb_handler.rb +79 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/haml_handler.rb +63 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/output_helpers/slim_handler.rb +81 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/render_helpers.rb +60 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/tag_helpers.rb +103 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/lib/padrino-helpers/translation_helpers.rb +38 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/padrino-helpers.gemspec +27 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/app.rb +73 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.erb +14 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.haml +12 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/capture_concat.slim +13 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.erb +14 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.haml +12 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_for.slim +12 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.erb +11 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.haml +9 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/content_tag.slim +9 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.erb +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.haml +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/current_engine.slim +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.erb +20 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.haml +15 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/fields_for.slim +15 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.erb +56 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.haml +47 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_for.slim +47 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.erb +56 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.haml +45 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/form_tag.slim +45 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.erb +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.haml +4 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/link_to.slim +4 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.erb +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.haml +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/mail_to.slim +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.erb +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.haml +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/meta_tag.slim +3 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_erb.erb +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_haml.haml +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/partials/_slim.slim +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.erb +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.haml +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/markup_app/views/simple_partial.slim +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/app.rb +50 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engine.haml +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_erb.erb +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_haml.haml +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/current_engines/_slim.slim +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/erb/test.erb +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/explicit_engine.haml +5 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/haml/test.haml +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/_user.haml +7 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/haml_template.haml +1 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/fixtures/render_app/views/template/some_template.haml +2 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/helper.rb +66 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_asset_tag_helpers.rb +320 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_form_builder.rb +996 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_form_helpers.rb +645 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_format_helpers.rb +227 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_locale.rb +20 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_number_helpers.rb +136 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_output_helpers.rb +153 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_render_helpers.rb +76 -0
- data/lib/middleman-core/vendor/padrino-helpers-0.10.5/test/test_tag_helpers.rb +105 -0
- data/lib/middleman-core/version.rb +13 -0
- data/middleman-core.gemspec +41 -0
- metadata +974 -0
@@ -0,0 +1,44 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "Dependencies" do
|
4
|
+
context 'when we require a dependency that have another dependency' do
|
5
|
+
|
6
|
+
should 'raise an error without reloading it twice' do
|
7
|
+
capture_io do
|
8
|
+
assert_raises(RuntimeError) do
|
9
|
+
Padrino.require_dependencies(
|
10
|
+
Padrino.root("fixtures/dependencies/a.rb"),
|
11
|
+
Padrino.root("fixtures/dependencies/b.rb"),
|
12
|
+
Padrino.root("fixtures/dependencies/c.rb"),
|
13
|
+
Padrino.root("fixtures/dependencies/d.rb")
|
14
|
+
)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
assert_equal 1, D
|
18
|
+
end
|
19
|
+
|
20
|
+
should 'resolve dependency problems' do
|
21
|
+
capture_io do
|
22
|
+
Padrino.require_dependencies(
|
23
|
+
Padrino.root("fixtures/dependencies/a.rb"),
|
24
|
+
Padrino.root("fixtures/dependencies/b.rb"),
|
25
|
+
Padrino.root("fixtures/dependencies/c.rb")
|
26
|
+
)
|
27
|
+
end
|
28
|
+
assert_equal ["B", "C"], A_result
|
29
|
+
assert_equal "C", B_result
|
30
|
+
end
|
31
|
+
|
32
|
+
should 'remove partially loaded constants' do
|
33
|
+
capture_io do
|
34
|
+
Padrino.require_dependencies(
|
35
|
+
Padrino.root("fixtures/dependencies/circular/e.rb"),
|
36
|
+
Padrino.root("fixtures/dependencies/circular/f.rb"),
|
37
|
+
Padrino.root("fixtures/dependencies/circular/g.rb")
|
38
|
+
)
|
39
|
+
end
|
40
|
+
|
41
|
+
assert_equal ["name"], F.fields
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,278 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "Filters" do
|
4
|
+
should "filters by accept header" do
|
5
|
+
mock_app do
|
6
|
+
get '/foo', :provides => [:xml, :js] do
|
7
|
+
request.env['HTTP_ACCEPT']
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'application/xml' }
|
12
|
+
assert ok?
|
13
|
+
assert_equal 'application/xml', body
|
14
|
+
assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
|
15
|
+
|
16
|
+
get '/foo.xml'
|
17
|
+
assert ok?
|
18
|
+
assert_equal 'application/xml;charset=utf-8', response.headers['Content-Type']
|
19
|
+
|
20
|
+
get '/foo', {}, { 'HTTP_ACCEPT' => 'application/javascript' }
|
21
|
+
assert ok?
|
22
|
+
assert_equal 'application/javascript', body
|
23
|
+
assert_equal 'application/javascript;charset=utf-8', response.headers['Content-Type']
|
24
|
+
|
25
|
+
get '/foo.js'
|
26
|
+
assert ok?
|
27
|
+
assert_equal 'application/javascript;charset=utf-8', response.headers['Content-Type']
|
28
|
+
|
29
|
+
get '/foo', {}, { "HTTP_ACCEPT" => 'text/html' }
|
30
|
+
assert_equal 406, status
|
31
|
+
end
|
32
|
+
|
33
|
+
should "allow passing & halting in before filters" do
|
34
|
+
mock_app do
|
35
|
+
controller do
|
36
|
+
before { env['QUERY_STRING'] == 'secret' or pass }
|
37
|
+
get :index do
|
38
|
+
"secret index"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
controller do
|
43
|
+
before { env['QUERY_STRING'] == 'halt' and halt 401, 'go away!' }
|
44
|
+
get :index do
|
45
|
+
"index"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
get "/?secret"
|
51
|
+
assert_equal "secret index", body
|
52
|
+
|
53
|
+
get "/?halt"
|
54
|
+
assert_equal "go away!", body
|
55
|
+
assert_equal 401, status
|
56
|
+
|
57
|
+
get "/"
|
58
|
+
assert_equal "index", body
|
59
|
+
end
|
60
|
+
|
61
|
+
should 'scope filters in the given controller' do
|
62
|
+
mock_app do
|
63
|
+
before { @global = 'global' }
|
64
|
+
after { @global = nil }
|
65
|
+
|
66
|
+
controller :foo do
|
67
|
+
before { @foo = :foo }
|
68
|
+
after { @foo = nil }
|
69
|
+
get("/") { [@foo, @bar, @global].compact.join(" ") }
|
70
|
+
end
|
71
|
+
|
72
|
+
get("/") { [@foo, @bar, @global].compact.join(" ") }
|
73
|
+
|
74
|
+
controller :bar do
|
75
|
+
before { @bar = :bar }
|
76
|
+
after { @bar = nil }
|
77
|
+
get("/") { [@foo, @bar, @global].compact.join(" ") }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
get "/bar"
|
82
|
+
assert_equal "bar global", body
|
83
|
+
|
84
|
+
get "/foo"
|
85
|
+
assert_equal "foo global", body
|
86
|
+
|
87
|
+
get "/"
|
88
|
+
assert_equal "global", body
|
89
|
+
end
|
90
|
+
|
91
|
+
should 'be able to access params in a before filter' do
|
92
|
+
username_from_before_filter = nil
|
93
|
+
|
94
|
+
mock_app do
|
95
|
+
before do
|
96
|
+
username_from_before_filter = params[:username]
|
97
|
+
end
|
98
|
+
|
99
|
+
get :users, :with => :username do
|
100
|
+
end
|
101
|
+
end
|
102
|
+
get '/users/josh'
|
103
|
+
assert_equal 'josh', username_from_before_filter
|
104
|
+
end
|
105
|
+
|
106
|
+
should "be able to access params normally when a before filter is specified" do
|
107
|
+
mock_app do
|
108
|
+
before { }
|
109
|
+
get :index do
|
110
|
+
params.inspect
|
111
|
+
end
|
112
|
+
end
|
113
|
+
get '/?test=what'
|
114
|
+
assert_equal '{"test"=>"what"}', body
|
115
|
+
end
|
116
|
+
|
117
|
+
should "be able to filter based on a path" do
|
118
|
+
mock_app do
|
119
|
+
before('/') { @test = "#{@test}before"}
|
120
|
+
get :index do
|
121
|
+
@test
|
122
|
+
end
|
123
|
+
get :main do
|
124
|
+
@test
|
125
|
+
end
|
126
|
+
end
|
127
|
+
get '/'
|
128
|
+
assert_equal 'before', body
|
129
|
+
get '/main'
|
130
|
+
assert_equal '', body
|
131
|
+
end
|
132
|
+
|
133
|
+
should "be able to filter based on a symbol" do
|
134
|
+
mock_app do
|
135
|
+
before(:index) { @test = 'before'}
|
136
|
+
get :index do
|
137
|
+
@test
|
138
|
+
end
|
139
|
+
get :main do
|
140
|
+
@test
|
141
|
+
end
|
142
|
+
end
|
143
|
+
get '/'
|
144
|
+
assert_equal 'before', body
|
145
|
+
get '/main'
|
146
|
+
assert_equal '', body
|
147
|
+
end
|
148
|
+
|
149
|
+
should "be able to filter based on a symbol for a controller" do
|
150
|
+
mock_app do
|
151
|
+
controller :foo do
|
152
|
+
before(:test) { @test = 'foo'}
|
153
|
+
get :test do
|
154
|
+
@test.to_s + " response"
|
155
|
+
end
|
156
|
+
end
|
157
|
+
controller :bar do
|
158
|
+
before(:test) { @test = 'bar'}
|
159
|
+
get :test do
|
160
|
+
@test.to_s + " response"
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
get '/foo/test'
|
165
|
+
assert_equal 'foo response', body
|
166
|
+
get '/bar/test'
|
167
|
+
assert_equal 'bar response', body
|
168
|
+
end
|
169
|
+
|
170
|
+
should "be able to filter based on a symbol or path" do
|
171
|
+
mock_app do
|
172
|
+
before(:index, '/main') { @test = 'before'}
|
173
|
+
get :index do
|
174
|
+
@test
|
175
|
+
end
|
176
|
+
get :main do
|
177
|
+
@test
|
178
|
+
end
|
179
|
+
end
|
180
|
+
get '/'
|
181
|
+
assert_equal 'before', body
|
182
|
+
get '/main'
|
183
|
+
assert_equal 'before', body
|
184
|
+
end
|
185
|
+
|
186
|
+
should "be able to filter based on a symbol or regexp" do
|
187
|
+
mock_app do
|
188
|
+
before(:index, /main/) { @test = 'before'}
|
189
|
+
get :index do
|
190
|
+
@test
|
191
|
+
end
|
192
|
+
get :main do
|
193
|
+
@test
|
194
|
+
end
|
195
|
+
get :profile do
|
196
|
+
@test
|
197
|
+
end
|
198
|
+
end
|
199
|
+
get '/'
|
200
|
+
assert_equal 'before', body
|
201
|
+
get '/main'
|
202
|
+
assert_equal 'before', body
|
203
|
+
get '/profile'
|
204
|
+
assert_equal '', body
|
205
|
+
end
|
206
|
+
|
207
|
+
should "be able to filter excluding based on a symbol" do
|
208
|
+
mock_app do
|
209
|
+
before(:except => :index) { @test = 'before'}
|
210
|
+
get :index do
|
211
|
+
@test
|
212
|
+
end
|
213
|
+
get :main do
|
214
|
+
@test
|
215
|
+
end
|
216
|
+
end
|
217
|
+
get '/'
|
218
|
+
assert_equal '', body
|
219
|
+
get '/main'
|
220
|
+
assert_equal 'before', body
|
221
|
+
end
|
222
|
+
|
223
|
+
should "be able to filter based on a request param" do
|
224
|
+
mock_app do
|
225
|
+
before(:agent => /IE/) { @test = 'before'}
|
226
|
+
get :index do
|
227
|
+
@test
|
228
|
+
end
|
229
|
+
end
|
230
|
+
get '/'
|
231
|
+
assert_equal '', body
|
232
|
+
get "/", {}, {'HTTP_USER_AGENT' => 'This is IE'}
|
233
|
+
assert_equal 'before', body
|
234
|
+
end
|
235
|
+
|
236
|
+
should "be able to filter based on a symbol or path in multiple controller" do
|
237
|
+
mock_app do
|
238
|
+
controllers :foo do
|
239
|
+
before(:index, '/foo/main') { @test = 'before' }
|
240
|
+
get :index do
|
241
|
+
@test
|
242
|
+
end
|
243
|
+
get :main do
|
244
|
+
@test
|
245
|
+
end
|
246
|
+
end
|
247
|
+
controllers :bar do
|
248
|
+
before(:index, '/bar/main') { @test = 'also before' }
|
249
|
+
get :index do
|
250
|
+
@test
|
251
|
+
end
|
252
|
+
get :main do
|
253
|
+
@test
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
257
|
+
get '/foo'
|
258
|
+
assert_equal 'before', body
|
259
|
+
get '/bar'
|
260
|
+
assert_equal 'also before', body
|
261
|
+
get '/foo/main'
|
262
|
+
assert_equal 'before', body
|
263
|
+
get '/bar/main'
|
264
|
+
assert_equal 'also before', body
|
265
|
+
end
|
266
|
+
|
267
|
+
should "call before filters even if there was no match" do
|
268
|
+
test = nil
|
269
|
+
mock_app do
|
270
|
+
before(:index, '/foo') { test = 'before' }
|
271
|
+
get :index do
|
272
|
+
''
|
273
|
+
end
|
274
|
+
end
|
275
|
+
get '/foo'
|
276
|
+
assert_equal 'before', test
|
277
|
+
end
|
278
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "Locales" do
|
4
|
+
Dir[File.expand_path("../../lib/padrino-core/locale/*.yml", __FILE__)].each do |file|
|
5
|
+
base_original = YAML.load_file(file)
|
6
|
+
name = File.basename(file, '.yml')
|
7
|
+
should "should have correct locale for #{name}" do
|
8
|
+
base = base_original[name]['date']['formats']
|
9
|
+
assert base['default'].present?
|
10
|
+
assert base['short'].present?
|
11
|
+
assert base['long'].present?
|
12
|
+
assert base['only_day'].present?
|
13
|
+
base = base_original[name]['date']
|
14
|
+
assert base['day_names'].present?
|
15
|
+
assert base['abbr_day_names'].present?
|
16
|
+
assert base['month_names'].present?
|
17
|
+
assert base['abbr_month_names'].present?
|
18
|
+
assert base['order'].present?
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "PadrinoLogger" do
|
4
|
+
|
5
|
+
def setup
|
6
|
+
Padrino::Logger::Config[:test][:stream] = :null # The default
|
7
|
+
Padrino::Logger.setup!
|
8
|
+
end
|
9
|
+
|
10
|
+
def setup_logger(options={})
|
11
|
+
@log = StringIO.new
|
12
|
+
@logger = Padrino::Logger.new(options.merge(:stream => @log))
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'for logger functionality' do
|
16
|
+
|
17
|
+
context 'check stream config' do
|
18
|
+
|
19
|
+
should 'use stdout if stream is nil' do
|
20
|
+
Padrino::Logger::Config[:test][:stream] = nil
|
21
|
+
Padrino::Logger.setup!
|
22
|
+
assert_equal $stdout, Padrino.logger.log
|
23
|
+
end
|
24
|
+
|
25
|
+
should 'use StringIO as default for test' do
|
26
|
+
assert_instance_of StringIO, Padrino.logger.log
|
27
|
+
end
|
28
|
+
|
29
|
+
should 'use a custom stream' do
|
30
|
+
my_stream = StringIO.new
|
31
|
+
Padrino::Logger::Config[:test][:stream] = my_stream
|
32
|
+
Padrino::Logger.setup!
|
33
|
+
assert_equal my_stream, Padrino.logger.log
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
should 'log something' do
|
38
|
+
setup_logger(:log_level => :error)
|
39
|
+
@logger.error "You log this error?"
|
40
|
+
assert_match(/You log this error?/, @log.string)
|
41
|
+
@logger.debug "You don't log this error!"
|
42
|
+
assert_no_match(/You don't log this error!/, @log.string)
|
43
|
+
@logger << "Yep this can be logged"
|
44
|
+
assert_match(/Yep this can be logged/, @log.string)
|
45
|
+
end
|
46
|
+
|
47
|
+
should 'respond to #write for Rack::CommonLogger' do
|
48
|
+
setup_logger(:log_level => :error)
|
49
|
+
@logger.error "Error message"
|
50
|
+
assert_match /Error message/, @log.string
|
51
|
+
@logger << "logged anyways"
|
52
|
+
assert_match /logged anyways/, @log.string
|
53
|
+
@logger.write "log via alias"
|
54
|
+
assert_match /log via alias/, @log.string
|
55
|
+
end
|
56
|
+
|
57
|
+
should 'log an application' do
|
58
|
+
mock_app do
|
59
|
+
enable :logging
|
60
|
+
get("/"){ "Foo" }
|
61
|
+
end
|
62
|
+
get "/"
|
63
|
+
assert_equal "Foo", body
|
64
|
+
assert_match /GET/, Padrino.logger.log.string
|
65
|
+
end
|
66
|
+
|
67
|
+
should 'log an application\'s status code' do
|
68
|
+
mock_app do
|
69
|
+
enable :logging
|
70
|
+
get("/"){ "Foo" }
|
71
|
+
end
|
72
|
+
get "/"
|
73
|
+
assert_match /\e\[1m200\e\[0m OK/, Padrino.logger.log.string
|
74
|
+
end
|
75
|
+
|
76
|
+
context "static asset logging" do
|
77
|
+
should 'not log static assets by default' do
|
78
|
+
mock_app do
|
79
|
+
enable :logging
|
80
|
+
get("/images/something.png"){ env["sinatra.static_file"] = '/public/images/something.png'; "Foo" }
|
81
|
+
end
|
82
|
+
get "/images/something.png"
|
83
|
+
assert_equal "Foo", body
|
84
|
+
assert_match "", Padrino.logger.log.string
|
85
|
+
end
|
86
|
+
|
87
|
+
should 'allow turning on static assets logging' do
|
88
|
+
Padrino.logger.instance_eval{ @log_static = true }
|
89
|
+
mock_app do
|
90
|
+
enable :logging
|
91
|
+
get("/images/something.png"){ env["sinatra.static_file"] = '/public/images/something.png'; "Foo" }
|
92
|
+
end
|
93
|
+
get "/images/something.png"
|
94
|
+
assert_equal "Foo", body
|
95
|
+
assert_match /GET/, Padrino.logger.log.string
|
96
|
+
Padrino.logger.instance_eval{ @log_static = false }
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,177 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
2
|
+
|
3
|
+
describe "Mounter" do
|
4
|
+
class ::TestApp < Padrino::Application; end
|
5
|
+
|
6
|
+
def setup
|
7
|
+
$VERBOSE, @_verbose_was = nil, $VERBOSE
|
8
|
+
Padrino.clear!
|
9
|
+
end
|
10
|
+
|
11
|
+
def teardown
|
12
|
+
$VERBOSE = @_verbose_was
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'for mounter functionality' do
|
16
|
+
should 'check methods' do
|
17
|
+
mounter = Padrino::Mounter.new("test_app", :app_file => "/path/to/test.rb")
|
18
|
+
mounter.to("/test_app")
|
19
|
+
assert_kind_of Padrino::Mounter, mounter
|
20
|
+
assert_respond_to Padrino::Mounter, :new
|
21
|
+
assert_respond_to mounter, :to
|
22
|
+
assert_respond_to mounter, :map_onto
|
23
|
+
assert_equal "test_app", mounter.name
|
24
|
+
assert_equal "TestApp", mounter.app_class
|
25
|
+
assert_equal "/path/to/test.rb", mounter.app_file
|
26
|
+
assert_equal "/test_app", mounter.uri_root
|
27
|
+
assert_equal File.dirname(mounter.app_file), mounter.app_root
|
28
|
+
end
|
29
|
+
|
30
|
+
should 'check locate_app_file with __FILE__' do
|
31
|
+
mounter = Padrino::Mounter.new("test_app", :app_file => __FILE__)
|
32
|
+
mounter.to("/test_app")
|
33
|
+
assert_equal "test_app", mounter.name
|
34
|
+
assert_equal "TestApp", mounter.app_class
|
35
|
+
assert_equal __FILE__, mounter.app_file
|
36
|
+
assert_equal "/test_app", mounter.uri_root
|
37
|
+
assert_equal File.dirname(mounter.app_file), mounter.app_root
|
38
|
+
end
|
39
|
+
|
40
|
+
should 'mount an app' do
|
41
|
+
class ::AnApp < Padrino::Application; end
|
42
|
+
Padrino.mount("an_app").to("/")
|
43
|
+
assert_equal AnApp, Padrino.mounted_apps.first.app_obj
|
44
|
+
assert_equal ["an_app"], Padrino.mounted_apps.map(&:name)
|
45
|
+
end
|
46
|
+
|
47
|
+
should 'correctly mount an app in a namespace' do
|
48
|
+
module ::SomeNamespace
|
49
|
+
class AnApp < Padrino::Application; end
|
50
|
+
end
|
51
|
+
Padrino.mount("some_namespace/an_app").to("/")
|
52
|
+
assert_equal SomeNamespace::AnApp, Padrino.mounted_apps.first.app_obj
|
53
|
+
assert_equal ["some_namespace/an_app"], Padrino.mounted_apps.map(&:name)
|
54
|
+
end
|
55
|
+
|
56
|
+
should 'mount a primary app to root uri' do
|
57
|
+
mounter = Padrino.mount("test_app", :app_file => __FILE__).to("/")
|
58
|
+
assert_equal "test_app", mounter.name
|
59
|
+
assert_equal "TestApp", mounter.app_class
|
60
|
+
assert_equal TestApp, mounter.app_obj
|
61
|
+
assert_equal __FILE__, mounter.app_file
|
62
|
+
assert_equal "/", mounter.uri_root
|
63
|
+
assert_equal File.dirname(mounter.app_file), mounter.app_root
|
64
|
+
end
|
65
|
+
|
66
|
+
should 'mount a primary app to sub_uri' do
|
67
|
+
mounter = Padrino.mount("test_app", :app_file => __FILE__).to('/me')
|
68
|
+
assert_equal "test_app", mounter.name
|
69
|
+
assert_equal "TestApp", mounter.app_class
|
70
|
+
assert_equal TestApp, mounter.app_obj
|
71
|
+
assert_equal __FILE__, mounter.app_file
|
72
|
+
assert_equal "/me", mounter.uri_root
|
73
|
+
assert_equal File.dirname(mounter.app_file), mounter.app_root
|
74
|
+
end
|
75
|
+
|
76
|
+
should "raise error when app has no located file" do
|
77
|
+
# TODO enabling this screws minitest
|
78
|
+
# assert_raises(Padrino::Mounter::MounterException) { Padrino.mount("tester_app").to('/test') }
|
79
|
+
assert_equal 0, Padrino.mounted_apps.size
|
80
|
+
end
|
81
|
+
|
82
|
+
should "raise error when app has no located object" do
|
83
|
+
assert_raises(Padrino::Mounter::MounterException) { Padrino.mount("tester_app", :app_file => "/path/to/file.rb").to('/test') }
|
84
|
+
assert_equal 0, Padrino.mounted_apps.size
|
85
|
+
end
|
86
|
+
|
87
|
+
should 'mount multiple apps' do
|
88
|
+
class ::OneApp < Padrino::Application; end
|
89
|
+
class ::TwoApp < Padrino::Application; end
|
90
|
+
|
91
|
+
Padrino.mount("one_app").to("/one_app")
|
92
|
+
Padrino.mount("two_app").to("/two_app")
|
93
|
+
# And testing no duplicates
|
94
|
+
Padrino.mount("one_app").to("/one_app")
|
95
|
+
Padrino.mount("two_app").to("/two_app")
|
96
|
+
|
97
|
+
assert_equal OneApp, Padrino.mounted_apps[0].app_obj
|
98
|
+
assert_equal TwoApp, Padrino.mounted_apps[1].app_obj
|
99
|
+
assert_equal 2, Padrino.mounted_apps.size, "should not mount duplicate apps"
|
100
|
+
assert_equal ["one_app", "two_app"], Padrino.mounted_apps.map(&:name)
|
101
|
+
end
|
102
|
+
|
103
|
+
should 'change mounted_root' do
|
104
|
+
Padrino.mounted_root = "fixtures"
|
105
|
+
assert_equal Padrino.root("fixtures", "test", "app.rb"), Padrino.mounted_root("test", "app.rb")
|
106
|
+
Padrino.mounted_root = "apps"
|
107
|
+
assert_equal Padrino.root("apps", "test", "app.rb"), Padrino.mounted_root("test", "app.rb")
|
108
|
+
Padrino.mounted_root = nil
|
109
|
+
assert_equal Padrino.root("test", "app.rb"), Padrino.mounted_root("test", "app.rb")
|
110
|
+
end
|
111
|
+
|
112
|
+
should "be able to access routes data for mounted apps" do
|
113
|
+
class ::OneApp < Padrino::Application
|
114
|
+
get("/test") { "test" }
|
115
|
+
get(:index, :provides => [:js, :json]) { "index" }
|
116
|
+
controllers :posts do
|
117
|
+
get(:index) { "index" }
|
118
|
+
get(:new, :provides => :js) { "new" }
|
119
|
+
get(:show, :provides => [:js, :html], :with => :id) { "show" }
|
120
|
+
post(:create, :provides => :js, :with => :id) { "create" }
|
121
|
+
end
|
122
|
+
end
|
123
|
+
class ::TwoApp < Padrino::Application
|
124
|
+
controllers :users do
|
125
|
+
get(:index) { "users" }
|
126
|
+
get(:new) { "users new" }
|
127
|
+
post(:create) { "users create" }
|
128
|
+
put(:update) { "users update" }
|
129
|
+
delete(:destroy) { "users delete" }
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
Padrino.mount("one_app").to("/")
|
134
|
+
Padrino.mount("two_app").to("/two_app")
|
135
|
+
|
136
|
+
assert_equal 11, Padrino.mounted_apps[0].routes.size
|
137
|
+
assert_equal 7, Padrino.mounted_apps[1].routes.size
|
138
|
+
assert_equal 5, Padrino.mounted_apps[0].named_routes.size
|
139
|
+
assert_equal 5, Padrino.mounted_apps[1].named_routes.size
|
140
|
+
|
141
|
+
first_route = Padrino.mounted_apps[0].named_routes[3]
|
142
|
+
assert_equal "posts_show", first_route.identifier.to_s
|
143
|
+
assert_equal "(:posts, :show)", first_route.name
|
144
|
+
assert_equal "GET", first_route.verb
|
145
|
+
assert_equal "/posts/show/:id(.:format)", first_route.path
|
146
|
+
another_route = Padrino.mounted_apps[1].named_routes[2]
|
147
|
+
assert_equal "users_create", another_route.identifier.to_s
|
148
|
+
assert_equal "(:users, :create)", another_route.name
|
149
|
+
assert_equal "POST", another_route.verb
|
150
|
+
assert_equal "/two_app/users/create", another_route.path
|
151
|
+
end
|
152
|
+
|
153
|
+
should 'correctly instantiate a new padrino application' do
|
154
|
+
mock_app do
|
155
|
+
get("/demo_1"){ "Im Demo 1" }
|
156
|
+
get("/demo_2"){ "Im Demo 2" }
|
157
|
+
end
|
158
|
+
|
159
|
+
get '/demo_1'
|
160
|
+
assert_equal "Im Demo 1", response.body
|
161
|
+
get '/demo_2'
|
162
|
+
assert_equal "Im Demo 2", response.body
|
163
|
+
end
|
164
|
+
|
165
|
+
should "not clobber the public setting when mounting an app" do
|
166
|
+
class ::PublicApp < Padrino::Application
|
167
|
+
set :root, "/root"
|
168
|
+
set :public_folder, File.expand_path(File.dirname(__FILE__))
|
169
|
+
end
|
170
|
+
|
171
|
+
Padrino.mount("public_app").to("/public")
|
172
|
+
res = Rack::MockRequest.new(Padrino.application).get("/public/test_mounter.rb")
|
173
|
+
assert res.ok?
|
174
|
+
assert_equal File.read(__FILE__), res.body
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|