middleman-core 3.0.0.alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,227 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/fixtures/markup_app/app')
|
|
3
|
+
|
|
4
|
+
describe "FormatHelpers" do
|
|
5
|
+
def app
|
|
6
|
+
MarkupDemo.tap { |app| app.set :environment, :test }
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def setup
|
|
10
|
+
Time.stubs(:now).returns(Time.utc(1983, 11, 9, 5))
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
include Padrino::Helpers::FormatHelpers
|
|
14
|
+
|
|
15
|
+
context 'for #simple_format method' do
|
|
16
|
+
should "format simple text into html format" do
|
|
17
|
+
actual_text = simple_format("Here is some basic text...\n...with a line break.")
|
|
18
|
+
assert_equal "<p>Here is some basic text...\n<br />...with a line break.</p>", actual_text
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
should "format more text into html format" do
|
|
22
|
+
actual_text = simple_format("We want to put a paragraph...\n\n...right there.")
|
|
23
|
+
assert_equal "<p>We want to put a paragraph...</p>\n\n<p>...right there.</p>", actual_text
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
should "support defining a class for the paragraphs" do
|
|
27
|
+
actual_text = simple_format("Look me! A class!", :class => 'description')
|
|
28
|
+
assert_equal "<p class=\"description\">Look me! A class!</p>", actual_text
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
context 'wrapped in a custom tag' do
|
|
32
|
+
should "format simple text into html format" do
|
|
33
|
+
actual_text = simple_format("Here is some basic text...\n...with a line break.", :tag => :div)
|
|
34
|
+
assert_equal "<div>Here is some basic text...\n<br />...with a line break.</div>", actual_text
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
should "format more text into html format" do
|
|
38
|
+
actual_text = simple_format("We want to put a paragraph...\n\n...right there.", :tag => :div)
|
|
39
|
+
assert_equal "<div>We want to put a paragraph...</div>\n\n<div>...right there.</div>", actual_text
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
should "support defining a class for the paragraphs" do
|
|
43
|
+
actual_text = simple_format("Look me! A class!", :class => 'description', :tag => :div)
|
|
44
|
+
assert_equal "<div class=\"description\">Look me! A class!</div>", actual_text
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
context 'for #pluralize method' do
|
|
50
|
+
should "return singular count for 1 item collections" do
|
|
51
|
+
actual_text = pluralize(1, 'person')
|
|
52
|
+
assert_equal '1 person', actual_text
|
|
53
|
+
end
|
|
54
|
+
should "return plural count for empty collections" do
|
|
55
|
+
actual_text = pluralize(0, 'person')
|
|
56
|
+
assert_equal '0 people', actual_text
|
|
57
|
+
end
|
|
58
|
+
should "return plural count for many collections" do
|
|
59
|
+
actual_text = pluralize(2, 'person')
|
|
60
|
+
assert_equal '2 people', actual_text
|
|
61
|
+
end
|
|
62
|
+
should "return pluralized word specified as argument" do
|
|
63
|
+
actual_text = pluralize(3, 'person', 'users')
|
|
64
|
+
assert_equal '3 users', actual_text
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
context 'for #word_wrap method' do
|
|
69
|
+
should "return proper formatting for 8 max width" do
|
|
70
|
+
actual_text = word_wrap('Once upon a time', :line_width => 8)
|
|
71
|
+
assert_equal "Once\nupon a\ntime", actual_text
|
|
72
|
+
end
|
|
73
|
+
should "return proper formatting for 1 max width" do
|
|
74
|
+
actual_text = word_wrap('Once upon a time', :line_width => 1)
|
|
75
|
+
assert_equal "Once\nupon\na\ntime", actual_text
|
|
76
|
+
end
|
|
77
|
+
should "return proper formatting for default width" do
|
|
78
|
+
actual_text = word_wrap((1..50).to_a.join(" "))
|
|
79
|
+
assert_equal (1..30).to_a.join(" ") + "\n" + (31..50).to_a.join(" "), actual_text
|
|
80
|
+
actual_text = word_wrap((1..50).to_a.join(" "), 80)
|
|
81
|
+
assert_equal (1..30).to_a.join(" ") + "\n" + (31..50).to_a.join(" "), actual_text
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
context 'for #highlight method' do
|
|
86
|
+
should 'highligth with defaults' do
|
|
87
|
+
actual_text = highlight('Lorem ipsum dolor sit amet', 'dolor')
|
|
88
|
+
assert_equal 'Lorem ipsum <strong class="highlight">dolor</strong> sit amet', actual_text
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
should 'highlight with highlighter' do
|
|
92
|
+
actual_text = highlight('Lorem ipsum dolor sit amet', 'dolor', :highlighter => '<span class="custom">\1</span>')
|
|
93
|
+
assert_equal 'Lorem ipsum <span class="custom">dolor</span> sit amet', actual_text
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
context 'for #truncate method' do
|
|
98
|
+
should "support default truncation" do
|
|
99
|
+
actual_text = truncate("Once upon a time in a world far far away")
|
|
100
|
+
assert_equal "Once upon a time in a world...", actual_text
|
|
101
|
+
end
|
|
102
|
+
should "support specifying length" do
|
|
103
|
+
actual_text = truncate("Once upon a time in a world far far away", :length => 14)
|
|
104
|
+
assert_equal "Once upon a...", actual_text
|
|
105
|
+
end
|
|
106
|
+
should "support specifying omission text" do
|
|
107
|
+
actual_text = truncate("And they found that many people were sleeping better.", :length => 25, :omission => "(clipped)")
|
|
108
|
+
assert_equal "And they found t(clipped)", actual_text
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
context 'for #truncate_words method' do
|
|
113
|
+
should "support default truncation" do
|
|
114
|
+
actual_text = truncate_words("Long before books were made, people told stories. They told them to one another and to the children as they sat before the fire. Many of these stories were about interesting people, but most of them were about the ways of fairies and giants.")
|
|
115
|
+
assert_equal "Long before books were made, people told stories. They told them to one another and to the children as they sat before the fire. Many of these stories were about...", actual_text
|
|
116
|
+
end
|
|
117
|
+
should "support specifying length" do
|
|
118
|
+
actual_text = truncate_words("Once upon a time in a world far far away", :length => 8)
|
|
119
|
+
assert_equal "Once upon a time in a world far...", actual_text
|
|
120
|
+
end
|
|
121
|
+
should "support specifying omission text" do
|
|
122
|
+
actual_text = truncate_words("And they found that many people were sleeping better.", :length => 4, :omission => "(clipped)")
|
|
123
|
+
assert_equal "And they found that(clipped)", actual_text
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
context 'for #h and #h! method' do
|
|
128
|
+
should "escape the simple html" do
|
|
129
|
+
assert_equal '<h1>hello</h1>', h('<h1>hello</h1>')
|
|
130
|
+
assert_equal '<h1>hello</h1>', escape_html('<h1>hello</h1>')
|
|
131
|
+
end
|
|
132
|
+
should "escape all brackets, quotes and ampersands" do
|
|
133
|
+
assert_equal '<h1><>"&demo&"<></h1>', h('<h1><>"&demo&"<></h1>')
|
|
134
|
+
end
|
|
135
|
+
should "return default text if text is empty" do
|
|
136
|
+
assert_equal 'default', h!("", "default")
|
|
137
|
+
assert_equal ' ', h!("")
|
|
138
|
+
end
|
|
139
|
+
should "return text escaped if not empty" do
|
|
140
|
+
assert_equal '<h1>hello</h1>', h!('<h1>hello</h1>')
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
context 'for #time_ago_in_words method' do
|
|
145
|
+
should "less than 5 seconds" do
|
|
146
|
+
assert_equal 'less than 5 seconds', time_ago_in_words(Time.now, true)
|
|
147
|
+
end
|
|
148
|
+
should "less than 10 seconds" do
|
|
149
|
+
assert_equal 'less than 10 seconds', time_ago_in_words(Time.now-5, true)
|
|
150
|
+
end
|
|
151
|
+
should "less than 20 seconds" do
|
|
152
|
+
assert_equal 'less than 20 seconds', time_ago_in_words(Time.now-10, true)
|
|
153
|
+
end
|
|
154
|
+
should "less than a minute" do
|
|
155
|
+
assert_equal 'less than a minute', time_ago_in_words(Time.now-40, true)
|
|
156
|
+
end
|
|
157
|
+
should "2 minutes" do
|
|
158
|
+
assert_equal '2 minutes', time_ago_in_words(Time.now-120, true)
|
|
159
|
+
end
|
|
160
|
+
should "display today" do
|
|
161
|
+
assert_equal 'less than a minute', time_ago_in_words(Time.now)
|
|
162
|
+
end
|
|
163
|
+
should "display yesterday" do
|
|
164
|
+
assert_equal '1 day', time_ago_in_words(1.day.ago)
|
|
165
|
+
end
|
|
166
|
+
should "display tomorrow" do
|
|
167
|
+
assert_equal '1 day', time_ago_in_words(1.day.from_now)
|
|
168
|
+
end
|
|
169
|
+
should "return future number of days" do
|
|
170
|
+
assert_equal '4 days', time_ago_in_words(4.days.from_now)
|
|
171
|
+
end
|
|
172
|
+
should "return past days ago" do
|
|
173
|
+
assert_equal '4 days', time_ago_in_words(4.days.ago)
|
|
174
|
+
end
|
|
175
|
+
should "return formatted archived date" do
|
|
176
|
+
assert_equal '3 months', time_ago_in_words(100.days.ago)
|
|
177
|
+
end
|
|
178
|
+
should "return formatted archived year date" do
|
|
179
|
+
assert_equal 'over 1 year', time_ago_in_words(500.days.ago)
|
|
180
|
+
end
|
|
181
|
+
should 'display now as a minute ago' do
|
|
182
|
+
assert_equal '1 minute', time_ago_in_words(1.minute.ago)
|
|
183
|
+
end
|
|
184
|
+
should "display a few minutes ago" do
|
|
185
|
+
assert_equal '4 minutes', time_ago_in_words(4.minute.ago)
|
|
186
|
+
end
|
|
187
|
+
should "display an hour ago" do
|
|
188
|
+
assert_equal 'about 1 hour', time_ago_in_words(1.hour.ago + 5.minutes.ago.sec)
|
|
189
|
+
end
|
|
190
|
+
should "display a few hours ago" do
|
|
191
|
+
assert_equal 'about 3 hours', time_ago_in_words(3.hour.ago + 5.minutes.ago.sec)
|
|
192
|
+
end
|
|
193
|
+
should "display a day ago" do
|
|
194
|
+
assert_equal '1 day', time_ago_in_words(1.day.ago)
|
|
195
|
+
end
|
|
196
|
+
should "display a few days ago" do
|
|
197
|
+
assert_equal '5 days', time_ago_in_words(5.days.ago - 5.minutes.ago.sec)
|
|
198
|
+
end
|
|
199
|
+
should "display a month ago" do
|
|
200
|
+
assert_equal 'about 1 month', time_ago_in_words(32.days.ago + 5.minutes.ago.sec)
|
|
201
|
+
end
|
|
202
|
+
should "display a few months ago" do
|
|
203
|
+
assert_equal '6 months', time_ago_in_words(180.days.ago - 5.minutes.ago.sec)
|
|
204
|
+
end
|
|
205
|
+
should "display a year ago" do
|
|
206
|
+
assert_equal 'about 1 year', time_ago_in_words(365.days.ago - 5.minutes.ago.sec)
|
|
207
|
+
end
|
|
208
|
+
should "display a few years ago" do
|
|
209
|
+
assert_equal 'over 7 years', time_ago_in_words(2800.days.ago - 5.minutes.ago.sec)
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
context 'for #js_escape_html method' do
|
|
214
|
+
should "escape double quotes" do
|
|
215
|
+
assert_equal "\\\"hello\\\"", js_escape_html('"hello"')
|
|
216
|
+
end
|
|
217
|
+
should "escape single quotes" do
|
|
218
|
+
assert_equal "\\'hello\\'", js_escape_html("'hello'")
|
|
219
|
+
end
|
|
220
|
+
should "escape html tags and breaks" do
|
|
221
|
+
assert_equal "\\n\\n<p>hello<\\/p>\\n", js_escape_html("\n\r<p>hello</p>\r\n")
|
|
222
|
+
end
|
|
223
|
+
should "escape data-confirm attribute" do
|
|
224
|
+
assert_equal "<data-confirm=\\\"are you sure\\\">", js_escape_html("<data-confirm=\"are you sure\">")
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
|
2
|
+
|
|
3
|
+
describe "Locale Helpers" do
|
|
4
|
+
Dir[File.expand_path("../../lib/padrino-helpers/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]['number']['format']
|
|
9
|
+
assert !base['separator'].nil?
|
|
10
|
+
assert !base['delimiter'].nil?
|
|
11
|
+
assert !base['precision'].nil?
|
|
12
|
+
base = base_original[name]['number']['currency']['format']
|
|
13
|
+
assert !base['format'].nil?
|
|
14
|
+
assert !base['unit'].nil?
|
|
15
|
+
assert !base['separator'].nil?
|
|
16
|
+
assert !base['delimiter'].nil?
|
|
17
|
+
assert !base['precision'].nil?
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
describe "NumberHelpers" do
|
|
2
|
+
include Padrino::Helpers::NumberHelpers
|
|
3
|
+
|
|
4
|
+
def kilobytes(number)
|
|
5
|
+
number * 1024
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def megabytes(number)
|
|
9
|
+
kilobytes(number) * 1024
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def gigabytes(number)
|
|
13
|
+
megabytes(number) * 1024
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def terabytes(number)
|
|
17
|
+
gigabytes(number) * 1024
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
context 'for number helpers functionality' do
|
|
21
|
+
|
|
22
|
+
should 'display number_to_currency' do
|
|
23
|
+
assert_equal "$1,234,567,890.50", number_to_currency(1234567890.50)
|
|
24
|
+
assert_equal "$1,234,567,890.51", number_to_currency(1234567890.506)
|
|
25
|
+
assert_equal "$1,234,567,892", number_to_currency(1234567891.50, {:precision => 0})
|
|
26
|
+
assert_equal "$1,234,567,890.5", number_to_currency(1234567890.50, {:precision => 1})
|
|
27
|
+
assert_equal "£1234567890,50", number_to_currency(1234567890.50, {:unit => "£", :separator => ",", :delimiter => ""})
|
|
28
|
+
assert_equal "$1,234,567,890.50", number_to_currency("1234567890.50")
|
|
29
|
+
assert_equal "1,234,567,890.50 Kč", number_to_currency("1234567890.50", {:unit => "Kč", :format => "%n %u"})
|
|
30
|
+
assert_equal "$x", number_to_currency("x")
|
|
31
|
+
|
|
32
|
+
assert_nil number_to_currency(nil)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
should 'display number_to_percentage' do
|
|
36
|
+
assert_equal "100.000%", number_to_percentage(100)
|
|
37
|
+
assert_equal "100%", number_to_percentage(100, {:precision => 0})
|
|
38
|
+
assert_equal "302.06%", number_to_percentage(302.0574, {:precision => 2})
|
|
39
|
+
assert_equal "100.000%", number_to_percentage("100")
|
|
40
|
+
assert_equal "1000.000%", number_to_percentage("1000")
|
|
41
|
+
assert_equal "x%", number_to_percentage("x")
|
|
42
|
+
assert_equal "1.000,000%", number_to_percentage(1000, :delimiter => '.', :separator => ',')
|
|
43
|
+
|
|
44
|
+
assert_nil number_to_percentage(nil)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
should 'display number_with_delimiter' do
|
|
48
|
+
assert_equal "12,345,678", number_with_delimiter(12345678)
|
|
49
|
+
assert_equal "0", number_with_delimiter(0)
|
|
50
|
+
assert_equal "123", number_with_delimiter(123)
|
|
51
|
+
assert_equal "123,456", number_with_delimiter(123456)
|
|
52
|
+
assert_equal "123,456.78", number_with_delimiter(123456.78)
|
|
53
|
+
assert_equal "123,456.789", number_with_delimiter(123456.789)
|
|
54
|
+
assert_equal "123,456.78901", number_with_delimiter(123456.78901)
|
|
55
|
+
assert_equal "123,456,789.78901", number_with_delimiter(123456789.78901)
|
|
56
|
+
assert_equal "0.78901", number_with_delimiter(0.78901)
|
|
57
|
+
assert_equal "123,456.78", number_with_delimiter("123456.78")
|
|
58
|
+
assert_equal "x", number_with_delimiter("x")
|
|
59
|
+
|
|
60
|
+
assert_nil number_with_delimiter(nil)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
should 'display number_with_delimiter with options' do
|
|
64
|
+
assert_equal '12 345 678', number_with_delimiter(12345678, :delimiter => ' ')
|
|
65
|
+
assert_equal '12,345,678-05', number_with_delimiter(12345678.05, :separator => '-')
|
|
66
|
+
assert_equal '12.345.678,05', number_with_delimiter(12345678.05, :separator => ',', :delimiter => '.')
|
|
67
|
+
assert_equal '12.345.678,05', number_with_delimiter(12345678.05, :delimiter => '.', :separator => ',')
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
should 'display number_with_precision' do
|
|
71
|
+
assert_equal "111.235", number_with_precision(111.2346)
|
|
72
|
+
assert_equal "31.83", number_with_precision(31.825, :precision => 2)
|
|
73
|
+
assert_equal "111.23", number_with_precision(111.2346, :precision => 2)
|
|
74
|
+
assert_equal "111.00", number_with_precision(111, :precision => 2)
|
|
75
|
+
assert_equal "111.235", number_with_precision("111.2346")
|
|
76
|
+
assert_equal "31.83", number_with_precision("31.825", :precision => 2)
|
|
77
|
+
assert_equal "3268", number_with_precision((32.6751 * 100.00), :precision => 0)
|
|
78
|
+
assert_equal "112", number_with_precision(111.50, :precision => 0)
|
|
79
|
+
assert_equal "1234567892", number_with_precision(1234567891.50, :precision => 0)
|
|
80
|
+
|
|
81
|
+
# Return non-numeric params unchanged.
|
|
82
|
+
assert_equal "x", number_with_precision("x")
|
|
83
|
+
assert_nil number_with_precision(nil)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
should 'display number_with_precision with custom delimiter and separator' do
|
|
87
|
+
assert_equal '31,83', number_with_precision(31.825, :precision => 2, :separator => ',')
|
|
88
|
+
assert_equal '1.231,83', number_with_precision(1231.825, :precision => 2, :separator => ',', :delimiter => '.')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
should 'display number_to_human_size' do
|
|
92
|
+
assert_equal '0 Bytes', number_to_human_size(0)
|
|
93
|
+
assert_equal '1 Byte', number_to_human_size(1)
|
|
94
|
+
assert_equal '3 Bytes', number_to_human_size(3.14159265)
|
|
95
|
+
assert_equal '123 Bytes', number_to_human_size(123.0)
|
|
96
|
+
assert_equal '123 Bytes', number_to_human_size(123)
|
|
97
|
+
assert_equal '1.2 KB', number_to_human_size(1234)
|
|
98
|
+
assert_equal '12.1 KB', number_to_human_size(12345)
|
|
99
|
+
assert_equal '1.2 MB', number_to_human_size(1234567)
|
|
100
|
+
assert_equal '1.1 GB', number_to_human_size(1234567890)
|
|
101
|
+
assert_equal '1.1 TB', number_to_human_size(1234567890123)
|
|
102
|
+
assert_equal '1025 TB', number_to_human_size(terabytes(1025))
|
|
103
|
+
assert_equal '444 KB', number_to_human_size(kilobytes(444))
|
|
104
|
+
assert_equal '1023 MB', number_to_human_size(megabytes(1023))
|
|
105
|
+
assert_equal '3 TB', number_to_human_size(terabytes(3))
|
|
106
|
+
assert_equal '1.18 MB', number_to_human_size(1234567, :precision => 2)
|
|
107
|
+
assert_equal '3 Bytes', number_to_human_size(3.14159265, :precision => 4)
|
|
108
|
+
assert_equal '123 Bytes', number_to_human_size("123")
|
|
109
|
+
assert_equal '1.01 KB', number_to_human_size(kilobytes(1.0123), :precision => 2)
|
|
110
|
+
assert_equal '1.01 KB', number_to_human_size(kilobytes(1.0100), :precision => 4)
|
|
111
|
+
assert_equal '10 KB', number_to_human_size(kilobytes(10.000), :precision => 4)
|
|
112
|
+
assert_equal '1 Byte', number_to_human_size(1.1)
|
|
113
|
+
assert_equal '10 Bytes', number_to_human_size(10)
|
|
114
|
+
|
|
115
|
+
assert_nil number_to_human_size(nil)
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
should 'display number_to_human_size with options' do
|
|
119
|
+
assert_equal '1.18 MB', number_to_human_size(1234567, :precision => 2)
|
|
120
|
+
assert_equal '3 Bytes', number_to_human_size(3.14159265, :precision => 4)
|
|
121
|
+
assert_equal '1.01 KB', number_to_human_size(kilobytes(1.0123), :precision => 2)
|
|
122
|
+
assert_equal '1.01 KB', number_to_human_size(kilobytes(1.0100), :precision => 4)
|
|
123
|
+
assert_equal '10 KB', number_to_human_size(kilobytes(10.000), :precision => 4)
|
|
124
|
+
assert_equal '1 TB', number_to_human_size(1234567890123, :precision => 0)
|
|
125
|
+
assert_equal '500 MB', number_to_human_size(524288000, :precision => 0)
|
|
126
|
+
assert_equal '40 KB', number_to_human_size(41010, :precision => 0)
|
|
127
|
+
assert_equal '40 KB', number_to_human_size(41100, :precision => 0)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
should 'display number_to_human_size with custom delimiter and separator' do
|
|
131
|
+
assert_equal '1,01 KB', number_to_human_size(kilobytes(1.0123), :precision => 2, :separator => ',')
|
|
132
|
+
assert_equal '1,01 KB', number_to_human_size(kilobytes(1.0100), :precision => 4, :separator => ',')
|
|
133
|
+
assert_equal '1.000,1 TB', number_to_human_size(terabytes(1000.1), :delimiter => '.', :separator => ',')
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
end
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/helper')
|
|
2
|
+
require File.expand_path(File.dirname(__FILE__) + '/fixtures/markup_app/app')
|
|
3
|
+
|
|
4
|
+
describe "OutputHelpers" do
|
|
5
|
+
def app
|
|
6
|
+
MarkupDemo.tap { |app| app.set :environment, :test }
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
context 'for #content_for method' do
|
|
10
|
+
should 'work for erb templates' do
|
|
11
|
+
visit '/erb/content_for'
|
|
12
|
+
assert_have_selector '.demo h1', :content => "This is content yielded from a content_for"
|
|
13
|
+
assert_have_selector '.demo2 h1', :content => "This is content yielded with name Johnny Smith"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
should "work for haml templates" do
|
|
17
|
+
visit '/haml/content_for'
|
|
18
|
+
assert_have_selector '.demo h1', :content => "This is content yielded from a content_for"
|
|
19
|
+
assert_have_selector '.demo2 h1', :content => "This is content yielded with name Johnny Smith"
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
should "work for slim templates" do
|
|
23
|
+
visit '/slim/content_for'
|
|
24
|
+
assert_have_selector '.demo h1', :content => "This is content yielded from a content_for"
|
|
25
|
+
assert_have_selector '.demo2 h1', :content => "This is content yielded with name Johnny Smith"
|
|
26
|
+
end
|
|
27
|
+
end # content_for
|
|
28
|
+
|
|
29
|
+
context "for #content_for? method" do
|
|
30
|
+
should 'work for erb templates' do
|
|
31
|
+
visit '/erb/content_for'
|
|
32
|
+
assert_have_selector '.demo_has_content', :content => "true"
|
|
33
|
+
assert_have_selector '.fake_has_content', :content => "false"
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
should "work for haml templates" do
|
|
37
|
+
visit '/haml/content_for'
|
|
38
|
+
assert_have_selector '.demo_has_content', :content => "true"
|
|
39
|
+
assert_have_selector '.fake_has_content', :content => "false"
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
should "work for slim templates" do
|
|
43
|
+
visit '/slim/content_for'
|
|
44
|
+
assert_have_selector '.demo_has_content', :content => "true"
|
|
45
|
+
assert_have_selector '.fake_has_content', :content => "false"
|
|
46
|
+
end
|
|
47
|
+
end # content_for?
|
|
48
|
+
|
|
49
|
+
context 'for #capture_html method' do
|
|
50
|
+
should "work for erb templates" do
|
|
51
|
+
visit '/erb/capture_concat'
|
|
52
|
+
assert_have_selector 'p span', :content => "Captured Line 1"
|
|
53
|
+
assert_have_selector 'p span', :content => "Captured Line 2"
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
should "work for haml templates" do
|
|
57
|
+
visit '/haml/capture_concat'
|
|
58
|
+
assert_have_selector 'p span', :content => "Captured Line 1"
|
|
59
|
+
assert_have_selector 'p span', :content => "Captured Line 2"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
should "work for slim templates" do
|
|
63
|
+
visit '/slim/capture_concat'
|
|
64
|
+
assert_have_selector 'p span', :content => "Captured Line 1"
|
|
65
|
+
assert_have_selector 'p span', :content => "Captured Line 2"
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
context 'for #concat_content method' do
|
|
70
|
+
should "work for erb templates" do
|
|
71
|
+
visit '/erb/capture_concat'
|
|
72
|
+
assert_have_selector 'p', :content => "Concat Line 3", :count => 1
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
should "work for haml templates" do
|
|
76
|
+
visit '/haml/capture_concat'
|
|
77
|
+
assert_have_selector 'p', :content => "Concat Line 3", :count => 1
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
should "work for slim templates" do
|
|
81
|
+
visit '/slim/capture_concat'
|
|
82
|
+
assert_have_selector 'p', :content => "Concat Line 3", :count => 1
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
context 'for #block_is_template?' do
|
|
87
|
+
should "work for erb templates" do
|
|
88
|
+
visit '/erb/capture_concat'
|
|
89
|
+
assert_have_selector 'p', :content => "The erb block passed in is a template", :class => 'is_template'
|
|
90
|
+
# TODO Get ERB template detection working (fix block_is_erb? method)
|
|
91
|
+
# assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
should "work for haml templates" do
|
|
95
|
+
visit '/haml/capture_concat'
|
|
96
|
+
assert_have_selector 'p', :content => "The haml block passed in is a template", :class => 'is_template'
|
|
97
|
+
assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
should_eventually "work for slim templates" do
|
|
101
|
+
visit '/slim/capture_concat'
|
|
102
|
+
assert_have_selector 'p', :content => "The slim block passed in is a template", :class => 'is_template'
|
|
103
|
+
# TODO Get SLIM template detection working (fix block_is_erb? method)
|
|
104
|
+
# assert_have_no_selector 'p', :content => "The ruby block passed in is a template", :class => 'is_template'
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
context 'for #current_engine method' do
|
|
109
|
+
should 'detect correctly current engine for erb' do
|
|
110
|
+
visit '/erb/current_engine'
|
|
111
|
+
assert_have_selector 'p.start', :content => "erb"
|
|
112
|
+
assert_have_selector 'p.haml', :content => "haml"
|
|
113
|
+
assert_have_selector 'p.erb', :content => "erb"
|
|
114
|
+
assert_have_selector 'p.slim', :content => "slim"
|
|
115
|
+
assert_have_selector 'p.end', :content => "erb"
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
should 'detect correctly current engine for haml' do
|
|
119
|
+
visit '/haml/current_engine'
|
|
120
|
+
assert_have_selector 'p.start', :content => "haml"
|
|
121
|
+
assert_have_selector 'p.haml', :content => "haml"
|
|
122
|
+
assert_have_selector 'p.erb', :content => "erb"
|
|
123
|
+
assert_have_selector 'p.slim', :content => "slim"
|
|
124
|
+
assert_have_selector 'p.end', :content => "haml"
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
should 'detect correctly current engine for slim' do
|
|
128
|
+
visit '/slim/current_engine'
|
|
129
|
+
assert_have_selector 'p.start', :content => "slim"
|
|
130
|
+
assert_have_selector 'p.haml', :content => "haml"
|
|
131
|
+
assert_have_selector 'p.erb', :content => "erb"
|
|
132
|
+
assert_have_selector 'p.slim', :content => "slim"
|
|
133
|
+
assert_have_selector 'p.end', :content => "slim"
|
|
134
|
+
end
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
context 'for #partial method in simple sinatra application' do
|
|
138
|
+
should 'properly output in erb' do
|
|
139
|
+
visit '/erb/simple_partial'
|
|
140
|
+
assert_have_selector 'p.erb', :content => "erb"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
should 'properly output in haml' do
|
|
144
|
+
visit '/haml/simple_partial'
|
|
145
|
+
assert_have_selector 'p.haml', :content => "haml"
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
should 'properly output in slim' do
|
|
149
|
+
visit '/slim/simple_partial'
|
|
150
|
+
assert_have_selector 'p.slim', :content => "slim"
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|