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
data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/jsp/jsp1.snippet
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<%@ page import="java.io.UnsupportedEncodingException,
|
|
2
|
+
java.net.URLEncoder" %>
|
|
3
|
+
<%!
|
|
4
|
+
// Copyright 2009 Google Inc. All Rights Reserved.
|
|
5
|
+
private static final String GA_ACCOUNT = "ACCOUNT ID GOES HERE";
|
|
6
|
+
private static final String GA_PIXEL = "ga.jsp";
|
|
7
|
+
|
|
8
|
+
private String googleAnalyticsGetImageUrl(
|
|
9
|
+
HttpServletRequest request) throws UnsupportedEncodingException {
|
|
10
|
+
StringBuilder url = new StringBuilder();
|
|
11
|
+
url.append(GA_PIXEL + "?");
|
|
12
|
+
url.append("utmac=").append(GA_ACCOUNT);
|
|
13
|
+
url.append("&utmn=").append(Integer.toString((int) (Math.random() * 0x7fffffff)));
|
|
14
|
+
|
|
15
|
+
String referer = request.getHeader("referer");
|
|
16
|
+
String query = request.getQueryString();
|
|
17
|
+
String path = request.getRequestURI();
|
|
18
|
+
|
|
19
|
+
if (referer == null || "".equals(referer)) {
|
|
20
|
+
referer = "-";
|
|
21
|
+
}
|
|
22
|
+
url.append("&utmr=").append(URLEncoder.encode(referer, "UTF-8"));
|
|
23
|
+
|
|
24
|
+
if (path != null) {
|
|
25
|
+
if (query != null) {
|
|
26
|
+
path += "?" + query;
|
|
27
|
+
}
|
|
28
|
+
url.append("&utmp=").append(URLEncoder.encode(path, "UTF-8"));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
url.append("&guid=ON");
|
|
32
|
+
|
|
33
|
+
return url.toString();
|
|
34
|
+
}
|
|
35
|
+
%>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
|
|
2
|
+
pageEncoding="ISO-8859-1"%>
|
|
3
|
+
<%@ page import="java.io.UnsupportedEncodingException,
|
|
4
|
+
java.net.URLEncoder" %>
|
|
5
|
+
<%!
|
|
6
|
+
private static final String GA_ACCOUNT = "MO-3845491-5";
|
|
7
|
+
private static final String GA_PIXEL = "ga.jsp";
|
|
8
|
+
|
|
9
|
+
private String googleAnalyticsGetImageUrl(
|
|
10
|
+
HttpServletRequest request) throws UnsupportedEncodingException {
|
|
11
|
+
StringBuilder url = new StringBuilder();
|
|
12
|
+
url.append(GA_PIXEL + "?");
|
|
13
|
+
url.append("utmac=").append(GA_ACCOUNT);
|
|
14
|
+
url.append("&utmn=").append(Integer.toString((int) (Math.random() * 0x7fffffff)));
|
|
15
|
+
|
|
16
|
+
String referer = request.getHeader("referer");
|
|
17
|
+
String query = request.getQueryString();
|
|
18
|
+
String path = request.getRequestURI();
|
|
19
|
+
|
|
20
|
+
if (referer == null || "".equals(referer)) {
|
|
21
|
+
referer = "-";
|
|
22
|
+
}
|
|
23
|
+
url.append("&utmr=").append(URLEncoder.encode(referer, "UTF-8"));
|
|
24
|
+
|
|
25
|
+
if (path != null) {
|
|
26
|
+
if (query != null) {
|
|
27
|
+
path += "?" + query;
|
|
28
|
+
}
|
|
29
|
+
url.append("&utmp=").append(URLEncoder.encode(path, "UTF-8"));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
url.append("&guid=ON");
|
|
33
|
+
|
|
34
|
+
return url.toString();
|
|
35
|
+
}
|
|
36
|
+
%>
|
|
37
|
+
<html>
|
|
38
|
+
<head>
|
|
39
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
40
|
+
<title>Sample Mobile Analytics Page</title>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
|
|
44
|
+
Publishers content here.
|
|
45
|
+
<%
|
|
46
|
+
String googleAnalyticsImageUrl = googleAnalyticsGetImageUrl(request);
|
|
47
|
+
%>
|
|
48
|
+
<img src="<%= googleAnalyticsImageUrl %>" />
|
|
49
|
+
Testing: <%= googleAnalyticsImageUrl %>
|
|
50
|
+
</body>
|
|
51
|
+
</html>
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
Copyright 2009 Google Inc. All Rights Reserved.
|
|
5
|
+
**/
|
|
6
|
+
|
|
7
|
+
// Tracker version.
|
|
8
|
+
define("VERSION", "4.4sh");
|
|
9
|
+
|
|
10
|
+
define("COOKIE_NAME", "__utmmobile");
|
|
11
|
+
|
|
12
|
+
// The path the cookie will be available to, edit this to use a different
|
|
13
|
+
// cookie path.
|
|
14
|
+
define("COOKIE_PATH", "/");
|
|
15
|
+
|
|
16
|
+
// Two years in seconds.
|
|
17
|
+
define("COOKIE_USER_PERSISTENCE", 63072000);
|
|
18
|
+
|
|
19
|
+
// 1x1 transparent GIF
|
|
20
|
+
$GIF_DATA = array(
|
|
21
|
+
chr(0x47), chr(0x49), chr(0x46), chr(0x38), chr(0x39), chr(0x61),
|
|
22
|
+
chr(0x01), chr(0x00), chr(0x01), chr(0x00), chr(0x80), chr(0xff),
|
|
23
|
+
chr(0x00), chr(0xff), chr(0xff), chr(0xff), chr(0x00), chr(0x00),
|
|
24
|
+
chr(0x00), chr(0x2c), chr(0x00), chr(0x00), chr(0x00), chr(0x00),
|
|
25
|
+
chr(0x01), chr(0x00), chr(0x01), chr(0x00), chr(0x00), chr(0x02),
|
|
26
|
+
chr(0x02), chr(0x44), chr(0x01), chr(0x00), chr(0x3b)
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// The last octect of the IP address is removed to anonymize the user.
|
|
30
|
+
function getIP($remoteAddress) {
|
|
31
|
+
if (empty($remoteAddress)) {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Capture the first three octects of the IP address and replace the forth
|
|
36
|
+
// with 0, e.g. 124.455.3.123 becomes 124.455.3.0
|
|
37
|
+
$regex = "/^([^.]+\.[^.]+\.[^.]+\.).*/";
|
|
38
|
+
if (preg_match($regex, $remoteAddress, $matches)) {
|
|
39
|
+
return $matches[1] . "0";
|
|
40
|
+
} else {
|
|
41
|
+
return "";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Generate a visitor id for this hit.
|
|
46
|
+
// If there is a visitor id in the cookie, use that, otherwise
|
|
47
|
+
// use the guid if we have one, otherwise use a random number.
|
|
48
|
+
function getVisitorId($guid, $account, $userAgent, $cookie) {
|
|
49
|
+
|
|
50
|
+
// If there is a value in the cookie, don't change it.
|
|
51
|
+
if (!empty($cookie)) {
|
|
52
|
+
return $cookie;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
$message = "";
|
|
56
|
+
if (!empty($guid)) {
|
|
57
|
+
// Create the visitor id using the guid.
|
|
58
|
+
$message = $guid . $account;
|
|
59
|
+
} else {
|
|
60
|
+
// otherwise this is a new user, create a new random id.
|
|
61
|
+
$message = $userAgent . uniqid(getRandomNumber(), true);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$md5String = md5($message);
|
|
65
|
+
|
|
66
|
+
return "0x" . substr($md5String, 0, 16);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Get a random number string.
|
|
70
|
+
function getRandomNumber() {
|
|
71
|
+
return rand(0, 0x7fffffff);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Writes the bytes of a 1x1 transparent gif into the response.
|
|
75
|
+
function writeGifData() {
|
|
76
|
+
global $GIF_DATA;
|
|
77
|
+
header("Content-Type: image/gif");
|
|
78
|
+
header("Cache-Control: " .
|
|
79
|
+
"private, no-cache, no-cache=Set-Cookie, proxy-revalidate");
|
|
80
|
+
header("Pragma: no-cache");
|
|
81
|
+
header("Expires: Wed, 17 Sep 1975 21:32:10 GMT");
|
|
82
|
+
echo join($GIF_DATA);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Make a tracking request to Google Analytics from this server.
|
|
86
|
+
// Copies the headers from the original request to the new one.
|
|
87
|
+
// If request containg utmdebug parameter, exceptions encountered
|
|
88
|
+
// communicating with Google Analytics are thown.
|
|
89
|
+
function sendRequestToGoogleAnalytics($utmUrl) {
|
|
90
|
+
$options = array(
|
|
91
|
+
"http" => array(
|
|
92
|
+
"method" => "GET",
|
|
93
|
+
"user_agent" => $_SERVER["HTTP_USER_AGENT"],
|
|
94
|
+
"header" => ("Accepts-Language: " . $_SERVER["HTTP_ACCEPT_LANGUAGE"]))
|
|
95
|
+
);
|
|
96
|
+
if (!empty($_GET["utmdebug"])) {
|
|
97
|
+
$data = file_get_contents(
|
|
98
|
+
$utmUrl, false, stream_context_create($options));
|
|
99
|
+
} else {
|
|
100
|
+
$data = @file_get_contents(
|
|
101
|
+
$utmUrl, false, stream_context_create($options));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Track a page view, updates all the cookies and campaign tracker,
|
|
106
|
+
// makes a server side request to Google Analytics and writes the transparent
|
|
107
|
+
// gif byte data to the response.
|
|
108
|
+
function trackPageView() {
|
|
109
|
+
$timeStamp = time();
|
|
110
|
+
$domainName = $_SERVER["SERVER_NAME"];
|
|
111
|
+
if (empty($domainName)) {
|
|
112
|
+
$domainName = "";
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Get the referrer from the utmr parameter, this is the referrer to the
|
|
116
|
+
// page that contains the tracking pixel, not the referrer for tracking
|
|
117
|
+
// pixel.
|
|
118
|
+
$documentReferer = $_GET["utmr"];
|
|
119
|
+
if (empty($documentReferer) && $documentReferer !== "0") {
|
|
120
|
+
$documentReferer = "-";
|
|
121
|
+
} else {
|
|
122
|
+
$documentReferer = urldecode($documentReferer);
|
|
123
|
+
}
|
|
124
|
+
$documentPath = $_GET["utmp"];
|
|
125
|
+
if (empty($documentPath)) {
|
|
126
|
+
$documentPath = "";
|
|
127
|
+
} else {
|
|
128
|
+
$documentPath = urldecode($documentPath);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
$account = $_GET["utmac"];
|
|
132
|
+
$userAgent = $_SERVER["HTTP_USER_AGENT"];
|
|
133
|
+
if (empty($userAgent)) {
|
|
134
|
+
$userAgent = "";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Try and get visitor cookie from the request.
|
|
138
|
+
$cookie = $_COOKIE[COOKIE_NAME];
|
|
139
|
+
|
|
140
|
+
$visitorId = getVisitorId(
|
|
141
|
+
$_SERVER["HTTP_X_DCMGUID"], $account, $userAgent, $cookie);
|
|
142
|
+
|
|
143
|
+
// Always try and add the cookie to the response.
|
|
144
|
+
setrawcookie(
|
|
145
|
+
COOKIE_NAME,
|
|
146
|
+
$visitorId,
|
|
147
|
+
$timeStamp + COOKIE_USER_PERSISTENCE,
|
|
148
|
+
COOKIE_PATH);
|
|
149
|
+
|
|
150
|
+
$utmGifLocation = "http://www.google-analytics.com/__utm.gif";
|
|
151
|
+
|
|
152
|
+
// Construct the gif hit url.
|
|
153
|
+
$utmUrl = $utmGifLocation . "?" .
|
|
154
|
+
"utmwv=" . VERSION .
|
|
155
|
+
"&utmn=" . getRandomNumber() .
|
|
156
|
+
"&utmhn=" . urlencode($domainName) .
|
|
157
|
+
"&utmr=" . urlencode($documentReferer) .
|
|
158
|
+
"&utmp=" . urlencode($documentPath) .
|
|
159
|
+
"&utmac=" . $account .
|
|
160
|
+
"&utmcc=__utma%3D999.999.999.999.999.1%3B" .
|
|
161
|
+
"&utmvid=" . $visitorId .
|
|
162
|
+
"&utmip=" . getIP($_SERVER["REMOTE_ADDR"]);
|
|
163
|
+
|
|
164
|
+
sendRequestToGoogleAnalytics($utmUrl);
|
|
165
|
+
|
|
166
|
+
// If the debug parameter is on, add a header to the response that contains
|
|
167
|
+
// the url that was used to contact Google Analytics.
|
|
168
|
+
if (!empty($_GET["utmdebug"])) {
|
|
169
|
+
header("X-GA-MOBILE-URL:" . $utmUrl);
|
|
170
|
+
}
|
|
171
|
+
// Finally write the gif data to the response.
|
|
172
|
+
writeGifData();
|
|
173
|
+
}
|
|
174
|
+
?><?php
|
|
175
|
+
trackPageView();
|
|
176
|
+
?>
|
data/lib/middleman-core/templates/mobile/source/tools/googleanalyticsformobile/php/php1.snippet
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
// Copyright 2009 Google Inc. All Rights Reserved.
|
|
3
|
+
$GA_ACCOUNT = "ACCOUNT ID GOES HERE";
|
|
4
|
+
$GA_PIXEL = "ga.php";
|
|
5
|
+
|
|
6
|
+
function googleAnalyticsGetImageUrl() {
|
|
7
|
+
global $GA_ACCOUNT, $GA_PIXEL;
|
|
8
|
+
$url = "";
|
|
9
|
+
$url .= $GA_PIXEL . "?";
|
|
10
|
+
$url .= "utmac=" . $GA_ACCOUNT;
|
|
11
|
+
$url .= "&utmn=" . rand(0, 0x7fffffff);
|
|
12
|
+
|
|
13
|
+
$referer = $_SERVER["HTTP_REFERER"];
|
|
14
|
+
$query = $_SERVER["QUERY_STRING"];
|
|
15
|
+
$path = $_SERVER["REQUEST_URI"];
|
|
16
|
+
|
|
17
|
+
if (empty($referer)) {
|
|
18
|
+
$referer = "-";
|
|
19
|
+
}
|
|
20
|
+
$url .= "&utmr=" . urlencode($referer);
|
|
21
|
+
|
|
22
|
+
if (!empty($path)) {
|
|
23
|
+
$url .= "&utmp=" . urlencode($path);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
$url .= "&guid=ON";
|
|
27
|
+
|
|
28
|
+
return $url;
|
|
29
|
+
}
|
|
30
|
+
?>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
$GA_ACCOUNT = "MO-3845491-5";
|
|
3
|
+
$GA_PIXEL = "ga.php";
|
|
4
|
+
|
|
5
|
+
function googleAnalyticsGetImageUrl() {
|
|
6
|
+
global $GA_ACCOUNT, $GA_PIXEL;
|
|
7
|
+
$url = "";
|
|
8
|
+
$url .= $GA_PIXEL . "?";
|
|
9
|
+
$url .= "utmac=" . $GA_ACCOUNT;
|
|
10
|
+
$url .= "&utmn=" . rand(0, 0x7fffffff);
|
|
11
|
+
|
|
12
|
+
$referer = $_SERVER["HTTP_REFERER"];
|
|
13
|
+
$query = $_SERVER["QUERY_STRING"];
|
|
14
|
+
$path = $_SERVER["REQUEST_URI"];
|
|
15
|
+
|
|
16
|
+
if (empty($referer)) {
|
|
17
|
+
$referer = "-";
|
|
18
|
+
}
|
|
19
|
+
$url .= "&utmr=" . urlencode($referer);
|
|
20
|
+
|
|
21
|
+
if (!empty($path)) {
|
|
22
|
+
$url .= "&utmp=" . urlencode($path);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
$url .= "&guid=ON";
|
|
26
|
+
|
|
27
|
+
return $url;
|
|
28
|
+
}
|
|
29
|
+
?>
|
|
30
|
+
<html>
|
|
31
|
+
<head>
|
|
32
|
+
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
33
|
+
<title>Sample Mobile Analytics Page</title>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
|
|
37
|
+
Publishers content here.
|
|
38
|
+
<?php
|
|
39
|
+
$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
|
|
40
|
+
?>
|
|
41
|
+
<img src="<?= $googleAnalyticsImageUrl ?>" />
|
|
42
|
+
Testing: <?= $googleAnalyticsImageUrl ?>
|
|
43
|
+
</body>
|
|
44
|
+
</html>
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/perl -w
|
|
2
|
+
#
|
|
3
|
+
# Copyright 2009 Google Inc. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
use CGI;
|
|
6
|
+
use Digest::MD5 qw(md5_hex);
|
|
7
|
+
use LWP::UserAgent;
|
|
8
|
+
use URI::Escape;
|
|
9
|
+
use strict;
|
|
10
|
+
|
|
11
|
+
# Tracker version.
|
|
12
|
+
use constant VERSION => '4.4sp';
|
|
13
|
+
|
|
14
|
+
use constant COOKIE_NAME => '__utmmobile';
|
|
15
|
+
|
|
16
|
+
# The path the cookie will be available to, edit this to use a different
|
|
17
|
+
# cookie path.
|
|
18
|
+
use constant COOKIE_PATH => '/';
|
|
19
|
+
|
|
20
|
+
# Two years.
|
|
21
|
+
use constant COOKIE_USER_PERSISTENCE => '+2y';
|
|
22
|
+
|
|
23
|
+
# 1x1 transparent GIF
|
|
24
|
+
my @GIF_DATA = (
|
|
25
|
+
0x47, 0x49, 0x46, 0x38, 0x39, 0x61,
|
|
26
|
+
0x01, 0x00, 0x01, 0x00, 0x80, 0xff,
|
|
27
|
+
0x00, 0xff, 0xff, 0xff, 0x00, 0x00,
|
|
28
|
+
0x00, 0x2c, 0x00, 0x00, 0x00, 0x00,
|
|
29
|
+
0x01, 0x00, 0x01, 0x00, 0x00, 0x02,
|
|
30
|
+
0x02, 0x44, 0x01, 0x00, 0x3b);
|
|
31
|
+
|
|
32
|
+
my $query = new CGI;
|
|
33
|
+
|
|
34
|
+
# The last octect of the IP address is removed to anonymize the user.
|
|
35
|
+
sub get_ip {
|
|
36
|
+
my ($remote_address) = @_;
|
|
37
|
+
if ($remote_address eq "") {
|
|
38
|
+
return "";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Capture the first three octects of the IP address and replace the forth
|
|
42
|
+
# with 0, e.g. 124.455.3.123 becomes 124.455.3.0
|
|
43
|
+
if ($remote_address =~ /^((\d{1,3}\.){3})\d{1,3}$/) {
|
|
44
|
+
return $1 . "0";
|
|
45
|
+
} else {
|
|
46
|
+
return "";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
# Generate a visitor id for this hit.
|
|
51
|
+
# If there is a visitor id in the cookie, use that, otherwise
|
|
52
|
+
# use the guid if we have one, otherwise use a random number.
|
|
53
|
+
sub get_visitor_id {
|
|
54
|
+
my ($guid, $account, $user_agent, $cookie) = @_;
|
|
55
|
+
|
|
56
|
+
# If there is a value in the cookie, don't change it.
|
|
57
|
+
if ($cookie ne "") {
|
|
58
|
+
return $cookie;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
my $message = "";
|
|
62
|
+
if ($guid ne "") {
|
|
63
|
+
# Create the visitor id using the guid.
|
|
64
|
+
$message = $guid . $account;
|
|
65
|
+
} else {
|
|
66
|
+
# otherwise this is a new user, create a new random id.
|
|
67
|
+
$message = $user_agent . get_random_number();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
my $md5_string = md5_hex($message);
|
|
71
|
+
|
|
72
|
+
return "0x" . substr($md5_string, 0, 16);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
# Get a random number string.
|
|
76
|
+
sub get_random_number {
|
|
77
|
+
return int(rand(0x7fffffff));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
# Writes the bytes of a 1x1 transparent gif into the response.
|
|
81
|
+
sub write_gif_data {
|
|
82
|
+
my ($cookie, $utm_url) = @_;
|
|
83
|
+
|
|
84
|
+
my @header_args = (
|
|
85
|
+
-type => 'image/gif',
|
|
86
|
+
-Cache_Control =>
|
|
87
|
+
'private, no-cache, no-cache=Set-Cookie, proxy-revalidate',
|
|
88
|
+
-Pragma => 'no-cache',
|
|
89
|
+
-cookie => $cookie,
|
|
90
|
+
-expires => '-1d');
|
|
91
|
+
|
|
92
|
+
# If the debug parameter is on, add a header to the response that contains
|
|
93
|
+
# the url that was used to contact Google Analytics.
|
|
94
|
+
if (defined($query->param('utmdebug'))) {
|
|
95
|
+
push(@header_args, -X_GA_MOBILE_URL => $utm_url);
|
|
96
|
+
}
|
|
97
|
+
print $query->header(@header_args);
|
|
98
|
+
print pack("C35", @GIF_DATA);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
# Make a tracking request to Google Analytics from this server.
|
|
102
|
+
# Copies the headers from the original request to the new one.
|
|
103
|
+
# If request containg utmdebug parameter, exceptions encountered
|
|
104
|
+
# communicating with Google Analytics are thown.
|
|
105
|
+
sub send_request_to_google_analytics {
|
|
106
|
+
my ($utm_url) = @_;
|
|
107
|
+
my $ua = LWP::UserAgent->new;
|
|
108
|
+
|
|
109
|
+
if (exists($ENV{'HTTP_ACCEPT_LANGUAGE'})) {
|
|
110
|
+
$ua->default_header('Accepts-Language' => $ENV{'HTTP_ACCEPT_LANGUAGE'});
|
|
111
|
+
}
|
|
112
|
+
if (exists($ENV{'HTTP_USER_AGENT'})) {
|
|
113
|
+
$ua->agent($ENV{'HTTP_USER_AGENT'});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
my $ga_output = $ua->get($utm_url);
|
|
117
|
+
|
|
118
|
+
if (defined($query->param('utmdebug')) && !$ga_output->is_success) {
|
|
119
|
+
print $ga_output->status_line;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
# Track a page view, updates all the cookies and campaign tracker,
|
|
124
|
+
# makes a server side request to Google Analytics and writes the transparent
|
|
125
|
+
# gif byte data to the response.
|
|
126
|
+
sub track_page_view {
|
|
127
|
+
my $domain_name = "";
|
|
128
|
+
if (exists($ENV{'SERVER_NAME'})) {
|
|
129
|
+
$domain_name = $ENV{'SERVER_NAME'};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
# Get the referrer from the utmr parameter, this is the referrer to the
|
|
133
|
+
# page that contains the tracking pixel, not the referrer for tracking
|
|
134
|
+
# pixel.
|
|
135
|
+
my $document_referer = "-";
|
|
136
|
+
if (defined($query->param('utmr'))) {
|
|
137
|
+
$document_referer = uri_unescape($query->param('utmr'));
|
|
138
|
+
}
|
|
139
|
+
my $document_path = "";
|
|
140
|
+
if (defined($query->param('utmp'))) {
|
|
141
|
+
$document_path = uri_unescape($query->param('utmp'));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
my $account = $query->param('utmac');
|
|
145
|
+
my $user_agent = "";
|
|
146
|
+
if (exists($ENV{'HTTP_USER_AGENT'})) {
|
|
147
|
+
$user_agent = $ENV{'HTTP_USER_AGENT'};
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
# Try and get visitor cookie from the request.
|
|
151
|
+
my $cookie = "";
|
|
152
|
+
if (defined($query->cookie(COOKIE_NAME))) {
|
|
153
|
+
$cookie = $query->cookie(COOKIE_NAME);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
my $guid = "";
|
|
157
|
+
if (exists($ENV{'HTTP_X_DCMGUID'})) {
|
|
158
|
+
$guid = $ENV{'HTTP_X_DCMGUID'};
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
my $visitor_id = get_visitor_id($guid, $account, $user_agent, $cookie);
|
|
162
|
+
|
|
163
|
+
# Always try and add the cookie to the response.
|
|
164
|
+
my $new_cookie = $query->cookie(
|
|
165
|
+
-name => COOKIE_NAME,
|
|
166
|
+
-value => $visitor_id,
|
|
167
|
+
-path => COOKIE_PATH,
|
|
168
|
+
-expires => COOKIE_USER_PERSISTENCE);
|
|
169
|
+
|
|
170
|
+
my $utm_gif_location = "http://www.google-analytics.com/__utm.gif";
|
|
171
|
+
|
|
172
|
+
my $remote_address = "";
|
|
173
|
+
if (exists($ENV{'REMOTE_ADDR'})) {
|
|
174
|
+
$remote_address = $ENV{'REMOTE_ADDR'};
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
# Construct the gif hit url.
|
|
178
|
+
my $utm_url = $utm_gif_location . '?' .
|
|
179
|
+
'utmwv=' . VERSION .
|
|
180
|
+
'&utmn=' . get_random_number() .
|
|
181
|
+
'&utmhn=' . uri_escape($domain_name) .
|
|
182
|
+
'&utmr=' . uri_escape($document_referer) .
|
|
183
|
+
'&utmp=' . uri_escape($document_path) .
|
|
184
|
+
'&utmac=' . $account .
|
|
185
|
+
'&utmcc=__utma%3D999.999.999.999.999.1%3B' .
|
|
186
|
+
'&utmvid=' . $visitor_id .
|
|
187
|
+
'&utmip=' . get_ip($remote_address);
|
|
188
|
+
|
|
189
|
+
send_request_to_google_analytics($utm_url);
|
|
190
|
+
|
|
191
|
+
# Finally write the gif data to the response.
|
|
192
|
+
write_gif_data($new_cookie, $utm_url);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
track_page_view();
|