middleman-core 3.0.0.beta.2 → 3.0.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- data/features/cli_extension.feature +13 -0
- data/features/{cli.feature → cli_init.feature} +1 -10
- data/features/directory_index.feature +29 -1
- data/features/dynamic_pages.feature +1 -0
- data/features/extensionless_text_files.feature +0 -2
- data/features/front-matter.feature +17 -1
- data/features/frontmatter_page_settings.feature +16 -1
- data/features/helpers_relative_link_to.feature +68 -0
- data/features/unicode_filenames.feature +14 -0
- data/fixtures/csspie/config.rb +0 -0
- data/fixtures/csspie/source/stylesheets/PIE.htc +96 -0
- data/fixtures/dynamic-pages-app/config.rb +3 -0
- data/fixtures/frontmatter-app/source/front-matter-auto.erb +6 -0
- data/fixtures/frontmatter-app/source/front-matter.html.erb +2 -0
- data/fixtures/frontmatter-app/source/json-front-matter-2.php.erb +7 -0
- data/fixtures/frontmatter-app/source/json-front-matter-auto.erb +6 -0
- data/fixtures/frontmatter-app/source/json-front-matter.html.erb +6 -0
- data/fixtures/unicode-filenames-app/config.rb +1 -0
- data/fixtures/unicode-filenames-app/source/snowmen-rule-/342/230/203.html +4 -0
- data/lib/middleman-core/application.rb +43 -335
- data/lib/middleman-core/cli/build.rb +11 -4
- data/lib/middleman-core/cli/bundler.rb +40 -0
- data/lib/middleman-core/cli/extension.rb +36 -0
- data/lib/middleman-core/cli/server.rb +2 -2
- data/lib/middleman-core/cli.rb +2 -6
- data/lib/middleman-core/core_extensions/assets.rb +35 -31
- data/lib/middleman-core/core_extensions/builder.rb +14 -9
- data/lib/middleman-core/core_extensions/data.rb +150 -145
- data/lib/middleman-core/core_extensions/default_helpers.rb +159 -97
- data/lib/middleman-core/core_extensions/extensions.rb +103 -97
- data/lib/middleman-core/core_extensions/external_helpers.rb +27 -23
- data/lib/middleman-core/core_extensions/file_watcher.rb +140 -110
- data/lib/middleman-core/core_extensions/front_matter.rb +155 -175
- data/lib/middleman-core/core_extensions/i18n.rb +111 -102
- data/lib/middleman-core/core_extensions/rendering.rb +293 -295
- data/lib/middleman-core/core_extensions/request.rb +338 -0
- data/lib/middleman-core/core_extensions/routing.rb +72 -68
- data/lib/middleman-core/core_extensions/show_exceptions.rb +23 -18
- data/lib/middleman-core/core_extensions.rb +39 -0
- data/lib/middleman-core/extensions/directory_indexes.rb +1 -4
- data/lib/middleman-core/extensions/lorem.rb +10 -3
- data/lib/middleman-core/extensions.rb +2 -64
- data/lib/middleman-core/preview_server.rb +157 -0
- data/lib/middleman-core/sitemap/extensions/ignores.rb +73 -68
- data/lib/middleman-core/sitemap/extensions/on_disk.rb +65 -58
- data/lib/middleman-core/sitemap/extensions/proxies.rb +86 -75
- data/lib/middleman-core/sitemap/extensions/traversal.rb +68 -61
- data/lib/middleman-core/sitemap/resource.rb +123 -102
- data/lib/middleman-core/sitemap/store.rb +170 -149
- data/lib/middleman-core/sitemap.rb +57 -57
- data/lib/middleman-core/step_definitions/server_steps.rb +13 -3
- data/lib/middleman-core/templates/extension/Gemfile +4 -0
- data/lib/middleman-core/templates/extension/Rakefile +12 -0
- data/lib/middleman-core/templates/extension/features/support/env.rb +4 -0
- data/lib/middleman-core/templates/extension/gemspec +24 -0
- data/lib/middleman-core/templates/extension/lib/lib.rb +49 -0
- data/lib/middleman-core/templates/extension/lib/middleman_extension.rb +1 -0
- data/lib/middleman-core/templates/shared/gitignore +14 -0
- data/lib/middleman-core/templates.rb +14 -8
- data/lib/middleman-core/util.rb +31 -9
- data/lib/middleman-core/version.rb +1 -1
- data/lib/middleman-core.rb +6 -4
- data/middleman-core.gemspec +4 -6
- metadata +62 -203
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.document +0 -5
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.gitignore +0 -22
- data/lib/middleman-core/vendor/padrino-core-0.10.6/.yardopts +0 -1
- data/lib/middleman-core/vendor/padrino-core-0.10.6/LICENSE.txt +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/README.rdoc +0 -294
- data/lib/middleman-core/vendor/padrino-core-0.10.6/Rakefile +0 -5
- data/lib/middleman-core/vendor/padrino-core-0.10.6/bin/padrino +0 -9
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/rendering.rb +0 -292
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/routing.rb +0 -943
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application/showexceptions.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/application.rb +0 -269
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/caller.rb +0 -53
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/adapter.rb +0 -24
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/base.rb +0 -150
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/console.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake.rb +0 -24
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/cli/rake_tasks.rb +0 -59
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/command.rb +0 -38
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/404.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/images/500.png +0 -0
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/loader.rb +0 -211
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/cs.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/da.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/de.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/en.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/es.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/fr.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/hu.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/it.yml +0 -40
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ja.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/lv.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/nl.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/no.yml +0 -35
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pl.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/pt_br.yml +0 -40
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/ru.yml +0 -35
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/tr.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/uk.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_cn.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/locale/zh_tw.yml +0 -34
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/logger.rb +0 -428
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/mounter.rb +0 -224
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/reloader.rb +0 -254
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/router.rb +0 -98
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/server.rb +0 -79
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/support_lite.rb +0 -199
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/tasks.rb +0 -21
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core/version.rb +0 -20
- data/lib/middleman-core/vendor/padrino-core-0.10.6/lib/padrino-core.rb +0 -152
- data/lib/middleman-core/vendor/padrino-core-0.10.6/padrino-core.gemspec +0 -38
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.components +0 -6
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/.gitignore +0 -7
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/complex.rb +0 -32
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/apps/simple.rb +0 -33
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/a.rb +0 -9
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/b.rb +0 -4
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/c.rb +0 -1
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/e.rb +0 -13
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/f.rb +0 -2
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/circular/g.rb +0 -2
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/fixtures/dependencies/d.rb +0 -4
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/helper.rb +0 -83
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/mini_shoulda.rb +0 -45
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_application.rb +0 -108
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_core.rb +0 -77
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_dependencies.rb +0 -44
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_filters.rb +0 -278
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_locale.rb +0 -21
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_logger.rb +0 -154
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_mounter.rb +0 -177
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_complex.rb +0 -75
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_reloader_simple.rb +0 -98
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_rendering.rb +0 -461
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_restful_routing.rb +0 -33
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_router.rb +0 -146
- data/lib/middleman-core/vendor/padrino-core-0.10.6/test/test_routing.rb +0 -1680
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.document +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.gitignore +0 -21
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/.yardopts +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/LICENSE.txt +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/README.rdoc +0 -239
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/Rakefile +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/asset_tag_helpers.rb +0 -417
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/abstract_form_builder.rb +0 -251
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_builder/standard_form_builder.rb +0 -43
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/form_helpers.rb +0 -787
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/format_helpers.rb +0 -381
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/cs.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/da.yml +0 -91
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/de.yml +0 -81
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/en.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/es.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/fr.yml +0 -80
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/hu.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/it.yml +0 -89
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ja.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/lv.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/nl.yml +0 -82
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/no.yml +0 -91
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pl.yml +0 -95
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/pt_br.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/ru.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/tr.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/uk.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_cn.yml +0 -104
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/locale/zh_tw.yml +0 -103
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/number_helpers.rb +0 -288
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/abstract_handler.rb +0 -98
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/erb_handler.rb +0 -79
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/haml_handler.rb +0 -63
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers/slim_handler.rb +0 -81
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/output_helpers.rb +0 -175
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/render_helpers.rb +0 -60
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/tag_helpers.rb +0 -260
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers/translation_helpers.rb +0 -38
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/lib/padrino-helpers.rb +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/padrino-helpers.gemspec +0 -27
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/app.rb +0 -73
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.erb +0 -14
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.haml +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/capture_concat.slim +0 -13
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.erb +0 -14
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.haml +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_for.slim +0 -12
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.erb +0 -11
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.haml +0 -9
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/content_tag.slim +0 -9
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.erb +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/current_engine.slim +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.erb +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.haml +0 -15
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/fields_for.slim +0 -15
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.erb +0 -72
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.haml +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_for.slim +0 -59
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.erb +0 -86
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.haml +0 -70
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/form_tag.slim +0 -70
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.erb +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.haml +0 -4
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/link_to.slim +0 -4
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.erb +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.haml +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/mail_to.slim +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.erb +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.haml +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/meta_tag.slim +0 -3
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_erb.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_haml.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/partials/_slim.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/markup_app/views/simple_partial.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/app.rb +0 -50
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_erb.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_haml.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/current_engines/_slim.slim +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/erb/test.erb +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/explicit_engine.haml +0 -5
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/haml/test.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/_user.haml +0 -7
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/haml_template.haml +0 -1
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/fixtures/render_app/views/template/some_template.haml +0 -2
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/helper.rb +0 -66
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_asset_tag_helpers.rb +0 -328
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_builder.rb +0 -1106
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_form_helpers.rb +0 -770
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_format_helpers.rb +0 -227
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_locale.rb +0 -20
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_number_helpers.rb +0 -139
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_output_helpers.rb +0 -153
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_render_helpers.rb +0 -76
- data/lib/middleman-core/vendor/padrino-helpers-0.10.6/test/test_tag_helpers.rb +0 -106
- data/lib/middleman-core/watcher.rb +0 -196
@@ -1,69 +1,7 @@
|
|
1
1
|
module Middleman
|
2
2
|
|
3
|
-
# Backwards compatibility namespace
|
4
|
-
module Features
|
5
|
-
end
|
6
|
-
|
7
|
-
module CoreExtensions
|
8
|
-
# File Change Notifier
|
9
|
-
autoload :FileWatcher, "middleman-core/core_extensions/file_watcher"
|
10
|
-
|
11
|
-
# In-memory Sitemap
|
12
|
-
autoload :Sitemap, "middleman-core/core_extensions/sitemap"
|
13
|
-
|
14
|
-
# Add Builder callbacks
|
15
|
-
autoload :Builder, "middleman-core/core_extensions/builder"
|
16
|
-
|
17
|
-
# Custom Feature API
|
18
|
-
autoload :Extensions, "middleman-core/core_extensions/extensions"
|
19
|
-
|
20
|
-
# Asset Path Pipeline
|
21
|
-
autoload :Assets, "middleman-core/core_extensions/assets"
|
22
|
-
|
23
|
-
# Data looks at the data/ folder for YAML files and makes them available
|
24
|
-
# to dynamic requests.
|
25
|
-
autoload :Data, "middleman-core/core_extensions/data"
|
26
|
-
|
27
|
-
# Parse YAML from templates
|
28
|
-
autoload :FrontMatter, "middleman-core/core_extensions/front_matter"
|
29
|
-
|
30
|
-
# External helpers looks in the helpers/ folder for helper modules
|
31
|
-
autoload :ExternalHelpers, "middleman-core/core_extensions/external_helpers"
|
32
|
-
|
33
|
-
# DefaultHelpers are the built-in dynamic template helpers.
|
34
|
-
autoload :DefaultHelpers, "middleman-core/core_extensions/default_helpers"
|
35
|
-
|
36
|
-
# Extended version of Padrino's rendering
|
37
|
-
autoload :Rendering, "middleman-core/core_extensions/rendering"
|
38
|
-
|
39
|
-
# Pass custom options to views
|
40
|
-
autoload :Routing, "middleman-core/core_extensions/routing"
|
41
|
-
|
42
|
-
# Catch and show exceptions at the Rack level
|
43
|
-
autoload :ShowExceptions, "middleman-core/core_extensions/show_exceptions"
|
44
|
-
|
45
|
-
# i18n
|
46
|
-
autoload :I18n, "middleman-core/core_extensions/i18n"
|
47
|
-
end
|
48
|
-
|
49
3
|
module Extensions
|
50
|
-
# Provide Apache-style index.html files for directories
|
51
|
-
autoload :DirectoryIndexes, "middleman-core/extensions/directory_indexes"
|
52
|
-
|
53
|
-
# Lorem provides a handful of helpful prototyping methods to generate
|
54
|
-
# words, paragraphs, fake images, names and email addresses.
|
55
|
-
autoload :Lorem, "middleman-core/extensions/lorem"
|
56
|
-
|
57
|
-
# AutomaticImageSizes inspects the images used in your dynamic templates
|
58
|
-
# and automatically adds width and height attributes to their HTML
|
59
|
-
# elements.
|
60
|
-
autoload :AutomaticImageSizes, "middleman-core/extensions/automatic_image_sizes"
|
61
4
|
|
62
|
-
# AssetHost allows you to setup multiple domains to host your static
|
63
|
-
# assets. Calls to asset paths in dynamic templates will then rotate
|
64
|
-
# through each of the asset servers to better spread the load.
|
65
|
-
autoload :AssetHost, "middleman-core/extensions/asset_host"
|
66
|
-
|
67
5
|
class << self
|
68
6
|
def registered
|
69
7
|
@_registered ||= {}
|
@@ -168,8 +106,8 @@ module Middleman
|
|
168
106
|
# to discover extensions and Sprockets-supporting gems.
|
169
107
|
#
|
170
108
|
# @private
|
171
|
-
# @param [Gem::Specification]
|
172
|
-
# @param [String] Path to look for
|
109
|
+
# @param [Gem::Specification] spec
|
110
|
+
# @param [String] path Path to look for
|
173
111
|
# @return [Boolean] Whether the file exists
|
174
112
|
def spec_has_file?(spec, path)
|
175
113
|
full_path = File.join(spec.full_gem_path, path)
|
@@ -0,0 +1,157 @@
|
|
1
|
+
module Middleman
|
2
|
+
|
3
|
+
WINDOWS = !!(RUBY_PLATFORM =~ /(mingw|bccwin|wince|mswin32)/i) unless const_defined?(:WINDOWS)
|
4
|
+
|
5
|
+
module PreviewServer
|
6
|
+
|
7
|
+
DEFAULT_PORT = 4567
|
8
|
+
|
9
|
+
class << self
|
10
|
+
|
11
|
+
# Start an instance of Middleman::Application
|
12
|
+
# @return [void]
|
13
|
+
def start(options={})
|
14
|
+
require "webrick"
|
15
|
+
|
16
|
+
app = ::Middleman::Application.server.inst do
|
17
|
+
if options[:environment]
|
18
|
+
set :environment, options[:environment]
|
19
|
+
end
|
20
|
+
|
21
|
+
if options[:debug]
|
22
|
+
set :logging, true
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
puts "== The Middleman is standing watch on port #{options[:port]||4567}"
|
27
|
+
|
28
|
+
@webrick ||= setup_webrick(
|
29
|
+
options[:host] || "0.0.0.0",
|
30
|
+
options[:port] || DEFAULT_PORT,
|
31
|
+
options[:debug] || false
|
32
|
+
)
|
33
|
+
|
34
|
+
mount_instance(app)
|
35
|
+
|
36
|
+
@initialized ||= false
|
37
|
+
unless @initialized
|
38
|
+
@initialized = true
|
39
|
+
|
40
|
+
register_signal_handlers unless ::Middleman::WINDOWS
|
41
|
+
|
42
|
+
start_file_watcher unless options[:"disable-watcher"]
|
43
|
+
|
44
|
+
@webrick.start
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Detach the current Middleman::Application instance
|
49
|
+
# @return [void]
|
50
|
+
def stop
|
51
|
+
puts "== The Middleman is shutting down"
|
52
|
+
unmount_instance
|
53
|
+
end
|
54
|
+
|
55
|
+
# Simply stop, then start the server
|
56
|
+
# @return [void]
|
57
|
+
def reload
|
58
|
+
stop
|
59
|
+
start
|
60
|
+
end
|
61
|
+
|
62
|
+
# Stop the current instance, exit Webrick
|
63
|
+
# @return [void]
|
64
|
+
def shutdown
|
65
|
+
stop
|
66
|
+
@webrick.shutdown
|
67
|
+
end
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def start_file_watcher
|
72
|
+
# Watcher Library
|
73
|
+
require "listen"
|
74
|
+
|
75
|
+
listener = Listen.to(Dir.pwd, :relative_paths => true)
|
76
|
+
|
77
|
+
listener.change do |modified, added, removed|
|
78
|
+
added_and_modified = (modified + added)
|
79
|
+
|
80
|
+
if added_and_modified.length > 0
|
81
|
+
# See if the changed file is config.rb or lib/*.rb
|
82
|
+
return reload if needs_to_reload?(added_and_modified)
|
83
|
+
|
84
|
+
# Otherwise forward to Middleman
|
85
|
+
added_and_modified.each do |path|
|
86
|
+
@app.files.did_change(path)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
if removed.length > 0
|
91
|
+
# See if the changed file is config.rb or lib/*.rb
|
92
|
+
return reload if needs_to_reload?(removed)
|
93
|
+
|
94
|
+
# Otherwise forward to Middleman
|
95
|
+
removed.each do |path|
|
96
|
+
@app.files.did_delete(path)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
# Don't block this thread
|
102
|
+
listener.start(false)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Trap the interupt signal and shut down smoothly
|
106
|
+
# @return [void]
|
107
|
+
def register_signal_handlers
|
108
|
+
trap("INT") { shutdown }
|
109
|
+
trap("TERM") { shutdown }
|
110
|
+
trap("QUIT") { shutdown }
|
111
|
+
end
|
112
|
+
|
113
|
+
# Initialize webrick
|
114
|
+
# @return [void]
|
115
|
+
def setup_webrick(host, port, is_logging)
|
116
|
+
@host = host
|
117
|
+
@port = port
|
118
|
+
|
119
|
+
http_opts = {
|
120
|
+
:BindAddress => @host,
|
121
|
+
:Port => @port,
|
122
|
+
:AccessLog => []
|
123
|
+
}
|
124
|
+
|
125
|
+
unless is_logging
|
126
|
+
http_opts[:Logger] = ::WEBrick::Log::new(nil, 0)
|
127
|
+
end
|
128
|
+
|
129
|
+
::WEBrick::HTTPServer.new(http_opts)
|
130
|
+
end
|
131
|
+
|
132
|
+
# Attach a new Middleman::Application instance
|
133
|
+
# @param [Middleman::Application] app
|
134
|
+
# @return [void]
|
135
|
+
def mount_instance(app)
|
136
|
+
@app = app
|
137
|
+
@webrick.mount "/", ::Rack::Handler::WEBrick, @app.class.to_rack_app
|
138
|
+
end
|
139
|
+
|
140
|
+
# Detach the current Middleman::Application instance
|
141
|
+
# @return [void]
|
142
|
+
def unmount_instance
|
143
|
+
@webrick.unmount "/"
|
144
|
+
@app = nil
|
145
|
+
end
|
146
|
+
|
147
|
+
# Whether the passed files are config.rb, lib/*.rb or helpers
|
148
|
+
# @param [Array<String>] paths Array of paths to check
|
149
|
+
# @return [Boolean] Whether the server needs to reload
|
150
|
+
def needs_to_reload?(paths)
|
151
|
+
paths.any? do |path|
|
152
|
+
path.match(%{^config\.rb}) || path.match(%r{^lib/^[^\.](.*)\.rb$}) || path.match(%r{^helpers/^[^\.](.*)_helper\.rb$})
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
@@ -1,86 +1,91 @@
|
|
1
|
-
module Middleman
|
1
|
+
module Middleman
|
2
|
+
|
3
|
+
module Sitemap
|
4
|
+
|
5
|
+
module Extensions
|
2
6
|
|
3
|
-
|
7
|
+
module Ignores
|
4
8
|
|
5
|
-
|
6
|
-
|
9
|
+
# Setup extension
|
10
|
+
class << self
|
7
11
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
+
# Once registered
|
13
|
+
def registered(app)
|
14
|
+
# Include methods
|
15
|
+
app.send :include, InstanceMethods
|
12
16
|
|
13
|
-
|
14
|
-
|
17
|
+
::Middleman::Sitemap::Resource.send :include, ResourceInstanceMethods
|
18
|
+
end
|
15
19
|
|
16
|
-
|
17
|
-
|
20
|
+
alias :included :registered
|
21
|
+
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
23
|
+
# Helpers methods for Resources
|
24
|
+
module ResourceInstanceMethods
|
25
|
+
|
26
|
+
# Whether the Resource is ignored
|
27
|
+
# @return [Boolean]
|
28
|
+
def ignored?
|
29
|
+
@app.ignore_manager.ignored?(path) ||
|
30
|
+
(!proxy? &&
|
31
|
+
@app.ignore_manager.ignored?(source_file.sub("#{@app.source_dir}/", ""))
|
32
|
+
)
|
33
|
+
end
|
34
|
+
end
|
27
35
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
36
|
+
# Ignore-related instance methods
|
37
|
+
module InstanceMethods
|
38
|
+
def ignore_manager
|
39
|
+
@_ignore_manager ||= IgnoreManager.new(self)
|
40
|
+
end
|
32
41
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
# Ignore a path or add an ignore callback
|
43
|
+
# @param [String, Regexp] path Path glob expression, or path regex
|
44
|
+
# @return [void]
|
45
|
+
def ignore(path=nil, &block)
|
46
|
+
ignore_manager.ignore(path, &block)
|
47
|
+
end
|
48
|
+
end
|
37
49
|
|
38
|
-
|
39
|
-
|
40
|
-
|
50
|
+
# Class to handle managing ignores
|
51
|
+
class IgnoreManager
|
52
|
+
def initialize(app)
|
53
|
+
@app = app
|
41
54
|
|
42
|
-
|
43
|
-
|
55
|
+
# Array of callbacks which can ass ignored
|
56
|
+
@ignored_callbacks = []
|
57
|
+
end
|
44
58
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
59
|
+
# Ignore a path or add an ignore callback
|
60
|
+
# @param [String, Regexp] path Path glob expression, or path regex
|
61
|
+
# @return [void]
|
62
|
+
def ignore(path=nil, &block)
|
63
|
+
original_callback_size = @ignored_callbacks.size
|
50
64
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
65
|
+
if path.is_a? Regexp
|
66
|
+
@ignored_callbacks << Proc.new {|p| p =~ path }
|
67
|
+
elsif path.is_a? String
|
68
|
+
path_clean = ::Middleman::Util.normalize_path(path)
|
69
|
+
if path_clean.include?("*") # It's a glob
|
70
|
+
@ignored_callbacks << Proc.new {|p| File.fnmatch(path_clean, p) }
|
71
|
+
else
|
72
|
+
# Add a specific-path ignore unless that path is already covered
|
73
|
+
@ignored_callbacks << Proc.new {|p| p == path_clean } unless ignored?(path_clean)
|
74
|
+
end
|
75
|
+
elsif block_given?
|
76
|
+
@ignored_callbacks << block
|
77
|
+
end
|
60
78
|
end
|
61
|
-
elsif block_given?
|
62
|
-
@ignored_callbacks << block
|
63
|
-
end
|
64
79
|
|
65
|
-
|
66
|
-
@
|
80
|
+
# Whether a path is ignored
|
81
|
+
# @param [String] path
|
82
|
+
# @return [Boolean]
|
83
|
+
def ignored?(path)
|
84
|
+
path_clean = ::Middleman::Util.normalize_path(path)
|
85
|
+
@ignored_callbacks.any? { |b| b.call(path_clean) }
|
86
|
+
end
|
67
87
|
end
|
68
88
|
end
|
69
|
-
|
70
|
-
# Whether a path is ignored
|
71
|
-
# @param [String] path
|
72
|
-
# @return [Boolean]
|
73
|
-
def ignored?(path)
|
74
|
-
path_clean = ::Middleman::Util.normalize_path(path)
|
75
|
-
@ignored_callbacks.any? { |b| b.call(path_clean) }
|
76
|
-
end
|
77
|
-
|
78
|
-
# Update the main sitemap resource list
|
79
|
-
# @return [void]
|
80
|
-
def manipulate_resource_list(resources)
|
81
|
-
# No op
|
82
|
-
resources
|
83
|
-
end
|
84
89
|
end
|
85
90
|
end
|
86
|
-
end
|
91
|
+
end
|
@@ -1,77 +1,84 @@
|
|
1
1
|
require 'set'
|
2
2
|
|
3
|
-
module Middleman
|
4
|
-
|
3
|
+
module Middleman
|
4
|
+
|
5
|
+
module Sitemap
|
6
|
+
|
7
|
+
module Extensions
|
8
|
+
|
9
|
+
class OnDisk
|
5
10
|
|
6
|
-
|
7
|
-
|
11
|
+
attr_accessor :sitemap
|
12
|
+
attr_accessor :waiting_for_ready
|
8
13
|
|
9
|
-
|
10
|
-
|
11
|
-
|
14
|
+
def initialize(sitemap)
|
15
|
+
@sitemap = sitemap
|
16
|
+
@app = @sitemap.app
|
12
17
|
|
13
|
-
|
18
|
+
@file_paths_on_disk = Set.new
|
14
19
|
|
15
|
-
|
16
|
-
|
20
|
+
scoped_self = self
|
21
|
+
@waiting_for_ready = true
|
17
22
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
# Register file change callback
|
24
|
+
@app.files.changed do |file|
|
25
|
+
scoped_self.touch_file(file, !scoped_self.waiting_for_ready)
|
26
|
+
end
|
22
27
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
# Register file delete callback
|
29
|
+
@app.files.deleted do |file|
|
30
|
+
scoped_self.remove_file(file, !scoped_self.waiting_for_ready)
|
31
|
+
end
|
27
32
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
+
@app.ready do
|
34
|
+
scoped_self.waiting_for_ready = false
|
35
|
+
scoped_self.sitemap.rebuild_resource_list!(:on_disk_ready)
|
36
|
+
end
|
37
|
+
end
|
33
38
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
# Update or add an on-disk file path
|
40
|
+
# @param [String] file
|
41
|
+
# @return [Boolean]
|
42
|
+
def touch_file(file, rebuild=true)
|
43
|
+
return false if file == @app.source_dir || File.directory?(file)
|
39
44
|
|
40
|
-
|
41
|
-
|
45
|
+
path = @sitemap.file_to_path(file)
|
46
|
+
return false unless path
|
42
47
|
|
43
|
-
|
44
|
-
|
45
|
-
|
48
|
+
ignored = @app.ignored_sitemap_matchers.any? do |name, callback|
|
49
|
+
callback.call(file, path)
|
50
|
+
end
|
46
51
|
|
47
|
-
|
52
|
+
@file_paths_on_disk << file unless ignored
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
# Rebuild the sitemap any time a file is touched
|
55
|
+
# in case one of the other manipulators
|
56
|
+
# (like asset_hash) cares about the contents of this file,
|
57
|
+
# whether or not it belongs in the sitemap (like a partial)
|
58
|
+
@sitemap.rebuild_resource_list!(:touched_file) if rebuild
|
59
|
+
end
|
55
60
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
# Remove a file from the store
|
62
|
+
# @param [String] file
|
63
|
+
# @return [void]
|
64
|
+
def remove_file(file, rebuild=true)
|
65
|
+
if @file_paths_on_disk.delete?(file)
|
66
|
+
@sitemap.rebuild_resource_list!(:removed_file) if rebuild
|
67
|
+
end
|
68
|
+
end
|
64
69
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
70
|
+
# Update the main sitemap resource list
|
71
|
+
# @return [void]
|
72
|
+
def manipulate_resource_list(resources)
|
73
|
+
resources + @file_paths_on_disk.map do |file|
|
74
|
+
::Middleman::Sitemap::Resource.new(
|
75
|
+
@sitemap,
|
76
|
+
@sitemap.file_to_path(file),
|
77
|
+
File.expand_path(file, @app.root)
|
78
|
+
)
|
79
|
+
end
|
80
|
+
end
|
74
81
|
end
|
75
82
|
end
|
76
83
|
end
|
77
|
-
end
|
84
|
+
end
|