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
@@ -28,124 +28,130 @@
|
|
28
28
|
# methods to use in your views. Some modify the output on-the-fly. And some
|
29
29
|
# apply computationally-intensive changes to your final build files.
|
30
30
|
|
31
|
-
# Using for version parsing
|
32
|
-
require "rubygems"
|
33
|
-
|
34
31
|
# Namespace extensions module
|
35
|
-
module Middleman
|
32
|
+
module Middleman
|
33
|
+
module CoreExtensions
|
34
|
+
module Extensions
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
36
|
+
# Register extension
|
37
|
+
class << self
|
38
|
+
# @private
|
39
|
+
def registered(app)
|
40
|
+
# Using for version parsing
|
41
|
+
require "rubygems"
|
42
|
+
|
43
|
+
# app.set :default_extensions, []
|
44
|
+
app.define_hook :after_configuration
|
45
|
+
app.define_hook :before_configuration
|
46
|
+
app.define_hook :build_config
|
47
|
+
app.define_hook :development_config
|
46
48
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
app.extend ClassMethods
|
50
|
+
app.send :include, InstanceMethods
|
51
|
+
app.delegate :configure, :to => :"self.class"
|
52
|
+
end
|
53
|
+
alias :included :registered
|
54
|
+
end
|
52
55
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
# Class methods
|
57
|
+
module ClassMethods
|
58
|
+
# Add a callback to run in a specific environment
|
59
|
+
#
|
60
|
+
# @param [String, Symbol] env The environment to run in
|
61
|
+
# @return [void]
|
62
|
+
def configure(env, &block)
|
63
|
+
send("#{env}_config", &block)
|
64
|
+
end
|
62
65
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
# Alias `extensions` to access registered extensions
|
67
|
+
#
|
68
|
+
# @return [Array<Module>]
|
69
|
+
def extensions
|
70
|
+
@extensions ||= []
|
71
|
+
end
|
69
72
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
# Register a new extension
|
74
|
+
#
|
75
|
+
# @param [Module] extension Extension modules to register
|
76
|
+
# @param [Hash] options Per-extension options hash
|
77
|
+
# @return [void]
|
78
|
+
def register(extension, options={}, &block)
|
79
|
+
@extensions ||= []
|
80
|
+
@extensions += [extension]
|
77
81
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
82
|
+
extend extension
|
83
|
+
if extension.respond_to?(:registered)
|
84
|
+
if extension.method(:registered).arity === 1
|
85
|
+
extension.registered(self, &block)
|
86
|
+
else
|
87
|
+
extension.registered(self, options, &block)
|
88
|
+
end
|
89
|
+
end
|
84
90
|
end
|
85
91
|
end
|
86
|
-
end
|
87
|
-
end
|
88
92
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
93
|
+
# Instance methods
|
94
|
+
module InstanceMethods
|
95
|
+
# This method is available in the project's `config.rb`.
|
96
|
+
# It takes a underscore-separated symbol, finds the appropriate
|
97
|
+
# feature module and includes it.
|
98
|
+
#
|
99
|
+
# activate :lorem
|
100
|
+
#
|
101
|
+
# @param [Symbol, Module] ext Which extension to activate
|
102
|
+
# @return [void]
|
103
|
+
def activate(ext, options={}, &block)
|
104
|
+
# Make :i18n a no-op
|
105
|
+
return if ext == :i18n
|
102
106
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
107
|
+
ext_module = if ext.is_a?(Module)
|
108
|
+
ext
|
109
|
+
else
|
110
|
+
::Middleman::Extensions.load(ext.to_sym)
|
111
|
+
end
|
108
112
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
113
|
+
if ext_module.nil?
|
114
|
+
puts "== Unknown Extension: #{ext}"
|
115
|
+
else
|
116
|
+
puts "== Activating: #{ext}" if logging?
|
117
|
+
self.class.register(ext_module, options, &block)
|
118
|
+
end
|
119
|
+
end
|
116
120
|
|
117
|
-
|
118
|
-
|
119
|
-
|
121
|
+
# Load features before starting server
|
122
|
+
def initialize
|
123
|
+
super
|
120
124
|
|
121
|
-
|
122
|
-
|
125
|
+
self.class.inst = self
|
126
|
+
run_hook :before_configuration
|
123
127
|
|
124
|
-
|
125
|
-
|
128
|
+
# Search the root of the project for required files
|
129
|
+
$LOAD_PATH.unshift(root)
|
126
130
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
131
|
+
# Check for and evaluate local configuration
|
132
|
+
local_config = File.join(root, "config.rb")
|
133
|
+
if File.exists? local_config
|
134
|
+
puts "== Reading: Local config" if logging?
|
135
|
+
instance_eval File.read(local_config), local_config, 1
|
136
|
+
end
|
133
137
|
|
134
|
-
|
135
|
-
|
138
|
+
run_hook :build_config if build?
|
139
|
+
run_hook :development_config if development?
|
136
140
|
|
137
|
-
|
141
|
+
run_hook :after_configuration
|
138
142
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
+
# Add in defaults
|
144
|
+
default_extensions.each do |ext|
|
145
|
+
activate ext
|
146
|
+
end
|
143
147
|
|
144
|
-
|
145
|
-
|
146
|
-
|
148
|
+
if logging?
|
149
|
+
self.class.extensions.each do |ext|
|
150
|
+
puts "== Extension: #{ext}"
|
151
|
+
end
|
152
|
+
end
|
147
153
|
end
|
148
154
|
end
|
149
155
|
end
|
150
156
|
end
|
151
|
-
end
|
157
|
+
end
|
@@ -1,35 +1,39 @@
|
|
1
1
|
# Load helpers in helpers/
|
2
|
-
module Middleman
|
2
|
+
module Middleman
|
3
|
+
module CoreExtensions
|
4
|
+
module ExternalHelpers
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
+
# Setup extension
|
7
|
+
class << self
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
# once registered
|
10
|
+
def registered(app)
|
11
|
+
# Setup a default helpers paths
|
12
|
+
app.set :helpers_dir, "helpers"
|
13
|
+
app.set :helpers_filename_glob, "**/*_helper.rb"
|
14
|
+
app.set :helpers_filename_to_module_name_proc, Proc.new { |filename|
|
15
|
+
basename = File.basename(filename, File.extname(filename))
|
16
|
+
basename.camelcase
|
17
|
+
}
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
# After config
|
20
|
+
app.after_configuration do
|
21
|
+
helpers_path = File.expand_path(helpers_dir, root)
|
22
|
+
next unless File.exists?(helpers_path)
|
21
23
|
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
Dir[File.join(helpers_path, helpers_filename_glob)].each do |filename|
|
25
|
+
module_name = helpers_filename_to_module_name_proc.call(filename)
|
26
|
+
next unless module_name
|
25
27
|
|
26
|
-
|
27
|
-
|
28
|
+
require filename
|
29
|
+
next unless Object.const_defined?(module_name.to_sym)
|
28
30
|
|
29
|
-
|
31
|
+
helpers Object.const_get(module_name.to_sym)
|
32
|
+
end
|
33
|
+
end
|
30
34
|
end
|
35
|
+
alias :included :registered
|
31
36
|
end
|
32
37
|
end
|
33
|
-
alias :included :registered
|
34
38
|
end
|
35
39
|
end
|
@@ -1,135 +1,165 @@
|
|
1
1
|
require "find"
|
2
|
-
require "middleman-core/watcher"
|
3
2
|
require "set"
|
4
3
|
|
5
4
|
# API for watching file change events
|
6
|
-
module Middleman
|
5
|
+
module Middleman
|
6
|
+
module CoreExtensions
|
7
|
+
module FileWatcher
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
IGNORE_LIST = [
|
10
|
+
/^\.sass-cache\//,
|
11
|
+
/^\.git\//,
|
12
|
+
/^\.gitignore$/,
|
13
|
+
/^\.DS_Store$/,
|
14
|
+
/^build\//,
|
15
|
+
/^\.rbenv-.*$/,
|
16
|
+
/^Gemfile$/,
|
17
|
+
/^Gemfile\.lock$/,
|
18
|
+
/~$/
|
19
|
+
]
|
20
|
+
|
21
|
+
# Setup extension
|
22
|
+
class << self
|
10
23
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
24
|
+
# Once registered
|
25
|
+
def registered(app)
|
26
|
+
app.extend ClassMethods
|
27
|
+
app.send :include, InstanceMethods
|
15
28
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
29
|
+
# Before parsing config, load the data/ directory
|
30
|
+
app.before_configuration do
|
31
|
+
data_path = File.join(root, data_dir)
|
32
|
+
files.reload_path(data_path) if File.exists?(data_path)
|
33
|
+
end
|
21
34
|
|
22
|
-
|
23
|
-
|
24
|
-
|
35
|
+
# After config, load everything else
|
36
|
+
app.ready do
|
37
|
+
files.reload_path(root)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
alias :included :registered
|
25
41
|
end
|
26
|
-
end
|
27
|
-
alias :included :registered
|
28
|
-
end
|
29
42
|
|
30
|
-
|
31
|
-
|
43
|
+
# Class methods
|
44
|
+
module ClassMethods
|
32
45
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
46
|
+
# Access the file api
|
47
|
+
# @return [Middleman::CoreExtensions::FileWatcher::API]
|
48
|
+
def files
|
49
|
+
@_files_api ||= API.new
|
50
|
+
end
|
51
|
+
end
|
39
52
|
|
40
|
-
|
41
|
-
|
53
|
+
# Instance methods
|
54
|
+
module InstanceMethods
|
42
55
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
56
|
+
# Access the file api
|
57
|
+
# @return [Middleman::CoreExtensions::FileWatcher::API]
|
58
|
+
def files
|
59
|
+
@_files_api ||= API.new(self)
|
60
|
+
end
|
61
|
+
end
|
51
62
|
|
52
|
-
|
53
|
-
|
54
|
-
|
63
|
+
# Core File Change API class
|
64
|
+
class API
|
65
|
+
|
66
|
+
# Initialize api and internal path cache
|
67
|
+
def initialize(app)
|
68
|
+
@app = app
|
69
|
+
@known_paths = Set.new
|
70
|
+
|
71
|
+
@_changed = []
|
72
|
+
@_deleted = []
|
73
|
+
end
|
55
74
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
75
|
+
# Add callback to be run on file change
|
76
|
+
#
|
77
|
+
# @param [nil,Regexp] matcher A Regexp to match the change path against
|
78
|
+
# @return [Array<Proc>]
|
79
|
+
def changed(matcher=nil, &block)
|
80
|
+
@_changed << [block, matcher] if block_given?
|
81
|
+
@_changed
|
82
|
+
end
|
60
83
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
end
|
70
|
-
|
71
|
-
# Add callback to be run on file deletion
|
72
|
-
#
|
73
|
-
# @param [nil,Regexp] matcher A Regexp to match the deleted path against
|
74
|
-
# @return [Array<Proc>]
|
75
|
-
def deleted(matcher=nil, &block)
|
76
|
-
@_deleted ||= []
|
77
|
-
@_deleted << [block, matcher] if block_given?
|
78
|
-
@_deleted
|
79
|
-
end
|
84
|
+
# Add callback to be run on file deletion
|
85
|
+
#
|
86
|
+
# @param [nil,Regexp] matcher A Regexp to match the deleted path against
|
87
|
+
# @return [Array<Proc>]
|
88
|
+
def deleted(matcher=nil, &block)
|
89
|
+
@_deleted << [block, matcher] if block_given?
|
90
|
+
@_deleted
|
91
|
+
end
|
80
92
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
93
|
+
# Notify callbacks that a file changed
|
94
|
+
#
|
95
|
+
# @param [String] path The file that changed
|
96
|
+
# @return [void]
|
97
|
+
def did_change(path)
|
98
|
+
return if IGNORE_LIST.any? { |r| path.match(r) }
|
99
|
+
puts "== File Change: #{path}" if @app.logging?
|
100
|
+
@known_paths << path
|
101
|
+
self.run_callbacks(path, :changed)
|
102
|
+
end
|
90
103
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
104
|
+
# Notify callbacks that a file was deleted
|
105
|
+
#
|
106
|
+
# @param [String] path The file that was deleted
|
107
|
+
# @return [void]
|
108
|
+
def did_delete(path)
|
109
|
+
return if IGNORE_LIST.any? { |r| path.match(r) }
|
110
|
+
puts "== File Deletion: #{path}" if @app.logging?
|
111
|
+
@known_paths.delete(path)
|
112
|
+
self.run_callbacks(path, :deleted)
|
113
|
+
end
|
100
114
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
115
|
+
# Manually trigger update events
|
116
|
+
#
|
117
|
+
# @param [String] path The path to reload
|
118
|
+
# @return [void]
|
119
|
+
def reload_path(path)
|
120
|
+
relative_path = path.sub("#{@app.root}/", "")
|
121
|
+
subset = @known_paths.select { |p| p.match(%r{^#{relative_path}}) }
|
107
122
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
123
|
+
Find.find(path) do |path|
|
124
|
+
next if File.directory?(path)
|
125
|
+
relative_path = path.sub("#{@app.root}/", "")
|
126
|
+
subset.delete(relative_path)
|
127
|
+
self.did_change(relative_path)
|
128
|
+
end if File.exists?(path)
|
114
129
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
protected
|
121
|
-
# Notify callbacks for a file given an array of callbacks
|
122
|
-
#
|
123
|
-
# @param [String] path The file that was changed
|
124
|
-
# @param [Symbol] callbacks_name The name of the callbacks method
|
125
|
-
# @return [void]
|
126
|
-
def run_callbacks(path, callbacks_name)
|
127
|
-
return if ::Middleman::Watcher.ignore_list.any? { |r| path.match(r) }
|
130
|
+
subset.each do |removed_path|
|
131
|
+
self.did_delete(removed_path)
|
132
|
+
end
|
133
|
+
end
|
128
134
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
135
|
+
# Like reload_path, but only triggers events on new files
|
136
|
+
#
|
137
|
+
# @param [String] path The path to reload
|
138
|
+
# @return [void]
|
139
|
+
def find_new_files(path)
|
140
|
+
relative_path = path.sub("#{@app.root}/", "")
|
141
|
+
subset = @known_paths.select { |p| p.match(%r{^#{relative_path}}) }
|
142
|
+
|
143
|
+
Find.find(path) do |file|
|
144
|
+
next if File.directory?(file)
|
145
|
+
relative_path = file.sub("#{@app.root}/", "")
|
146
|
+
self.did_change(relative_path) unless subset.include?(relative_path)
|
147
|
+
end if File.exists?(path)
|
148
|
+
end
|
149
|
+
|
150
|
+
protected
|
151
|
+
# Notify callbacks for a file given an array of callbacks
|
152
|
+
#
|
153
|
+
# @param [String] path The file that was changed
|
154
|
+
# @param [Symbol] callbacks_name The name of the callbacks method
|
155
|
+
# @return [void]
|
156
|
+
def run_callbacks(path, callbacks_name)
|
157
|
+
self.send(callbacks_name).each do |callback, matcher|
|
158
|
+
next if path.match(%r{^#{@app.build_dir}/})
|
159
|
+
next unless matcher.nil? || path.match(matcher)
|
160
|
+
@app.instance_exec(path, &callback)
|
161
|
+
end
|
162
|
+
end
|
133
163
|
end
|
134
164
|
end
|
135
165
|
end
|