nanoc 4.7.9 → 4.7.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +2 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +26 -27
- data/Guardfile +2 -0
- data/NEWS.md +11 -0
- data/README.md +1 -1
- data/Rakefile +2 -0
- data/bin/nanoc +2 -0
- data/lib/nanoc.rb +3 -1
- data/lib/nanoc/base.rb +2 -0
- data/lib/nanoc/base/contracts_support.rb +2 -0
- data/lib/nanoc/base/core_ext.rb +2 -0
- data/lib/nanoc/base/core_ext/array.rb +2 -0
- data/lib/nanoc/base/core_ext/hash.rb +2 -0
- data/lib/nanoc/base/core_ext/pathname.rb +2 -0
- data/lib/nanoc/base/core_ext/string.rb +2 -0
- data/lib/nanoc/base/entities.rb +2 -0
- data/lib/nanoc/base/entities/action_sequence.rb +2 -0
- data/lib/nanoc/base/entities/checksum_collection.rb +2 -0
- data/lib/nanoc/base/entities/code_snippet.rb +3 -0
- data/lib/nanoc/base/entities/configuration.rb +10 -3
- data/lib/nanoc/base/entities/content.rb +2 -0
- data/lib/nanoc/base/entities/context.rb +2 -0
- data/lib/nanoc/base/entities/dependency.rb +2 -0
- data/lib/nanoc/base/entities/directed_graph.rb +2 -0
- data/lib/nanoc/base/entities/document.rb +2 -0
- data/lib/nanoc/base/entities/identifiable_collection.rb +2 -0
- data/lib/nanoc/base/entities/identifier.rb +2 -0
- data/lib/nanoc/base/entities/item.rb +2 -0
- data/lib/nanoc/base/entities/item_rep.rb +2 -0
- data/lib/nanoc/base/entities/layout.rb +2 -0
- data/lib/nanoc/base/entities/lazy_value.rb +2 -0
- data/lib/nanoc/base/entities/outdatedness_reasons.rb +2 -0
- data/lib/nanoc/base/entities/outdatedness_status.rb +2 -0
- data/lib/nanoc/base/entities/pattern.rb +2 -0
- data/lib/nanoc/base/entities/processing_action.rb +2 -0
- data/lib/nanoc/base/entities/processing_actions.rb +2 -0
- data/lib/nanoc/base/entities/processing_actions/filter.rb +2 -0
- data/lib/nanoc/base/entities/processing_actions/layout.rb +2 -0
- data/lib/nanoc/base/entities/processing_actions/snapshot.rb +2 -0
- data/lib/nanoc/base/entities/props.rb +3 -1
- data/lib/nanoc/base/entities/site.rb +2 -0
- data/lib/nanoc/base/entities/snapshot_def.rb +2 -0
- data/lib/nanoc/base/error.rb +2 -0
- data/lib/nanoc/base/errors.rb +3 -1
- data/lib/nanoc/base/feature.rb +2 -0
- data/lib/nanoc/base/memoization.rb +2 -0
- data/lib/nanoc/base/repos.rb +2 -0
- data/lib/nanoc/base/repos/action_sequence_store.rb +2 -0
- data/lib/nanoc/base/repos/aggregate_data_source.rb +2 -0
- data/lib/nanoc/base/repos/checksum_store.rb +2 -0
- data/lib/nanoc/base/repos/compiled_content_cache.rb +2 -0
- data/lib/nanoc/base/repos/config_loader.rb +2 -0
- data/lib/nanoc/base/repos/data_source.rb +2 -0
- data/lib/nanoc/base/repos/dependency_store.rb +2 -0
- data/lib/nanoc/base/repos/in_mem_data_source.rb +2 -0
- data/lib/nanoc/base/repos/item_rep_repo.rb +2 -0
- data/lib/nanoc/base/repos/outdatedness_store.rb +2 -0
- data/lib/nanoc/base/repos/prefixed_data_source.rb +2 -0
- data/lib/nanoc/base/repos/site_loader.rb +2 -0
- data/lib/nanoc/base/repos/snapshot_repo.rb +2 -0
- data/lib/nanoc/base/repos/store.rb +2 -0
- data/lib/nanoc/base/services.rb +2 -0
- data/lib/nanoc/base/services/action_provider.rb +2 -0
- data/lib/nanoc/base/services/action_sequence_builder.rb +2 -0
- data/lib/nanoc/base/services/checksummer.rb +3 -1
- data/lib/nanoc/base/services/compilation_context.rb +2 -0
- data/lib/nanoc/base/services/compiler.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/abstract.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/cache.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/mark_done.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/recalculate.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/resume.rb +2 -0
- data/lib/nanoc/base/services/compiler/phases/write.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/build_reps.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/calculate_checksums.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/cleanup.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/compile_reps.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/determine_outdatedness.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/forget_outdated_dependencies.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/load_stores.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/postprocess.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/preprocess.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/prune.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/store_post_compilation_state.rb +2 -0
- data/lib/nanoc/base/services/compiler/stages/store_pre_compilation_state.rb +2 -0
- data/lib/nanoc/base/services/compiler_loader.rb +2 -0
- data/lib/nanoc/base/services/dependency_tracker.rb +2 -0
- data/lib/nanoc/base/services/executor.rb +2 -0
- data/lib/nanoc/base/services/filter.rb +3 -1
- data/lib/nanoc/base/services/item_rep_builder.rb +2 -0
- data/lib/nanoc/base/services/item_rep_router.rb +2 -0
- data/lib/nanoc/base/services/item_rep_selector.rb +2 -0
- data/lib/nanoc/base/services/item_rep_writer.rb +3 -1
- data/lib/nanoc/base/services/notification_center.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_checker.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rule.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/attributes_modified.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/code_snippets_modified.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/configuration_modified.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/content_modified.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/not_written.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/rules_modified.rb +2 -0
- data/lib/nanoc/base/services/outdatedness_rules/uses_always_outdated_filter.rb +2 -0
- data/lib/nanoc/base/services/pruner.rb +4 -2
- data/lib/nanoc/base/services/temp_filename_factory.rb +2 -0
- data/lib/nanoc/base/views.rb +2 -0
- data/lib/nanoc/base/views/config_view.rb +2 -0
- data/lib/nanoc/base/views/identifiable_collection_view.rb +2 -0
- data/lib/nanoc/base/views/item_collection_with_reps_view.rb +2 -0
- data/lib/nanoc/base/views/item_collection_without_reps_view.rb +2 -0
- data/lib/nanoc/base/views/item_rep_collection_view.rb +2 -0
- data/lib/nanoc/base/views/item_rep_view.rb +2 -0
- data/lib/nanoc/base/views/item_with_reps_view.rb +2 -0
- data/lib/nanoc/base/views/item_without_reps_view.rb +2 -0
- data/lib/nanoc/base/views/layout_collection_view.rb +2 -0
- data/lib/nanoc/base/views/layout_view.rb +2 -0
- data/lib/nanoc/base/views/mixins/document_view_mixin.rb +2 -0
- data/lib/nanoc/base/views/mixins/mutable_document_view_mixin.rb +2 -0
- data/lib/nanoc/base/views/mixins/with_reps_view_mixin.rb +2 -0
- data/lib/nanoc/base/views/mutable_config_view.rb +2 -0
- data/lib/nanoc/base/views/mutable_identifiable_collection_view.rb +2 -0
- data/lib/nanoc/base/views/mutable_item_collection_view.rb +2 -0
- data/lib/nanoc/base/views/mutable_item_view.rb +2 -0
- data/lib/nanoc/base/views/mutable_layout_collection_view.rb +2 -0
- data/lib/nanoc/base/views/mutable_layout_view.rb +2 -0
- data/lib/nanoc/base/views/post_compile_item_collection_view.rb +2 -0
- data/lib/nanoc/base/views/post_compile_item_rep_collection_view.rb +2 -0
- data/lib/nanoc/base/views/post_compile_item_rep_view.rb +2 -0
- data/lib/nanoc/base/views/post_compile_item_view.rb +2 -0
- data/lib/nanoc/base/views/view.rb +2 -0
- data/lib/nanoc/base/views/view_context.rb +2 -0
- data/lib/nanoc/checking.rb +2 -0
- data/lib/nanoc/checking/check.rb +2 -0
- data/lib/nanoc/checking/checks.rb +2 -0
- data/lib/nanoc/checking/checks/css.rb +2 -0
- data/lib/nanoc/checking/checks/external_links.rb +3 -1
- data/lib/nanoc/checking/checks/html.rb +2 -0
- data/lib/nanoc/checking/checks/internal_links.rb +2 -0
- data/lib/nanoc/checking/checks/mixed_content.rb +2 -0
- data/lib/nanoc/checking/checks/stale.rb +2 -0
- data/lib/nanoc/checking/checks/w3c_validator.rb +2 -0
- data/lib/nanoc/checking/dsl.rb +2 -0
- data/lib/nanoc/checking/issue.rb +2 -0
- data/lib/nanoc/checking/runner.rb +2 -0
- data/lib/nanoc/cli.rb +2 -0
- data/lib/nanoc/cli/ansi_string_colorizer.rb +2 -0
- data/lib/nanoc/cli/cleaning_stream.rb +2 -0
- data/lib/nanoc/cli/command_runner.rb +2 -0
- data/lib/nanoc/cli/commands/check.rb +2 -0
- data/lib/nanoc/cli/commands/compile.rb +4 -2
- data/lib/nanoc/cli/commands/compile_listeners/abstract.rb +2 -0
- data/lib/nanoc/cli/commands/compile_listeners/debug_printer.rb +2 -0
- data/lib/nanoc/cli/commands/compile_listeners/diff_generator.rb +2 -0
- data/lib/nanoc/cli/commands/compile_listeners/file_action_printer.rb +2 -0
- data/lib/nanoc/cli/commands/compile_listeners/stack_prof_profiler.rb +3 -1
- data/lib/nanoc/cli/commands/compile_listeners/timing_recorder.rb +4 -14
- data/lib/nanoc/cli/commands/create-site.rb +229 -227
- data/lib/nanoc/cli/commands/deploy.rb +2 -0
- data/lib/nanoc/cli/commands/nanoc.rb +2 -0
- data/lib/nanoc/cli/commands/prune.rb +8 -6
- data/lib/nanoc/cli/commands/shell.rb +2 -0
- data/lib/nanoc/cli/commands/show-data.rb +6 -4
- data/lib/nanoc/cli/commands/show-plugins.rb +6 -4
- data/lib/nanoc/cli/commands/show-rules.rb +2 -0
- data/lib/nanoc/cli/commands/view.rb +6 -4
- data/lib/nanoc/cli/error_handler.rb +2 -0
- data/lib/nanoc/cli/logger.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/abstract.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/ansi_colors.rb +2 -0
- data/lib/nanoc/cli/stream_cleaners/utf8.rb +6 -1
- data/lib/nanoc/data_sources.rb +2 -0
- data/lib/nanoc/data_sources/filesystem.rb +2 -0
- data/lib/nanoc/data_sources/filesystem/errors.rb +2 -0
- data/lib/nanoc/data_sources/filesystem/tools.rb +2 -0
- data/lib/nanoc/deploying.rb +2 -0
- data/lib/nanoc/deploying/deployer.rb +2 -0
- data/lib/nanoc/deploying/deployers.rb +2 -0
- data/lib/nanoc/deploying/deployers/fog.rb +2 -0
- data/lib/nanoc/deploying/deployers/git.rb +2 -0
- data/lib/nanoc/deploying/deployers/rsync.rb +2 -0
- data/lib/nanoc/extra.rb +2 -0
- data/lib/nanoc/extra/core_ext.rb +2 -0
- data/lib/nanoc/extra/core_ext/pathname.rb +2 -0
- data/lib/nanoc/extra/core_ext/time.rb +2 -0
- data/lib/nanoc/extra/jruby_nokogiri_warner.rb +14 -12
- data/lib/nanoc/extra/link_collector.rb +2 -0
- data/lib/nanoc/extra/parallel_collection.rb +2 -0
- data/lib/nanoc/extra/piper.rb +2 -0
- data/lib/nanoc/filters.rb +2 -0
- data/lib/nanoc/filters/asciidoc.rb +2 -0
- data/lib/nanoc/filters/bluecloth.rb +2 -0
- data/lib/nanoc/filters/coffeescript.rb +2 -0
- data/lib/nanoc/filters/colorize_syntax.rb +3 -1
- data/lib/nanoc/filters/colorize_syntax/colorizers.rb +2 -0
- data/lib/nanoc/filters/erb.rb +2 -0
- data/lib/nanoc/filters/erubi.rb +2 -0
- data/lib/nanoc/filters/erubis.rb +2 -0
- data/lib/nanoc/filters/haml.rb +2 -0
- data/lib/nanoc/filters/handlebars.rb +2 -0
- data/lib/nanoc/filters/kramdown.rb +2 -0
- data/lib/nanoc/filters/less.rb +2 -0
- data/lib/nanoc/filters/markaby.rb +2 -0
- data/lib/nanoc/filters/maruku.rb +2 -0
- data/lib/nanoc/filters/mustache.rb +2 -0
- data/lib/nanoc/filters/pandoc.rb +2 -0
- data/lib/nanoc/filters/rainpress.rb +2 -0
- data/lib/nanoc/filters/rdiscount.rb +2 -0
- data/lib/nanoc/filters/rdoc.rb +2 -0
- data/lib/nanoc/filters/redcarpet.rb +2 -0
- data/lib/nanoc/filters/redcloth.rb +2 -0
- data/lib/nanoc/filters/relativize_paths.rb +8 -7
- data/lib/nanoc/filters/rubypants.rb +2 -0
- data/lib/nanoc/filters/sass.rb +2 -0
- data/lib/nanoc/filters/sass/sass_filesystem_importer.rb +2 -0
- data/lib/nanoc/filters/slim.rb +3 -1
- data/lib/nanoc/filters/typogruby.rb +2 -0
- data/lib/nanoc/filters/uglify_js.rb +2 -0
- data/lib/nanoc/filters/xsl.rb +2 -0
- data/lib/nanoc/filters/yui_compressor.rb +2 -0
- data/lib/nanoc/helpers.rb +2 -0
- data/lib/nanoc/helpers/blogging.rb +3 -1
- data/lib/nanoc/helpers/breadcrumbs.rb +2 -0
- data/lib/nanoc/helpers/capturing.rb +4 -2
- data/lib/nanoc/helpers/child_parent.rb +2 -0
- data/lib/nanoc/helpers/filtering.rb +2 -0
- data/lib/nanoc/helpers/html_escape.rb +2 -0
- data/lib/nanoc/helpers/link_to.rb +2 -0
- data/lib/nanoc/helpers/rendering.rb +2 -0
- data/lib/nanoc/helpers/tagging.rb +2 -0
- data/lib/nanoc/helpers/text.rb +2 -0
- data/lib/nanoc/helpers/xml_sitemap.rb +3 -1
- data/lib/nanoc/rule_dsl.rb +2 -0
- data/lib/nanoc/rule_dsl/action_provider.rb +2 -0
- data/lib/nanoc/rule_dsl/action_sequence_calculator.rb +2 -0
- data/lib/nanoc/rule_dsl/compiler_dsl.rb +4 -1
- data/lib/nanoc/rule_dsl/recording_executor.rb +2 -0
- data/lib/nanoc/rule_dsl/rule.rb +2 -0
- data/lib/nanoc/rule_dsl/rule_context.rb +2 -0
- data/lib/nanoc/rule_dsl/rules_collection.rb +2 -0
- data/lib/nanoc/rule_dsl/rules_loader.rb +2 -0
- data/lib/nanoc/spec.rb +3 -1
- data/lib/nanoc/telemetry.rb +4 -0
- data/lib/nanoc/telemetry/counter.rb +2 -0
- data/lib/nanoc/telemetry/labelled_counter.rb +2 -0
- data/lib/nanoc/telemetry/labelled_summary.rb +2 -0
- data/lib/nanoc/telemetry/registry.rb +2 -0
- data/lib/nanoc/telemetry/stopwatch.rb +2 -0
- data/lib/nanoc/telemetry/summary.rb +2 -0
- data/lib/nanoc/telemetry/table.rb +35 -0
- data/lib/nanoc/version.rb +3 -1
- data/nanoc.gemspec +2 -0
- data/spec/contributors_spec.rb +2 -0
- data/spec/nanoc/base/checksummer_spec.rb +2 -0
- data/spec/nanoc/base/compiler_spec.rb +2 -0
- data/spec/nanoc/base/directed_graph_spec.rb +2 -0
- data/spec/nanoc/base/entities/action_sequence_spec.rb +2 -0
- data/spec/nanoc/base/entities/code_snippet_spec.rb +51 -0
- data/spec/nanoc/base/entities/configuration_spec.rb +15 -0
- data/spec/nanoc/base/entities/content_spec.rb +2 -0
- data/spec/nanoc/base/entities/document_spec.rb +2 -0
- data/spec/nanoc/base/entities/identifiable_collection_spec.rb +2 -0
- data/spec/nanoc/base/entities/identifier_spec.rb +2 -0
- data/spec/nanoc/base/entities/item_rep_spec.rb +2 -0
- data/spec/nanoc/base/entities/item_spec.rb +2 -0
- data/spec/nanoc/base/entities/layout_spec.rb +2 -0
- data/spec/nanoc/base/entities/lazy_value_spec.rb +3 -1
- data/spec/nanoc/base/entities/outdatedness_status_spec.rb +2 -0
- data/spec/nanoc/base/entities/pattern_spec.rb +2 -0
- data/spec/nanoc/base/entities/processing_action_spec.rb +2 -0
- data/spec/nanoc/base/entities/processing_actions/filter_spec.rb +2 -0
- data/spec/nanoc/base/entities/processing_actions/layout_spec.rb +2 -0
- data/spec/nanoc/base/entities/processing_actions/snapshot_spec.rb +2 -0
- data/spec/nanoc/base/entities/props_spec.rb +2 -0
- data/spec/nanoc/base/entities/site_spec.rb +2 -0
- data/spec/nanoc/base/errors/dependency_cycle_spec.rb +8 -6
- data/spec/nanoc/base/feature_spec.rb +4 -2
- data/spec/nanoc/base/filter_spec.rb +2 -0
- data/spec/nanoc/base/item_rep_writer_spec.rb +2 -0
- data/spec/nanoc/base/memoization_spec.rb +2 -0
- data/spec/nanoc/base/repos/checksum_store_spec.rb +2 -0
- data/spec/nanoc/base/repos/compiled_content_cache_spec.rb +2 -0
- data/spec/nanoc/base/repos/config_loader_spec.rb +2 -0
- data/spec/nanoc/base/repos/dependency_store_spec.rb +2 -0
- data/spec/nanoc/base/repos/outdatedness_store_spec.rb +2 -0
- data/spec/nanoc/base/repos/site_loader_spec.rb +2 -0
- data/spec/nanoc/base/repos/snapshot_repo_spec.rb +2 -0
- data/spec/nanoc/base/repos/store_spec.rb +2 -0
- data/spec/nanoc/base/services/compiler/phases/abstract_spec.rb +2 -0
- data/spec/nanoc/base/services/compiler/phases/cache_spec.rb +2 -0
- data/spec/nanoc/base/services/compiler/stages/calculate_checksums_spec.rb +2 -0
- data/spec/nanoc/base/services/compiler/stages/cleanup_spec.rb +2 -0
- data/spec/nanoc/base/services/compiler/stages/compile_reps_spec.rb +2 -0
- data/spec/nanoc/base/services/dependency_tracker_spec.rb +2 -0
- data/spec/nanoc/base/services/executor_spec.rb +2 -0
- data/spec/nanoc/base/services/item_rep_router_spec.rb +2 -0
- data/spec/nanoc/base/services/item_rep_selector_spec.rb +2 -0
- data/spec/nanoc/base/services/outdatedness_checker_spec.rb +2 -0
- data/spec/nanoc/base/services/outdatedness_rules_spec.rb +2 -0
- data/spec/nanoc/base/services/pruner_spec.rb +2 -0
- data/spec/nanoc/base/services/temp_filename_factory_spec.rb +2 -0
- data/spec/nanoc/base/views/config_view_spec.rb +2 -0
- data/spec/nanoc/base/views/document_view_spec.rb +2 -0
- data/spec/nanoc/base/views/identifiable_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/item_collection_with_reps_view_spec.rb +2 -0
- data/spec/nanoc/base/views/item_collection_without_reps_view_spec.rb +2 -0
- data/spec/nanoc/base/views/item_rep_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/item_rep_view_spec.rb +2 -0
- data/spec/nanoc/base/views/item_view_spec.rb +2 -0
- data/spec/nanoc/base/views/layout_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/layout_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_config_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_document_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_identifiable_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_item_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_item_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_layout_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/mutable_layout_view_spec.rb +2 -0
- data/spec/nanoc/base/views/post_compile_item_rep_collection_view_spec.rb +2 -0
- data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +2 -0
- data/spec/nanoc/base/views/post_compile_item_view_spec.rb +2 -0
- data/spec/nanoc/cli/commands/compile/diff_generator_spec.rb +2 -0
- data/spec/nanoc/cli/commands/compile/file_action_printer_spec.rb +2 -0
- data/spec/nanoc/cli/commands/compile/timing_recorder_spec.rb +2 -0
- data/spec/nanoc/cli/commands/compile_spec.rb +2 -0
- data/spec/nanoc/cli/commands/deploy_spec.rb +2 -0
- data/spec/nanoc/cli/commands/shell_spec.rb +8 -0
- data/spec/nanoc/cli/commands/show_data_spec.rb +2 -0
- data/spec/nanoc/cli/commands/show_plugins_spec.rb +2 -0
- data/spec/nanoc/cli/commands/show_rules_spec.rb +2 -0
- data/spec/nanoc/cli/commands/view_spec.rb +2 -0
- data/spec/nanoc/cli/stream_cleaners/utf8_spec.rb +2 -0
- data/spec/nanoc/data_sources/filesystem_spec.rb +2 -0
- data/spec/nanoc/deploying/fog_spec.rb +2 -0
- data/spec/nanoc/deploying/git_spec.rb +5 -2
- data/spec/nanoc/extra/parallel_collection_spec.rb +2 -0
- data/spec/nanoc/filters/colorize_syntax/rouge_spec.rb +61 -59
- data/spec/nanoc/filters/less_spec.rb +2 -0
- data/spec/nanoc/helpers/blogging_spec.rb +2 -0
- data/spec/nanoc/helpers/breadcrumbs_spec.rb +2 -0
- data/spec/nanoc/helpers/capturing_spec.rb +6 -4
- data/spec/nanoc/helpers/child_parent_spec.rb +2 -0
- data/spec/nanoc/helpers/filtering_spec.rb +2 -0
- data/spec/nanoc/helpers/html_escape_spec.rb +3 -1
- data/spec/nanoc/helpers/link_to_spec.rb +2 -0
- data/spec/nanoc/helpers/rendering_spec.rb +2 -0
- data/spec/nanoc/helpers/tagging_spec.rb +2 -0
- data/spec/nanoc/helpers/text_spec.rb +2 -0
- data/spec/nanoc/integration/compile_command_spec.rb +6 -4
- data/spec/nanoc/integration/outdatedness_integration_spec.rb +36 -34
- data/spec/nanoc/integration/partial_recompilation_spec.rb +10 -8
- data/spec/nanoc/regressions/gh_1015_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1022_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1031_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1035_spec.rb +10 -8
- data/spec/nanoc/regressions/gh_1037a_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1037b_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1040_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1045_spec.rb +14 -12
- data/spec/nanoc/regressions/gh_1047_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1064_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1067_spec.rb +8 -6
- data/spec/nanoc/regressions/gh_1082a_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1082b_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1082c_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1082d_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1093_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1094_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1097_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1100_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1102_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1107_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_1130_spec.rb +8 -6
- data/spec/nanoc/regressions/gh_1134_spec.rb +8 -6
- data/spec/nanoc/regressions/gh_1145_spec.rb +7 -5
- data/spec/nanoc/regressions/gh_1171_spec.rb +17 -15
- data/spec/nanoc/regressions/gh_761_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_767_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_769_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_776_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_787_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_795_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_804_spec.rb +7 -5
- data/spec/nanoc/regressions/gh_807_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_809_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_813_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_815_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_828_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_833_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_841_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_867_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_882_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_885_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_891_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_913_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_924_spec.rb +58 -56
- data/spec/nanoc/regressions/gh_928_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_937_spec.rb +7 -5
- data/spec/nanoc/regressions/gh_942_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_947_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_948_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_951_spec.rb +2 -0
- data/spec/nanoc/regressions/gh_954_spec.rb +14 -12
- data/spec/nanoc/regressions/gh_970a_spec.rb +6 -4
- data/spec/nanoc/regressions/gh_970b_spec.rb +10 -8
- data/spec/nanoc/regressions/gh_974_spec.rb +6 -4
- data/spec/nanoc/regressions/gh_981_spec.rb +2 -0
- data/spec/nanoc/rule_dsl/action_sequence_calculator_spec.rb +2 -0
- data/spec/nanoc/rule_dsl/recording_executor_spec.rb +2 -0
- data/spec/nanoc/rule_dsl/rule_context_spec.rb +2 -0
- data/spec/nanoc/rule_dsl/rules_collection_spec.rb +2 -0
- data/spec/nanoc/spec_spec.rb +2 -0
- data/spec/nanoc/telemetry/counter_spec.rb +2 -0
- data/spec/nanoc/telemetry/labelled_counter_spec.rb +2 -0
- data/spec/nanoc/telemetry/labelled_summary_spec.rb +2 -0
- data/spec/nanoc/telemetry/stopwatch_spec.rb +2 -0
- data/spec/nanoc/telemetry/summary_spec.rb +2 -0
- data/spec/nanoc/telemetry_spec.rb +2 -0
- data/spec/regression_filenames_spec.rb +3 -1
- data/spec/spec_helper.rb +2 -0
- data/test/base/core_ext/array_spec.rb +2 -0
- data/test/base/core_ext/hash_spec.rb +2 -0
- data/test/base/core_ext/string_spec.rb +2 -0
- data/test/base/test_code_snippet.rb +2 -0
- data/test/base/test_compiler.rb +2 -0
- data/test/base/test_context.rb +2 -0
- data/test/base/test_data_source.rb +2 -0
- data/test/base/test_dependency_tracker.rb +2 -0
- data/test/base/test_directed_graph.rb +2 -0
- data/test/base/test_filter.rb +2 -0
- data/test/base/test_item.rb +2 -0
- data/test/base/test_item_array.rb +2 -0
- data/test/base/test_layout.rb +2 -0
- data/test/base/test_notification_center.rb +2 -0
- data/test/base/test_site.rb +17 -15
- data/test/base/test_store.rb +2 -0
- data/test/checking/checks/test_css.rb +2 -0
- data/test/checking/checks/test_external_links.rb +2 -0
- data/test/checking/checks/test_html.rb +2 -0
- data/test/checking/checks/test_internal_links.rb +2 -0
- data/test/checking/checks/test_mixed_content.rb +2 -0
- data/test/checking/checks/test_stale.rb +2 -0
- data/test/checking/test_check.rb +2 -0
- data/test/checking/test_dsl.rb +2 -0
- data/test/checking/test_runner.rb +2 -0
- data/test/cli/commands/test_check.rb +2 -0
- data/test/cli/commands/test_compile.rb +2 -0
- data/test/cli/commands/test_create_site.rb +2 -0
- data/test/cli/commands/test_help.rb +2 -0
- data/test/cli/commands/test_info.rb +2 -0
- data/test/cli/commands/test_prune.rb +2 -0
- data/test/cli/test_cleaning_stream.rb +2 -0
- data/test/cli/test_cli.rb +16 -14
- data/test/cli/test_error_handler.rb +2 -0
- data/test/cli/test_logger.rb +2 -0
- data/test/data_sources/test_filesystem.rb +2 -0
- data/test/data_sources/test_filesystem_tools.rb +2 -0
- data/test/deploying/test_fog.rb +2 -0
- data/test/deploying/test_git.rb +33 -31
- data/test/deploying/test_rsync.rb +2 -0
- data/test/extra/core_ext/test_pathname.rb +2 -0
- data/test/extra/core_ext/test_time.rb +2 -0
- data/test/extra/test_link_collector.rb +2 -0
- data/test/extra/test_piper.rb +2 -0
- data/test/filters/colorize_syntax/test_coderay.rb +43 -41
- data/test/filters/colorize_syntax/test_common.rb +24 -22
- data/test/filters/colorize_syntax/test_pygmentize.rb +2 -0
- data/test/filters/colorize_syntax/test_pygments.rb +2 -0
- data/test/filters/colorize_syntax/test_simon.rb +2 -0
- data/test/filters/test_asciidoc.rb +2 -0
- data/test/filters/test_bluecloth.rb +2 -0
- data/test/filters/test_coffeescript.rb +2 -0
- data/test/filters/test_erb.rb +2 -0
- data/test/filters/test_erubi.rb +2 -0
- data/test/filters/test_erubis.rb +2 -0
- data/test/filters/test_haml.rb +2 -0
- data/test/filters/test_handlebars.rb +2 -0
- data/test/filters/test_kramdown.rb +2 -0
- data/test/filters/test_markaby.rb +2 -0
- data/test/filters/test_maruku.rb +2 -0
- data/test/filters/test_mustache.rb +2 -0
- data/test/filters/test_pandoc.rb +2 -0
- data/test/filters/test_rainpress.rb +2 -0
- data/test/filters/test_rdiscount.rb +2 -0
- data/test/filters/test_rdoc.rb +2 -0
- data/test/filters/test_redcarpet.rb +2 -0
- data/test/filters/test_redcloth.rb +2 -0
- data/test/filters/test_relativize_paths.rb +52 -50
- data/test/filters/test_rubypants.rb +2 -0
- data/test/filters/test_sass.rb +2 -0
- data/test/filters/test_slim.rb +26 -0
- data/test/filters/test_typogruby.rb +2 -0
- data/test/filters/test_uglify_js.rb +2 -0
- data/test/filters/test_xsl.rb +64 -62
- data/test/filters/test_yui_compressor.rb +2 -0
- data/test/helper.rb +20 -13
- data/test/helpers/test_blogging.rb +2 -0
- data/test/helpers/test_capturing.rb +12 -10
- data/test/helpers/test_link_to.rb +2 -0
- data/test/helpers/test_xml_sitemap.rb +2 -0
- data/test/rule_dsl/test_action_provider.rb +2 -0
- data/test/rule_dsl/test_compiler_dsl.rb +42 -40
- data/test/rule_dsl/test_rule.rb +2 -0
- data/test/rule_dsl/test_rules_collection.rb +2 -0
- data/test/test_gem.rb +2 -0
- metadata +5 -3
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'helper'
|
2
4
|
|
3
5
|
class Nanoc::Filters::ColorizeSyntax::CommonTest < Nanoc::TestCase
|
@@ -18,7 +20,7 @@ class Nanoc::Filters::ColorizeSyntax::CommonTest < Nanoc::TestCase
|
|
18
20
|
|
19
21
|
def test_with_frozen_input
|
20
22
|
if_have 'nokogiri' do
|
21
|
-
input = '<pre title="moo"><code class="language-ruby"># comment</code></pre>'
|
23
|
+
input = '<pre title="moo"><code class="language-ruby"># comment</code></pre>'
|
22
24
|
input.freeze
|
23
25
|
|
24
26
|
filter = ::Nanoc::Filters::ColorizeSyntax.new
|
@@ -32,16 +34,16 @@ class Nanoc::Filters::ColorizeSyntax::CommonTest < Nanoc::TestCase
|
|
32
34
|
filter = ::Nanoc::Filters::ColorizeSyntax.new
|
33
35
|
|
34
36
|
# Get input and expected output
|
35
|
-
input =
|
36
|
-
<!DOCTYPE html>
|
37
|
-
<html>
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
</html>
|
37
|
+
input = <<~EOS
|
38
|
+
<!DOCTYPE html>
|
39
|
+
<html>
|
40
|
+
<head>
|
41
|
+
<title>Foo</title>
|
42
|
+
</head>
|
43
|
+
<body>
|
44
|
+
<pre title="moo"><code class="language-ruby"># comment</code></pre>
|
45
|
+
</body>
|
46
|
+
</html>
|
45
47
|
EOS
|
46
48
|
expected_output_regex = %r{^<!DOCTYPE html>\s*<html>\s*<head>\s*<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\s*<title>Foo</title>\s*</head>\s*<body>\s*<pre title="moo"><code class="language-ruby"># comment</code></pre>\s*</body>\s*</html>}
|
47
49
|
|
@@ -56,17 +58,17 @@ EOS
|
|
56
58
|
filter = ::Nanoc::Filters::ColorizeSyntax.new
|
57
59
|
|
58
60
|
# Get input and expected output
|
59
|
-
input =
|
60
|
-
<!DOCTYPE html>
|
61
|
-
<html>
|
62
|
-
<head>
|
63
|
-
|
64
|
-
|
65
|
-
</head>
|
66
|
-
<body>
|
67
|
-
|
68
|
-
</body>
|
69
|
-
</html>
|
61
|
+
input = <<~EOS
|
62
|
+
<!DOCTYPE html>
|
63
|
+
<html>
|
64
|
+
<head>
|
65
|
+
<meta charset="utf-8">
|
66
|
+
<title>Foo</title>
|
67
|
+
</head>
|
68
|
+
<body>
|
69
|
+
<pre title="moo"><code class="language-ruby"># comment</code></pre>
|
70
|
+
</body>
|
71
|
+
</html>
|
70
72
|
EOS
|
71
73
|
expected_output_regex = %r{^<!DOCTYPE html>\s*<html>\s*<head>\s*<meta charset="utf-8">\s*<title>Foo</title>\s*</head>\s*<body>\s*<pre title="moo"><code class="language-ruby"># comment</code></pre>\s*</body>\s*</html>}
|
72
74
|
|
data/test/filters/test_erb.rb
CHANGED
data/test/filters/test_erubi.rb
CHANGED
data/test/filters/test_erubis.rb
CHANGED
data/test/filters/test_haml.rb
CHANGED
data/test/filters/test_maruku.rb
CHANGED
data/test/filters/test_pandoc.rb
CHANGED
data/test/filters/test_rdoc.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'helper'
|
2
4
|
|
3
5
|
class Nanoc::Filters::RelativizePathsTest < Nanoc::TestCase
|
@@ -97,16 +99,16 @@ class Nanoc::Filters::RelativizePathsTest < Nanoc::TestCase
|
|
97
99
|
end
|
98
100
|
|
99
101
|
# Set content
|
100
|
-
raw_content =
|
101
|
-
<!DOCTYPE html>
|
102
|
-
<html>
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
</html>
|
102
|
+
raw_content = <<~EOS
|
103
|
+
<!DOCTYPE html>
|
104
|
+
<html>
|
105
|
+
<head>
|
106
|
+
<title>Hello</title>
|
107
|
+
</head>
|
108
|
+
<body>
|
109
|
+
<a href=/foo>foo</a>
|
110
|
+
</body>
|
111
|
+
</html>
|
110
112
|
EOS
|
111
113
|
expected0 = %r{<a href="\.\./\.\.">foo</a>}
|
112
114
|
expected1 = %r{\A\s*<!DOCTYPE html\s*>\s*<html>\s*<head>(.|\s)*<title>Hello</title>\s*</head>\s*<body>\s*<a href="../..">foo</a>\s*</body>\s*</html>\s*\Z}m
|
@@ -135,16 +137,16 @@ EOS
|
|
135
137
|
end
|
136
138
|
|
137
139
|
# Set content
|
138
|
-
raw_content =
|
139
|
-
<!DOCTYPE html>
|
140
|
-
<html>
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
</html>
|
140
|
+
raw_content = <<~EOS
|
141
|
+
<!DOCTYPE html>
|
142
|
+
<html>
|
143
|
+
<head>
|
144
|
+
<title>Hello</title>
|
145
|
+
</head>
|
146
|
+
<body>
|
147
|
+
<a href=/foo>foo</a>
|
148
|
+
</body>
|
149
|
+
</html>
|
148
150
|
EOS
|
149
151
|
expected0 = %r{<a href="\.\./\.\.">foo</a>}
|
150
152
|
expected1 = %r{\A\s*<!DOCTYPE html\s*>\s*<html>\s*<head>\s*<title>Hello</title>\s*</head>\s*<body>\s*<a href="../..">foo</a>\s*</body>\s*</html>\s*\Z}m
|
@@ -602,11 +604,11 @@ EOS
|
|
602
604
|
|
603
605
|
# Set content
|
604
606
|
expected = /<bar boo="\.\.\/\.\.">baz<\/bar>/
|
605
|
-
raw_content =
|
606
|
-
<?xml version="1.0" encoding="utf-8"?>
|
607
|
-
<foo>
|
608
|
-
|
609
|
-
</foo>
|
607
|
+
raw_content = <<~XML
|
608
|
+
<?xml version="1.0" encoding="utf-8"?>
|
609
|
+
<foo>
|
610
|
+
<bar boo="/foo">baz</bar>
|
611
|
+
</foo>
|
610
612
|
XML
|
611
613
|
|
612
614
|
actual_content = filter.setup_and_run(raw_content, type: :xml, select: ['*/@boo'])
|
@@ -634,10 +636,10 @@ XML
|
|
634
636
|
end
|
635
637
|
|
636
638
|
# Set content
|
637
|
-
raw_content =
|
638
|
-
<foo>
|
639
|
-
|
640
|
-
</foo>
|
639
|
+
raw_content = <<~XML
|
640
|
+
<foo>
|
641
|
+
<bar><far href="/foo">baz</far></bar>
|
642
|
+
</foo>
|
641
643
|
XML
|
642
644
|
|
643
645
|
actual_content = filter.setup_and_run(raw_content, type: :xml, select: ['far/@href'])
|
@@ -666,10 +668,10 @@ XML
|
|
666
668
|
end
|
667
669
|
|
668
670
|
# Set content
|
669
|
-
raw_content =
|
670
|
-
<foo xmlns="http://example.org">
|
671
|
-
|
672
|
-
</foo>
|
671
|
+
raw_content = <<~XML
|
672
|
+
<foo xmlns="http://example.org">
|
673
|
+
<bar><a href="/foo">baz</a></bar>
|
674
|
+
</foo>
|
673
675
|
XML
|
674
676
|
|
675
677
|
options = {
|
@@ -703,18 +705,18 @@ XML
|
|
703
705
|
end
|
704
706
|
|
705
707
|
# Set content
|
706
|
-
raw_content =
|
707
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
708
|
-
<html xmlns="http://www.w3.org/1999/xhtml">
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
</html>
|
708
|
+
raw_content = <<~XML
|
709
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
710
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
711
|
+
<head>
|
712
|
+
<link rel="stylesheet" href="/css"/>
|
713
|
+
<script src="/js"></script>
|
714
|
+
</head>
|
715
|
+
<body>
|
716
|
+
<a href="/foo">bar</a>
|
717
|
+
<img src="/img"/>
|
718
|
+
</body>
|
719
|
+
</html>
|
718
720
|
XML
|
719
721
|
|
720
722
|
actual_content = filter.setup_and_run(raw_content, type: :xhtml)
|
@@ -745,11 +747,11 @@ XML
|
|
745
747
|
end
|
746
748
|
|
747
749
|
# Set content
|
748
|
-
raw_content =
|
749
|
-
<a href="/foo">bar</a>
|
750
|
-
<p>
|
751
|
-
|
752
|
-
</p>
|
750
|
+
raw_content = <<~XML
|
751
|
+
<a href="/foo">bar</a>
|
752
|
+
<p>
|
753
|
+
<img src="/img"/>
|
754
|
+
</p>
|
753
755
|
XML
|
754
756
|
|
755
757
|
expected_content =
|
data/test/filters/test_sass.rb
CHANGED
data/test/filters/test_slim.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'helper'
|
2
4
|
|
3
5
|
class Nanoc::Filters::SlimTest < Nanoc::TestCase
|
@@ -28,4 +30,28 @@ class Nanoc::Filters::SlimTest < Nanoc::TestCase
|
|
28
30
|
assert_equal('<p>The rabbit is on the branch.</p>', result)
|
29
31
|
end
|
30
32
|
end
|
33
|
+
|
34
|
+
def new_view_context
|
35
|
+
Nanoc::ViewContext.new(
|
36
|
+
reps: :__irrelevat_reps,
|
37
|
+
items: :__irrelevat_items,
|
38
|
+
dependency_tracker: :__irrelevant_dependency_tracker,
|
39
|
+
compilation_context: :__irrelevat_compiler,
|
40
|
+
snapshot_repo: :__irrelevant_snapshot_repo,
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_filter_slim_reports_filename
|
45
|
+
if_have 'slim' do
|
46
|
+
layout = Nanoc::Int::Layout.new('', {}, '/layout.slim')
|
47
|
+
layout = Nanoc::LayoutView.new(layout, new_view_context)
|
48
|
+
|
49
|
+
assigns = { layout: layout }
|
50
|
+
|
51
|
+
filter = ::Nanoc::Filters::Slim.new(assigns)
|
52
|
+
|
53
|
+
error = assert_raises(NameError) { filter.setup_and_run('deliberate=failure') }
|
54
|
+
assert_match(%r{^layout /layout.slim}, error.backtrace[1])
|
55
|
+
end
|
56
|
+
end
|
31
57
|
end
|
data/test/filters/test_xsl.rb
CHANGED
@@ -1,84 +1,86 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'helper'
|
2
4
|
|
3
5
|
require 'tempfile'
|
4
6
|
|
5
7
|
class Nanoc::Filters::XSLTest < Nanoc::TestCase
|
6
|
-
SAMPLE_XSL =
|
7
|
-
<?xml version="1.0" encoding="utf-8"?>
|
8
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</xsl:stylesheet>
|
8
|
+
SAMPLE_XSL = <<~EOS
|
9
|
+
<?xml version="1.0" encoding="utf-8"?>
|
10
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
11
|
+
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
|
12
|
+
<xsl:template match="/">
|
13
|
+
<html>
|
14
|
+
<head>
|
15
|
+
<title><xsl:value-of select="report/title"/></title>
|
16
|
+
</head>
|
17
|
+
<body>
|
18
|
+
<h1><xsl:value-of select="report/title"/></h1>
|
19
|
+
</body>
|
20
|
+
</html>
|
21
|
+
</xsl:template>
|
22
|
+
</xsl:stylesheet>
|
21
23
|
EOS
|
22
24
|
|
23
|
-
SAMPLE_XML_IN =
|
24
|
-
<?xml version="1.0" encoding="utf-8"?>
|
25
|
-
<report>
|
26
|
-
|
27
|
-
</report>
|
25
|
+
SAMPLE_XML_IN = <<~EOS
|
26
|
+
<?xml version="1.0" encoding="utf-8"?>
|
27
|
+
<report>
|
28
|
+
<title>My Report</title>
|
29
|
+
</report>
|
28
30
|
EOS
|
29
31
|
|
30
32
|
SAMPLE_XML_OUT = %r{\A<\?xml version="1.0" encoding="utf-8"\?>\s*<html>\s*<head>\s*<title>My Report</title>\s*</head>\s*<body>\s*<h1>My Report</h1>\s*</body>\s*</html>\s*\Z}m
|
31
33
|
|
32
|
-
SAMPLE_XSL_WITH_PARAMS =
|
33
|
-
<?xml version="1.0" encoding="utf-8"?>
|
34
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
</xsl:stylesheet>
|
34
|
+
SAMPLE_XSL_WITH_PARAMS = <<~EOS
|
35
|
+
<?xml version="1.0" encoding="utf-8"?>
|
36
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
37
|
+
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
|
38
|
+
<xsl:param name="foo"/>
|
39
|
+
<xsl:template match="/">
|
40
|
+
<html>
|
41
|
+
<head>
|
42
|
+
<title><xsl:value-of select="report/title"/></title>
|
43
|
+
</head>
|
44
|
+
<body>
|
45
|
+
<h1><xsl:value-of select="$foo"/></h1>
|
46
|
+
</body>
|
47
|
+
</html>
|
48
|
+
</xsl:template>
|
49
|
+
</xsl:stylesheet>
|
48
50
|
EOS
|
49
51
|
|
50
|
-
SAMPLE_XML_IN_WITH_PARAMS =
|
51
|
-
<?xml version="1.0" encoding="utf-8"?>
|
52
|
-
<report>
|
53
|
-
|
54
|
-
</report>
|
52
|
+
SAMPLE_XML_IN_WITH_PARAMS = <<~EOS
|
53
|
+
<?xml version="1.0" encoding="utf-8"?>
|
54
|
+
<report>
|
55
|
+
<title>My Report</title>
|
56
|
+
</report>
|
55
57
|
EOS
|
56
58
|
|
57
59
|
SAMPLE_XML_OUT_WITH_PARAMS = %r{\A<\?xml version="1.0" encoding="utf-8"\?>\s*<html>\s*<head>\s*<title>My Report</title>\s*</head>\s*<body>\s*<h1>bar</h1>\s*</body>\s*</html>\s*\Z}m
|
58
60
|
|
59
|
-
SAMPLE_XSL_WITH_OMIT_XML_DECL =
|
60
|
-
<?xml version="1.0" encoding="utf-8"?>
|
61
|
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
</xsl:stylesheet>
|
61
|
+
SAMPLE_XSL_WITH_OMIT_XML_DECL = <<~EOS
|
62
|
+
<?xml version="1.0" encoding="utf-8"?>
|
63
|
+
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
64
|
+
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"
|
65
|
+
omit-xml-declaration="yes"/>
|
66
|
+
<xsl:template match="/">
|
67
|
+
<html>
|
68
|
+
<head>
|
69
|
+
<title><xsl:value-of select="report/title"/></title>
|
70
|
+
</head>
|
71
|
+
<body>
|
72
|
+
<h1><xsl:value-of select="report/title"/></h1>
|
73
|
+
</body>
|
74
|
+
</html>
|
75
|
+
</xsl:template>
|
76
|
+
</xsl:stylesheet>
|
75
77
|
EOS
|
76
78
|
|
77
|
-
SAMPLE_XML_IN_WITH_OMIT_XML_DECL =
|
78
|
-
<?xml version="1.0" encoding="utf-8"?>
|
79
|
-
<report>
|
80
|
-
|
81
|
-
</report>
|
79
|
+
SAMPLE_XML_IN_WITH_OMIT_XML_DECL = <<~EOS
|
80
|
+
<?xml version="1.0" encoding="utf-8"?>
|
81
|
+
<report>
|
82
|
+
<title>My Report</title>
|
83
|
+
</report>
|
82
84
|
EOS
|
83
85
|
|
84
86
|
SAMPLE_XML_OUT_WITH_OMIT_XML_DECL = %r{\A<html>\s*<head>\s*<title>My Report</title>\s*</head>\s*<body>\s*<h1>My Report</h1>\s*</body>\s*</html>\s*\Z}m
|