herb 0.9.7-arm-linux-gnu → 0.10.1-arm-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/config/action_view_helpers/actioncable/action_cable_helper/action_cable_meta_tag.yml +20 -0
- data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy?.yml +16 -0
- data/config/action_view_helpers/actionpack/content_security_policy/content_security_policy_nonce.yml +16 -0
- data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_path.yml +27 -0
- data/config/action_view_helpers/actionpack/polymorphic_routes/polymorphic_url.yml +33 -0
- data/config/action_view_helpers/actionpack/request_forgery_protection/form_authenticity_token.yml +19 -0
- data/config/action_view_helpers/actionpack/request_forgery_protection/protect_against_forgery?.yml +16 -0
- data/config/action_view_helpers/actiontext/content_helper/render_action_text_content.yml +21 -0
- data/config/action_view_helpers/actiontext/content_helper/sanitize_action_text_content.yml +21 -0
- data/config/action_view_helpers/actiontext/tag_helper/rich_textarea_tag.yml +46 -0
- data/config/action_view_helpers/actionview/active_model_helper/error_message.yml +16 -0
- data/config/action_view_helpers/actionview/active_model_helper/error_wrapping.yml +16 -0
- data/config/action_view_helpers/actionview/active_model_helper/object.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/apply_stylesheet_media_default.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/audio_tag.yml +45 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_discovery_link_tag.yml +44 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_scripts.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/auto_include_nonce_for_styles.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/favicon_link_tag.yml +46 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/image_decoding.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/image_loading.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/image_tag.yml +68 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/javascript_include_tag.yml +59 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/picture_tag.yml +29 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/preload_link_tag.yml +50 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/preload_links_header.yml +16 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/stylesheet_link_tag.yml +50 -0
- data/config/action_view_helpers/actionview/asset_tag_helper/video_tag.yml +55 -0
- data/config/action_view_helpers/actionview/asset_url_helper/asset_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/asset_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/audio_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/audio_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_extname.yml +16 -0
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_host.yml +16 -0
- data/config/action_view_helpers/actionview/asset_url_helper/compute_asset_path.yml +16 -0
- data/config/action_view_helpers/actionview/asset_url_helper/font_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/font_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/image_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/image_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/javascript_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/javascript_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/public_compute_asset_path.yml +16 -0
- data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/stylesheet_url.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/video_path.yml +23 -0
- data/config/action_view_helpers/actionview/asset_url_helper/video_url.yml +23 -0
- data/config/action_view_helpers/actionview/atom_feed_helper/atom_feed.yml +40 -0
- data/config/action_view_helpers/actionview/cache_helper/cache.yml +28 -0
- data/config/action_view_helpers/actionview/cache_helper/cache_fragment_name.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/cache_if.yml +27 -0
- data/config/action_view_helpers/actionview/cache_helper/cache_unless.yml +27 -0
- data/config/action_view_helpers/actionview/cache_helper/caching_predicate.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/digest_path_from_template.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/fragment_for.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/fragment_name_with_digest.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/read_fragment_for.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/uncacheable.yml +16 -0
- data/config/action_view_helpers/actionview/cache_helper/write_fragment_for.yml +16 -0
- data/config/action_view_helpers/actionview/capture_helper/capture.yml +16 -0
- data/config/action_view_helpers/actionview/capture_helper/content_for.yml +24 -0
- data/config/action_view_helpers/actionview/capture_helper/content_for_predicate.yml +21 -0
- data/config/action_view_helpers/actionview/capture_helper/provide.yml +21 -0
- data/config/action_view_helpers/actionview/capture_helper/with_output_buffer.yml +16 -0
- data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prepend_content_exfiltration_prevention.yml +16 -0
- data/config/action_view_helpers/actionview/content_exfiltration_prevention_helper/prevent_content_exfiltration.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/action_name.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/assign_controller.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/controller.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/controller_name.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/controller_path.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/cookies.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/flash.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/headers.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/logger.yml +18 -0
- data/config/action_view_helpers/actionview/controller_helper/params.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/request.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/request_forgery_protection_token.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/response.yml +16 -0
- data/config/action_view_helpers/actionview/controller_helper/session.yml +16 -0
- data/config/action_view_helpers/actionview/csp_helper/csp_meta_tag.yml +23 -0
- data/config/action_view_helpers/actionview/csrf_helper/csrf_meta_tags.yml +23 -0
- data/config/action_view_helpers/actionview/date_helper/date_select.yml +71 -0
- data/config/action_view_helpers/actionview/date_helper/datetime_select.yml +59 -0
- data/config/action_view_helpers/actionview/date_helper/distance_of_time_in_words.yml +33 -0
- data/config/action_view_helpers/actionview/date_helper/relative_time_in_words.yml +36 -0
- data/config/action_view_helpers/actionview/date_helper/select_date.yml +49 -0
- data/config/action_view_helpers/actionview/date_helper/select_datetime.yml +58 -0
- data/config/action_view_helpers/actionview/date_helper/select_day.yml +42 -0
- data/config/action_view_helpers/actionview/date_helper/select_hour.yml +48 -0
- data/config/action_view_helpers/actionview/date_helper/select_minute.yml +42 -0
- data/config/action_view_helpers/actionview/date_helper/select_month.yml +54 -0
- data/config/action_view_helpers/actionview/date_helper/select_second.yml +39 -0
- data/config/action_view_helpers/actionview/date_helper/select_time.yml +52 -0
- data/config/action_view_helpers/actionview/date_helper/select_year.yml +45 -0
- data/config/action_view_helpers/actionview/date_helper/time_ago_in_words.yml +26 -0
- data/config/action_view_helpers/actionview/date_helper/time_select.yml +56 -0
- data/config/action_view_helpers/actionview/date_helper/time_tag.yml +37 -0
- data/config/action_view_helpers/actionview/debug_helper/debug.yml +21 -0
- data/config/action_view_helpers/actionview/form_helper/apply_form_for_options.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/button.yml +38 -0
- data/config/action_view_helpers/actionview/form_helper/checkbox.yml +49 -0
- data/config/action_view_helpers/actionview/form_helper/color_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/date_field.yml +38 -0
- data/config/action_view_helpers/actionview/form_helper/datetime_field.yml +43 -0
- data/config/action_view_helpers/actionview/form_helper/email_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/emitted_hidden_id.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/fields.yml +31 -0
- data/config/action_view_helpers/actionview/form_helper/fields_for.yml +33 -0
- data/config/action_view_helpers/actionview/form_helper/file_field.yml +44 -0
- data/config/action_view_helpers/actionview/form_helper/form_for.yml +41 -0
- data/config/action_view_helpers/actionview/form_helper/form_with.yml +42 -0
- data/config/action_view_helpers/actionview/form_helper/form_with_generates_ids.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/form_with_generates_remote_forms.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/hidden_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/label.yml +47 -0
- data/config/action_view_helpers/actionview/form_helper/month_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/multipart.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/multiple_file_field_include_hidden.yml +16 -0
- data/config/action_view_helpers/actionview/form_helper/number_field.yml +44 -0
- data/config/action_view_helpers/actionview/form_helper/password_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/radio_button.yml +37 -0
- data/config/action_view_helpers/actionview/form_helper/range_field.yml +44 -0
- data/config/action_view_helpers/actionview/form_helper/search_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/submit.yml +35 -0
- data/config/action_view_helpers/actionview/form_helper/telephone_field.yml +34 -0
- data/config/action_view_helpers/actionview/form_helper/text_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/textarea.yml +37 -0
- data/config/action_view_helpers/actionview/form_helper/time_field.yml +41 -0
- data/config/action_view_helpers/actionview/form_helper/url_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_helper/week_field.yml +32 -0
- data/config/action_view_helpers/actionview/form_options_helper/collection_checkboxes.yml +58 -0
- data/config/action_view_helpers/actionview/form_options_helper/collection_radio_buttons.yml +56 -0
- data/config/action_view_helpers/actionview/form_options_helper/collection_select.yml +65 -0
- data/config/action_view_helpers/actionview/form_options_helper/grouped_collection_select.yml +69 -0
- data/config/action_view_helpers/actionview/form_options_helper/grouped_options_for_select.yml +39 -0
- data/config/action_view_helpers/actionview/form_options_helper/option_groups_from_collection_for_select.yml +47 -0
- data/config/action_view_helpers/actionview/form_options_helper/options_for_select.yml +27 -0
- data/config/action_view_helpers/actionview/form_options_helper/options_from_collection_for_select.yml +37 -0
- data/config/action_view_helpers/actionview/form_options_helper/select.yml +59 -0
- data/config/action_view_helpers/actionview/form_options_helper/time_zone_options_for_select.yml +34 -0
- data/config/action_view_helpers/actionview/form_options_helper/time_zone_select.yml +53 -0
- data/config/action_view_helpers/actionview/form_options_helper/weekday_options_for_select.yml +31 -0
- data/config/action_view_helpers/actionview/form_options_helper/weekday_select.yml +38 -0
- data/config/action_view_helpers/actionview/form_tag_helper/button_tag.yml +39 -0
- data/config/action_view_helpers/actionview/form_tag_helper/checkbox_tag.yml +45 -0
- data/config/action_view_helpers/actionview/form_tag_helper/color_field_tag.yml +38 -0
- data/config/action_view_helpers/actionview/form_tag_helper/date_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/datetime_field_tag.yml +39 -0
- data/config/action_view_helpers/actionview/form_tag_helper/default_enforce_utf8.yml +16 -0
- data/config/action_view_helpers/actionview/form_tag_helper/email_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/embed_authenticity_token_in_remote_forms.yml +16 -0
- data/config/action_view_helpers/actionview/form_tag_helper/field_id.yml +32 -0
- data/config/action_view_helpers/actionview/form_tag_helper/field_name.yml +32 -0
- data/config/action_view_helpers/actionview/form_tag_helper/field_set_tag.yml +34 -0
- data/config/action_view_helpers/actionview/form_tag_helper/file_field_tag.yml +41 -0
- data/config/action_view_helpers/actionview/form_tag_helper/form_tag.yml +42 -0
- data/config/action_view_helpers/actionview/form_tag_helper/hidden_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/image_submit_tag.yml +40 -0
- data/config/action_view_helpers/actionview/form_tag_helper/label_tag.yml +38 -0
- data/config/action_view_helpers/actionview/form_tag_helper/month_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/number_field_tag.yml +49 -0
- data/config/action_view_helpers/actionview/form_tag_helper/password_field_tag.yml +38 -0
- data/config/action_view_helpers/actionview/form_tag_helper/radio_button_tag.yml +42 -0
- data/config/action_view_helpers/actionview/form_tag_helper/range_field_tag.yml +49 -0
- data/config/action_view_helpers/actionview/form_tag_helper/search_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/select_tag.yml +49 -0
- data/config/action_view_helpers/actionview/form_tag_helper/submit_tag.yml +39 -0
- data/config/action_view_helpers/actionview/form_tag_helper/telephone_field_tag.yml +39 -0
- data/config/action_view_helpers/actionview/form_tag_helper/text_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/textarea_tag.yml +43 -0
- data/config/action_view_helpers/actionview/form_tag_helper/time_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/url_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/form_tag_helper/utf8_enforcer_tag.yml +16 -0
- data/config/action_view_helpers/actionview/form_tag_helper/week_field_tag.yml +37 -0
- data/config/action_view_helpers/actionview/javascript_helper/escape_javascript.yml +23 -0
- data/config/action_view_helpers/actionview/javascript_helper/javascript_cdata_section.yml +16 -0
- data/config/action_view_helpers/actionview/javascript_helper/javascript_tag.yml +45 -0
- data/config/action_view_helpers/actionview/number_helper/number_to_currency.yml +36 -0
- data/config/action_view_helpers/actionview/number_helper/number_to_human.yml +27 -0
- data/config/action_view_helpers/actionview/number_helper/number_to_human_size.yml +24 -0
- data/config/action_view_helpers/actionview/number_helper/number_to_percentage.yml +24 -0
- data/config/action_view_helpers/actionview/number_helper/number_to_phone.yml +34 -0
- data/config/action_view_helpers/actionview/number_helper/number_with_delimiter.yml +29 -0
- data/config/action_view_helpers/actionview/number_helper/number_with_precision.yml +27 -0
- data/config/action_view_helpers/actionview/output_safety_helper/raw.yml +21 -0
- data/config/action_view_helpers/actionview/output_safety_helper/safe_join.yml +26 -0
- data/config/action_view_helpers/actionview/output_safety_helper/to_sentence.yml +33 -0
- data/config/action_view_helpers/actionview/record_identifier/dom_class.yml +27 -0
- data/config/action_view_helpers/actionview/record_identifier/dom_id.yml +27 -0
- data/config/action_view_helpers/actionview/record_identifier/dom_target.yml +22 -0
- data/config/action_view_helpers/actionview/record_identifier/model_name_from_record_or_class.yml +16 -0
- data/config/action_view_helpers/actionview/rendering_helper/render.yml +34 -0
- data/config/action_view_helpers/actionview/sanitize_helper/sanitize.yml +27 -0
- data/config/action_view_helpers/actionview/sanitize_helper/sanitize_css.yml +21 -0
- data/config/action_view_helpers/actionview/sanitize_helper/sanitizer_vendor.yml +16 -0
- data/config/action_view_helpers/actionview/sanitize_helper/strip_links.yml +21 -0
- data/config/action_view_helpers/actionview/sanitize_helper/strip_tags.yml +21 -0
- data/config/action_view_helpers/actionview/tag_helper/cdata_section.yml +21 -0
- data/config/action_view_helpers/actionview/tag_helper/content_tag.yml +64 -0
- data/config/action_view_helpers/actionview/tag_helper/escape_once.yml +21 -0
- data/config/action_view_helpers/actionview/tag_helper/tag.yml +47 -0
- data/config/action_view_helpers/actionview/tag_helper/token_list.yml +24 -0
- data/config/action_view_helpers/actionview/text_helper/concat.yml +21 -0
- data/config/action_view_helpers/actionview/text_helper/current_cycle.yml +22 -0
- data/config/action_view_helpers/actionview/text_helper/cycle.yml +31 -0
- data/config/action_view_helpers/actionview/text_helper/excerpt.yml +39 -0
- data/config/action_view_helpers/actionview/text_helper/highlight.yml +35 -0
- data/config/action_view_helpers/actionview/text_helper/pluralize.yml +32 -0
- data/config/action_view_helpers/actionview/text_helper/reset_cycle.yml +22 -0
- data/config/action_view_helpers/actionview/text_helper/safe_concat.yml +16 -0
- data/config/action_view_helpers/actionview/text_helper/simple_format.yml +40 -0
- data/config/action_view_helpers/actionview/text_helper/truncate.yml +40 -0
- data/config/action_view_helpers/actionview/text_helper/word_wrap.yml +27 -0
- data/config/action_view_helpers/actionview/translation_helper/debug_missing_translation.yml +16 -0
- data/config/action_view_helpers/actionview/translation_helper/localize.yml +29 -0
- data/config/action_view_helpers/actionview/translation_helper/translate.yml +32 -0
- data/config/action_view_helpers/actionview/url_helper/button_to.yml +55 -0
- data/config/action_view_helpers/actionview/url_helper/button_to_generates_button_tag.yml +16 -0
- data/config/action_view_helpers/actionview/url_helper/current_page?.yml +28 -0
- data/config/action_view_helpers/actionview/url_helper/link_to.yml +76 -0
- data/config/action_view_helpers/actionview/url_helper/link_to_if.yml +42 -0
- data/config/action_view_helpers/actionview/url_helper/link_to_unless.yml +42 -0
- data/config/action_view_helpers/actionview/url_helper/link_to_unless_current.yml +37 -0
- data/config/action_view_helpers/actionview/url_helper/mail_to.yml +56 -0
- data/config/action_view_helpers/actionview/url_helper/phone_to.yml +44 -0
- data/config/action_view_helpers/actionview/url_helper/sms_to.yml +47 -0
- data/config/action_view_helpers/actionview/url_helper/url_for.yml +22 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache.yml +16 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_cache_tag.yml +20 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview.yml +16 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_exempts_page_from_preview_tag.yml +20 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload.yml +16 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_page_requires_reload_tag.yml +20 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_method_tag.yml +26 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refresh_scroll_tag.yml +26 -0
- data/config/action_view_helpers/turbo-rails/drive_helper/turbo_refreshes_with.yml +22 -0
- data/config/action_view_helpers/turbo-rails/frames_helper/turbo_frame_tag.yml +50 -0
- data/config/action_view_helpers/turbo-rails/includes_helper/turbo_include_tags.yml +16 -0
- data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_action_tag.yml +34 -0
- data/config/action_view_helpers/turbo-rails/streams_action_helper/turbo_stream_refresh_tag.yml +23 -0
- data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream.yml +16 -0
- data/config/action_view_helpers/turbo-rails/streams_helper/turbo_stream_from.yml +33 -0
- data/config/options.yml +14 -0
- data/config/view_context_methods/actionview/base/annotate_rendered_view_with_filenames.yml +8 -0
- data/config/view_context_methods/actionview/base/assign.yml +8 -0
- data/config/view_context_methods/actionview/base/assigns.yml +8 -0
- data/config/view_context_methods/actionview/base/automatically_disable_submit_tag.yml +8 -0
- data/config/view_context_methods/actionview/base/compiled_method_container.yml +8 -0
- data/config/view_context_methods/actionview/base/config.yml +8 -0
- data/config/view_context_methods/actionview/base/default_form_builder.yml +8 -0
- data/config/view_context_methods/actionview/base/default_formats.yml +8 -0
- data/config/view_context_methods/actionview/base/field_error_proc.yml +8 -0
- data/config/view_context_methods/actionview/base/formats.yml +8 -0
- data/config/view_context_methods/actionview/base/in_rendering_context.yml +8 -0
- data/config/view_context_methods/actionview/base/locale.yml +8 -0
- data/config/view_context_methods/actionview/base/lookup_context.yml +8 -0
- data/config/view_context_methods/actionview/base/output_buffer.yml +8 -0
- data/config/view_context_methods/actionview/base/prefix_partial_path_with_controller_namespace.yml +10 -0
- data/config/view_context_methods/actionview/base/remove_hidden_field_autocomplete.yml +8 -0
- data/config/view_context_methods/actionview/base/streaming_completion_on_exception.yml +8 -0
- data/config/view_context_methods/actionview/base/view_flow.yml +8 -0
- data/config/view_context_methods/actionview/base/view_paths.yml +8 -0
- data/config/view_context_methods/actionview/base/view_renderer.yml +8 -0
- data/config/view_context_methods/actionview/template/local_assigns.yml +8 -0
- data/config/view_context_methods/activemodel/conversion/convert_to_model.yml +8 -0
- data/config/view_context_methods/activesupport/benchmarkable/benchmark.yml +8 -0
- data/ext/herb/extconf.rb +1 -0
- data/ext/herb/extension.c +108 -0
- data/herb.gemspec +2 -1
- data/lib/herb/3.2/herb.so +0 -0
- data/lib/herb/3.3/herb.so +0 -0
- data/lib/herb/3.4/herb.so +0 -0
- data/lib/herb/4.0/herb.so +0 -0
- data/lib/herb/action_view/render_analyzer.rb +1057 -0
- data/lib/herb/ast/erb_render_node.rb +155 -0
- data/lib/herb/bootstrap.rb +0 -1
- data/lib/herb/cli.rb +253 -19
- data/lib/herb/colors.rb +18 -0
- data/lib/herb/configuration.rb +49 -13
- data/lib/herb/defaults.yml +3 -0
- data/lib/herb/dev/runner.rb +445 -0
- data/lib/herb/dev/server.rb +207 -0
- data/lib/herb/dev/server_entry.rb +128 -0
- data/lib/herb/diff_operation.rb +34 -0
- data/lib/herb/diff_result.rb +59 -0
- data/lib/herb/engine/compiler.rb +56 -3
- data/lib/herb/engine/validators/render_validator.rb +92 -0
- data/lib/herb/engine.rb +58 -4
- data/lib/herb/html/util.rb +16 -0
- data/lib/herb/project.rb +1 -6
- data/lib/herb/version.rb +1 -1
- data/lib/herb.rb +41 -5
- data/sig/herb/action_view/render_analyzer.rbs +122 -0
- data/sig/herb/ast/erb_render_node.rbs +29 -0
- data/sig/herb/colors.rbs +12 -0
- data/sig/herb/configuration.rbs +20 -1
- data/sig/herb/dev/runner.rbs +59 -0
- data/sig/herb/dev/server.rbs +50 -0
- data/sig/herb/dev/server_entry.rbs +51 -0
- data/sig/herb/diff_operation.rbs +34 -0
- data/sig/herb/diff_result.rbs +34 -0
- data/sig/herb/engine/compiler.rbs +6 -0
- data/sig/herb/engine/validators/render_validator.rbs +21 -0
- data/sig/herb/engine.rbs +15 -0
- data/sig/herb/html/util.rbs +13 -0
- data/sig/herb.rbs +12 -2
- data/sig/herb_c_extension.rbs +1 -1
- data/sig/vendor/did_you_mean.rbs +6 -0
- data/sig/vendor/parallel.rbs +4 -0
- data/src/analyze/action_view/attribute_extraction_helpers.c +3 -2
- data/src/diff/herb_diff.c +137 -0
- data/src/diff/herb_diff_attributes.c +207 -0
- data/src/diff/herb_diff_children.c +518 -0
- data/src/diff/herb_diff_helpers.c +114 -0
- data/src/diff/herb_diff_nodes.c +707 -0
- data/src/diff/herb_hash.c +42 -0
- data/src/diff/herb_hash_index_map.c +47 -0
- data/src/diff/herb_hash_map.c +104 -0
- data/src/diff/herb_hash_tree.c +680 -0
- data/src/include/diff/herb_diff.h +118 -0
- data/src/include/diff/herb_hash.h +25 -0
- data/src/include/diff/herb_hash_index_map.h +32 -0
- data/src/include/diff/herb_hash_map.h +30 -0
- data/src/include/herb.h +1 -0
- data/src/include/version.h +1 -1
- data/templates/javascript/packages/core/src/config.ts.erb +43 -0
- data/templates/rust/src/ast/nodes.rs.erb +1 -1
- data/templates/rust/src/config.rs.erb +50 -0
- data/templates/src/diff/herb_diff_helpers.c.erb +38 -0
- data/templates/src/diff/herb_diff_nodes.c.erb +224 -0
- data/templates/src/diff/herb_hash_tree.c.erb +147 -0
- data/templates/template.rb +4 -4
- metadata +307 -4
- data/lib/herb/3.0/herb.so +0 -0
- data/lib/herb/3.1/herb.so +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#ifndef HERB_DIFF_H
|
|
2
|
+
#define HERB_DIFF_H
|
|
3
|
+
|
|
4
|
+
#include <stdbool.h>
|
|
5
|
+
#include <stddef.h>
|
|
6
|
+
#include <stdint.h>
|
|
7
|
+
|
|
8
|
+
#include "../ast/ast_nodes.h"
|
|
9
|
+
#include "../lib/hb_allocator.h"
|
|
10
|
+
#include "../lib/hb_array.h"
|
|
11
|
+
#include "herb_hash.h"
|
|
12
|
+
#include "herb_hash_map.h"
|
|
13
|
+
|
|
14
|
+
#define HERB_DIFF_PATH_MAX_DEPTH 64
|
|
15
|
+
|
|
16
|
+
typedef enum {
|
|
17
|
+
HERB_DIFF_NODE_INSERTED,
|
|
18
|
+
HERB_DIFF_NODE_REMOVED,
|
|
19
|
+
HERB_DIFF_NODE_REPLACED,
|
|
20
|
+
HERB_DIFF_NODE_MOVED,
|
|
21
|
+
|
|
22
|
+
HERB_DIFF_TEXT_CHANGED,
|
|
23
|
+
HERB_DIFF_ERB_CONTENT_CHANGED,
|
|
24
|
+
|
|
25
|
+
HERB_DIFF_ATTRIBUTE_ADDED,
|
|
26
|
+
HERB_DIFF_ATTRIBUTE_REMOVED,
|
|
27
|
+
HERB_DIFF_ATTRIBUTE_VALUE_CHANGED,
|
|
28
|
+
|
|
29
|
+
HERB_DIFF_TAG_NAME_CHANGED,
|
|
30
|
+
|
|
31
|
+
HERB_DIFF_NODE_WRAPPED,
|
|
32
|
+
HERB_DIFF_NODE_UNWRAPPED,
|
|
33
|
+
} herb_diff_operation_type_T;
|
|
34
|
+
|
|
35
|
+
typedef struct {
|
|
36
|
+
uint32_t indices[HERB_DIFF_PATH_MAX_DEPTH];
|
|
37
|
+
uint16_t depth;
|
|
38
|
+
} herb_diff_path_T;
|
|
39
|
+
|
|
40
|
+
typedef struct {
|
|
41
|
+
herb_diff_operation_type_T type;
|
|
42
|
+
herb_diff_path_T path;
|
|
43
|
+
const AST_NODE_T* old_node;
|
|
44
|
+
const AST_NODE_T* new_node;
|
|
45
|
+
uint32_t old_index;
|
|
46
|
+
uint32_t new_index;
|
|
47
|
+
} herb_diff_operation_T;
|
|
48
|
+
|
|
49
|
+
typedef struct {
|
|
50
|
+
hb_array_T* operations;
|
|
51
|
+
hb_allocator_T* allocator;
|
|
52
|
+
bool trees_identical;
|
|
53
|
+
} herb_diff_result_T;
|
|
54
|
+
|
|
55
|
+
herb_diff_path_T herb_diff_path_empty(void);
|
|
56
|
+
herb_diff_path_T herb_diff_path_append(herb_diff_path_T path, uint32_t index);
|
|
57
|
+
|
|
58
|
+
herb_diff_result_T* herb_diff(
|
|
59
|
+
const AST_DOCUMENT_NODE_T* old_document,
|
|
60
|
+
const AST_DOCUMENT_NODE_T* new_document,
|
|
61
|
+
hb_allocator_T* allocator
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
size_t herb_diff_operation_count(const herb_diff_result_T* result);
|
|
65
|
+
const herb_diff_operation_T* herb_diff_operation_at(const herb_diff_result_T* result, size_t index);
|
|
66
|
+
bool herb_diff_trees_identical(const herb_diff_result_T* result);
|
|
67
|
+
const char* herb_diff_operation_type_to_string(herb_diff_operation_type_T type);
|
|
68
|
+
|
|
69
|
+
void herb_diff_node(
|
|
70
|
+
const AST_NODE_T* old_node,
|
|
71
|
+
const AST_NODE_T* new_node,
|
|
72
|
+
herb_diff_path_T path,
|
|
73
|
+
const herb_hash_map_T* old_hashes,
|
|
74
|
+
const herb_hash_map_T* new_hashes,
|
|
75
|
+
herb_diff_result_T* result
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
void herb_diff_children(
|
|
79
|
+
const hb_array_T* old_children,
|
|
80
|
+
const hb_array_T* new_children,
|
|
81
|
+
herb_diff_path_T parent_path,
|
|
82
|
+
const herb_hash_map_T* old_hashes,
|
|
83
|
+
const herb_hash_map_T* new_hashes,
|
|
84
|
+
herb_diff_result_T* result
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
void herb_diff_attributes(
|
|
88
|
+
const hb_array_T* old_attributes,
|
|
89
|
+
const hb_array_T* new_attributes,
|
|
90
|
+
herb_diff_path_T parent_path,
|
|
91
|
+
const herb_hash_map_T* old_hashes,
|
|
92
|
+
const herb_hash_map_T* new_hashes,
|
|
93
|
+
herb_diff_result_T* result
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
void herb_diff_emit_operation(
|
|
97
|
+
herb_diff_result_T* result,
|
|
98
|
+
herb_diff_operation_type_T type,
|
|
99
|
+
herb_diff_path_T path,
|
|
100
|
+
const AST_NODE_T* old_node,
|
|
101
|
+
const AST_NODE_T* new_node,
|
|
102
|
+
uint32_t old_index,
|
|
103
|
+
uint32_t new_index
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const hb_array_T* herb_diff_get_node_children(const AST_NODE_T* node);
|
|
107
|
+
|
|
108
|
+
const AST_NODE_T* herb_diff_find_child_by_hash(
|
|
109
|
+
const AST_NODE_T* parent,
|
|
110
|
+
herb_hash_T target_hash,
|
|
111
|
+
const herb_hash_map_T* hash_map
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
herb_hash_T herb_hash_tree(const AST_NODE_T* node, herb_hash_map_T* hash_map);
|
|
115
|
+
herb_hash_T herb_hash_node_identity(const AST_NODE_T* node, const herb_hash_map_T* hash_map);
|
|
116
|
+
herb_hash_T herb_hash_node_move_identity(const AST_NODE_T* node, const herb_hash_map_T* hash_map);
|
|
117
|
+
|
|
118
|
+
#endif
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#ifndef HERB_HASH_H
|
|
2
|
+
#define HERB_HASH_H
|
|
3
|
+
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
#include "../lib/hb_string.h"
|
|
8
|
+
|
|
9
|
+
typedef uint64_t herb_hash_T;
|
|
10
|
+
|
|
11
|
+
// FNV-1a 64-bit hash constants
|
|
12
|
+
// Fowler-Noll-Vo hash function: http://www.isthe.com/chongo/tech/comp/fnv/
|
|
13
|
+
// Created by Glenn Fowler, Landon Curt Noll, and Kiem-Phong Vo
|
|
14
|
+
#define HERB_HASH_INIT ((herb_hash_T) 0xcbf29ce484222325ULL)
|
|
15
|
+
#define HERB_HASH_FNV_PRIME ((herb_hash_T) 0x100000001b3ULL)
|
|
16
|
+
|
|
17
|
+
herb_hash_T herb_hash_byte(herb_hash_T hash, uint8_t byte);
|
|
18
|
+
herb_hash_T herb_hash_bytes(herb_hash_T hash, const void* data, size_t length);
|
|
19
|
+
herb_hash_T herb_hash_uint32(herb_hash_T hash, uint32_t value);
|
|
20
|
+
herb_hash_T herb_hash_uint64(herb_hash_T hash, uint64_t value);
|
|
21
|
+
herb_hash_T herb_hash_bool(herb_hash_T hash, bool value);
|
|
22
|
+
herb_hash_T herb_hash_string(herb_hash_T hash, hb_string_T string);
|
|
23
|
+
herb_hash_T herb_hash_combine(herb_hash_T hash, herb_hash_T other);
|
|
24
|
+
|
|
25
|
+
#endif
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#ifndef HERB_HASH_INDEX_MAP_H
|
|
2
|
+
#define HERB_HASH_INDEX_MAP_H
|
|
3
|
+
|
|
4
|
+
#include <stdbool.h>
|
|
5
|
+
#include <stddef.h>
|
|
6
|
+
|
|
7
|
+
#include "../lib/hb_allocator.h"
|
|
8
|
+
#include "herb_hash.h"
|
|
9
|
+
|
|
10
|
+
typedef struct {
|
|
11
|
+
herb_hash_T key;
|
|
12
|
+
size_t value;
|
|
13
|
+
bool occupied;
|
|
14
|
+
} herb_hash_index_entry_T;
|
|
15
|
+
|
|
16
|
+
typedef struct {
|
|
17
|
+
herb_hash_index_entry_T* entries;
|
|
18
|
+
size_t capacity;
|
|
19
|
+
} herb_hash_index_map_T;
|
|
20
|
+
|
|
21
|
+
bool herb_hash_index_map_init(herb_hash_index_map_T* map, size_t count, hb_allocator_T* allocator);
|
|
22
|
+
|
|
23
|
+
void herb_hash_index_map_insert(herb_hash_index_map_T* map, herb_hash_T key, size_t value);
|
|
24
|
+
|
|
25
|
+
bool herb_hash_index_map_find_unmatched(
|
|
26
|
+
const herb_hash_index_map_T* map,
|
|
27
|
+
herb_hash_T key,
|
|
28
|
+
const bool* matched,
|
|
29
|
+
size_t* out_value
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
#endif
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#ifndef HERB_HASH_MAP_H
|
|
2
|
+
#define HERB_HASH_MAP_H
|
|
3
|
+
|
|
4
|
+
#include <stdbool.h>
|
|
5
|
+
#include <stddef.h>
|
|
6
|
+
#include <stdint.h>
|
|
7
|
+
|
|
8
|
+
#include "../ast/ast_nodes.h"
|
|
9
|
+
#include "../lib/hb_allocator.h"
|
|
10
|
+
#include "herb_hash.h"
|
|
11
|
+
|
|
12
|
+
typedef struct {
|
|
13
|
+
const AST_NODE_T* node;
|
|
14
|
+
herb_hash_T hash;
|
|
15
|
+
bool occupied;
|
|
16
|
+
} herb_hash_map_entry_T;
|
|
17
|
+
|
|
18
|
+
typedef struct {
|
|
19
|
+
herb_hash_map_entry_T* entries;
|
|
20
|
+
size_t capacity;
|
|
21
|
+
size_t size;
|
|
22
|
+
hb_allocator_T* allocator;
|
|
23
|
+
} herb_hash_map_T;
|
|
24
|
+
|
|
25
|
+
bool herb_hash_map_init(herb_hash_map_T* map, size_t initial_capacity, hb_allocator_T* allocator);
|
|
26
|
+
void herb_hash_map_set(herb_hash_map_T* map, const AST_NODE_T* node, herb_hash_T hash);
|
|
27
|
+
herb_hash_T herb_hash_map_get(const herb_hash_map_T* map, const AST_NODE_T* node);
|
|
28
|
+
bool herb_hash_map_has(const herb_hash_map_T* map, const AST_NODE_T* node);
|
|
29
|
+
|
|
30
|
+
#endif
|
data/src/include/herb.h
CHANGED
data/src/include/version.h
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = YAML.safe_load_file("config/options.yml")
|
|
3
|
+
|
|
4
|
+
def camel_case(string)
|
|
5
|
+
parts = string.split("_")
|
|
6
|
+
parts[0] + parts[1..].map(&:capitalize).join
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def pascal_case(string)
|
|
10
|
+
string.split("_").map(&:capitalize).join
|
|
11
|
+
end
|
|
12
|
+
-%>
|
|
13
|
+
|
|
14
|
+
<% options.each do |key, config| -%>
|
|
15
|
+
export type <%= pascal_case(key) %> = <%= config["values"].map { |v| "\"#{v}\"" }.join(" | ") %>
|
|
16
|
+
<% end -%>
|
|
17
|
+
|
|
18
|
+
<% options.each do |key, config| -%>
|
|
19
|
+
export const VALID_<%= key.upcase %>S: readonly <%= pascal_case(key) %>[] = [<%= config["values"].map { |v| "\"#{v}\"" }.join(", ") %>] as const
|
|
20
|
+
<% end -%>
|
|
21
|
+
|
|
22
|
+
<% options.each do |key, config| -%>
|
|
23
|
+
export const DEFAULT_<%= key.upcase %>: <%= pascal_case(key) %> = "<%= config["default"] %>"
|
|
24
|
+
<% end -%>
|
|
25
|
+
|
|
26
|
+
export interface HerbConfig {
|
|
27
|
+
<% options.each do |key, _config| -%>
|
|
28
|
+
<%= camel_case(key) %>: <%= pascal_case(key) %>
|
|
29
|
+
<% end -%>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const DEFAULT_CONFIG: HerbConfig = {
|
|
33
|
+
<% options.each do |key, _config| -%>
|
|
34
|
+
<%= camel_case(key) %>: DEFAULT_<%= key.upcase %>,
|
|
35
|
+
<% end -%>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
<% options.each do |key, _config| -%>
|
|
39
|
+
export function isValid<%= pascal_case(key) %>(value: string): value is <%= pascal_case(key) %> {
|
|
40
|
+
return (VALID_<%= key.upcase %>S as readonly string[]).includes(value)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
<% end -%>
|
|
@@ -160,7 +160,7 @@ macro_rules! convert_specific_node_field {
|
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
unsafe fn convert_node(node_pointer: *const c_void) -> Option<AnyNode> {
|
|
163
|
+
pub(crate) unsafe fn convert_node(node_pointer: *const c_void) -> Option<AnyNode> {
|
|
164
164
|
if node_pointer.is_null() {
|
|
165
165
|
return None;
|
|
166
166
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<%
|
|
2
|
+
options = YAML.safe_load_file("config/options.yml")
|
|
3
|
+
|
|
4
|
+
def pascal_case(string)
|
|
5
|
+
string.split("_").map(&:capitalize).join
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def title_case(string)
|
|
9
|
+
string.split("_").map(&:capitalize).join("")
|
|
10
|
+
end
|
|
11
|
+
-%>
|
|
12
|
+
|
|
13
|
+
use std::fmt;
|
|
14
|
+
|
|
15
|
+
<% options.each do |key, config| -%>
|
|
16
|
+
#[derive(Debug, Clone, PartialEq, Eq)]
|
|
17
|
+
pub enum <%= pascal_case(key) %> {
|
|
18
|
+
<% config["values"].each do |value| -%>
|
|
19
|
+
<%= title_case(value) %>,
|
|
20
|
+
<% end -%>
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
impl Default for <%= pascal_case(key) %> {
|
|
24
|
+
fn default() -> Self {
|
|
25
|
+
<%= pascal_case(key) %>::<%= title_case(config["default"]) %>
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
impl fmt::Display for <%= pascal_case(key) %> {
|
|
30
|
+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
31
|
+
match self {
|
|
32
|
+
<% config["values"].each do |value| -%>
|
|
33
|
+
<%= pascal_case(key) %>::<%= title_case(value) %> => write!(f, "<%= value %>"),
|
|
34
|
+
<% end -%>
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
impl <%= pascal_case(key) %> {
|
|
40
|
+
pub fn from_str(string: &str) -> Option<Self> {
|
|
41
|
+
match string {
|
|
42
|
+
<% config["values"].each do |value| -%>
|
|
43
|
+
"<%= value %>" => Some(<%= pascal_case(key) %>::<%= title_case(value) %>),
|
|
44
|
+
<% end -%>
|
|
45
|
+
_ => None,
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
<% end -%>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
#include "../include/diff/herb_diff.h"
|
|
2
|
+
|
|
3
|
+
const hb_array_T* herb_diff_get_node_children(const AST_NODE_T* node) {
|
|
4
|
+
if (node == NULL) { return NULL; }
|
|
5
|
+
|
|
6
|
+
switch (node->type) {
|
|
7
|
+
<%- nodes.each do |node| -%>
|
|
8
|
+
<%- primary_array = node.fields.find { |field| field.is_a?(Herb::Template::ArrayField) && (field.name == "children" || field.name == "body" || field.name == "statements" || field.name == "conditions") } -%>
|
|
9
|
+
<%- if primary_array -%>
|
|
10
|
+
case <%= node.type %>:
|
|
11
|
+
return ((const <%= node.struct_type %>*) node)-><%= primary_array.name %>;
|
|
12
|
+
|
|
13
|
+
<%- end -%>
|
|
14
|
+
<%- end -%>
|
|
15
|
+
default:
|
|
16
|
+
return NULL;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const AST_NODE_T* herb_diff_find_child_by_hash(
|
|
21
|
+
const AST_NODE_T* parent,
|
|
22
|
+
const herb_hash_T target_hash,
|
|
23
|
+
const herb_hash_map_T* hash_map
|
|
24
|
+
) {
|
|
25
|
+
const hb_array_T* children = herb_diff_get_node_children(parent);
|
|
26
|
+
if (children == NULL) { return NULL; }
|
|
27
|
+
|
|
28
|
+
const size_t count = hb_array_size(children);
|
|
29
|
+
|
|
30
|
+
for (size_t index = 0; index < count; index++) {
|
|
31
|
+
const AST_NODE_T* child = (const AST_NODE_T*) hb_array_get(children, index);
|
|
32
|
+
herb_hash_T child_hash = herb_hash_map_get(hash_map, child);
|
|
33
|
+
|
|
34
|
+
if (child_hash == target_hash) { return child; }
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return NULL;
|
|
38
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
#include "../include/diff/herb_diff.h"
|
|
2
|
+
#include "../include/lib/hb_string.h"
|
|
3
|
+
|
|
4
|
+
static bool tokens_equal(const token_T* old_token, const token_T* new_token) {
|
|
5
|
+
if (old_token == NULL && new_token == NULL) { return true; }
|
|
6
|
+
if (old_token == NULL || new_token == NULL) { return false; }
|
|
7
|
+
|
|
8
|
+
return hb_string_equals(old_token->value, new_token->value);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static void diff_element_node(
|
|
12
|
+
const AST_HTML_ELEMENT_NODE_T* old_element,
|
|
13
|
+
const AST_HTML_ELEMENT_NODE_T* new_element,
|
|
14
|
+
const herb_diff_path_T path,
|
|
15
|
+
const herb_hash_map_T* old_hashes,
|
|
16
|
+
const herb_hash_map_T* new_hashes,
|
|
17
|
+
herb_diff_result_T* result
|
|
18
|
+
) {
|
|
19
|
+
if (!tokens_equal(old_element->tag_name, new_element->tag_name)) {
|
|
20
|
+
herb_diff_emit_operation(result, HERB_DIFF_TAG_NAME_CHANGED, path, (const AST_NODE_T*) old_element, (const AST_NODE_T*) new_element, 0, 0);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (old_element->open_tag != NULL && new_element->open_tag != NULL) {
|
|
24
|
+
herb_hash_T old_open_hash = herb_hash_map_get(old_hashes, old_element->open_tag);
|
|
25
|
+
herb_hash_T new_open_hash = herb_hash_map_get(new_hashes, new_element->open_tag);
|
|
26
|
+
|
|
27
|
+
if (old_open_hash != new_open_hash) {
|
|
28
|
+
const AST_HTML_OPEN_TAG_NODE_T* old_open_tag = (const AST_HTML_OPEN_TAG_NODE_T*) old_element->open_tag;
|
|
29
|
+
const AST_HTML_OPEN_TAG_NODE_T* new_open_tag = (const AST_HTML_OPEN_TAG_NODE_T*) new_element->open_tag;
|
|
30
|
+
|
|
31
|
+
herb_diff_attributes(old_open_tag->children, new_open_tag->children, path, old_hashes, new_hashes, result);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (old_element->body != NULL && new_element->body != NULL) {
|
|
36
|
+
herb_diff_children(old_element->body, new_element->body, path, old_hashes, new_hashes, result);
|
|
37
|
+
} else if (old_element->body == NULL && new_element->body != NULL) {
|
|
38
|
+
for (size_t index = 0; index < hb_array_size(new_element->body); index++) {
|
|
39
|
+
const AST_NODE_T* new_child = (const AST_NODE_T*) hb_array_get(new_element->body, index);
|
|
40
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_INSERTED, herb_diff_path_append(path, (uint32_t) index), NULL, new_child, 0, (uint32_t) index);
|
|
41
|
+
}
|
|
42
|
+
} else if (old_element->body != NULL && new_element->body == NULL) {
|
|
43
|
+
for (size_t index = 0; index < hb_array_size(old_element->body); index++) {
|
|
44
|
+
const AST_NODE_T* old_child = (const AST_NODE_T*) hb_array_get(old_element->body, index);
|
|
45
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REMOVED, herb_diff_path_append(path, (uint32_t) index), old_child, NULL, (uint32_t) index, 0);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static void diff_conditional_element_node(
|
|
51
|
+
const AST_HTML_CONDITIONAL_ELEMENT_NODE_T* old_element,
|
|
52
|
+
const AST_HTML_CONDITIONAL_ELEMENT_NODE_T* new_element,
|
|
53
|
+
const herb_diff_path_T path,
|
|
54
|
+
const herb_hash_map_T* old_hashes,
|
|
55
|
+
const herb_hash_map_T* new_hashes,
|
|
56
|
+
herb_diff_result_T* result
|
|
57
|
+
) {
|
|
58
|
+
if (!tokens_equal(old_element->tag_name, new_element->tag_name)) {
|
|
59
|
+
herb_diff_emit_operation(result, HERB_DIFF_TAG_NAME_CHANGED, path, (const AST_NODE_T*) old_element, (const AST_NODE_T*) new_element, 0, 0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (old_element->open_tag != NULL && new_element->open_tag != NULL) {
|
|
63
|
+
herb_hash_T old_open_hash = herb_hash_map_get(old_hashes, (const AST_NODE_T*) old_element->open_tag);
|
|
64
|
+
herb_hash_T new_open_hash = herb_hash_map_get(new_hashes, (const AST_NODE_T*) new_element->open_tag);
|
|
65
|
+
|
|
66
|
+
if (old_open_hash != new_open_hash) {
|
|
67
|
+
herb_diff_attributes(old_element->open_tag->children, new_element->open_tag->children, path, old_hashes, new_hashes, result);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (old_element->body != NULL && new_element->body != NULL) {
|
|
72
|
+
herb_diff_children(old_element->body, new_element->body, path, old_hashes, new_hashes, result);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static void diff_children_nullable(
|
|
77
|
+
const hb_array_T* old_children,
|
|
78
|
+
const hb_array_T* new_children,
|
|
79
|
+
const herb_diff_path_T path,
|
|
80
|
+
const herb_hash_map_T* old_hashes,
|
|
81
|
+
const herb_hash_map_T* new_hashes,
|
|
82
|
+
herb_diff_result_T* result
|
|
83
|
+
) {
|
|
84
|
+
if (old_children != NULL && new_children != NULL) {
|
|
85
|
+
herb_diff_children(old_children, new_children, path, old_hashes, new_hashes, result);
|
|
86
|
+
} else if (old_children == NULL && new_children != NULL) {
|
|
87
|
+
for (size_t index = 0; index < hb_array_size(new_children); index++) {
|
|
88
|
+
const AST_NODE_T* new_child = (const AST_NODE_T*) hb_array_get(new_children, index);
|
|
89
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_INSERTED, herb_diff_path_append(path, (uint32_t) index), NULL, new_child, 0, (uint32_t) index);
|
|
90
|
+
}
|
|
91
|
+
} else if (old_children != NULL && new_children == NULL) {
|
|
92
|
+
for (size_t index = 0; index < hb_array_size(old_children); index++) {
|
|
93
|
+
const AST_NODE_T* old_child = (const AST_NODE_T*) hb_array_get(old_children, index);
|
|
94
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REMOVED, herb_diff_path_append(path, (uint32_t) index), old_child, NULL, (uint32_t) index, 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
void herb_diff_node(
|
|
100
|
+
const AST_NODE_T* old_node,
|
|
101
|
+
const AST_NODE_T* new_node,
|
|
102
|
+
const herb_diff_path_T path,
|
|
103
|
+
const herb_hash_map_T* old_hashes,
|
|
104
|
+
const herb_hash_map_T* new_hashes,
|
|
105
|
+
herb_diff_result_T* result
|
|
106
|
+
) {
|
|
107
|
+
if (old_node == NULL && new_node == NULL) { return; }
|
|
108
|
+
|
|
109
|
+
if (old_node == NULL) {
|
|
110
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_INSERTED, path, NULL, new_node, 0, 0);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (new_node == NULL) {
|
|
115
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REMOVED, path, old_node, NULL, 0, 0);
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
herb_hash_T old_hash = herb_hash_map_get(old_hashes, old_node);
|
|
120
|
+
herb_hash_T new_hash = herb_hash_map_get(new_hashes, new_node);
|
|
121
|
+
|
|
122
|
+
if (old_hash == new_hash) { return; }
|
|
123
|
+
|
|
124
|
+
if (old_node->type != new_node->type) {
|
|
125
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REPLACED, path, old_node, new_node, 0, 0);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
switch (old_node->type) {
|
|
130
|
+
<%- nodes.each do |node| -%>
|
|
131
|
+
<%- # Skip nodes with custom handlers -%>
|
|
132
|
+
<%- if node.name == "HTMLElementNode" -%>
|
|
133
|
+
case <%= node.type %>: {
|
|
134
|
+
diff_element_node(
|
|
135
|
+
(const <%= node.struct_type %>*) old_node,
|
|
136
|
+
(const <%= node.struct_type %>*) new_node,
|
|
137
|
+
path, old_hashes, new_hashes, result
|
|
138
|
+
);
|
|
139
|
+
} break;
|
|
140
|
+
|
|
141
|
+
<%- elsif node.name == "HTMLConditionalElementNode" -%>
|
|
142
|
+
case <%= node.type %>: {
|
|
143
|
+
diff_conditional_element_node(
|
|
144
|
+
(const <%= node.struct_type %>*) old_node,
|
|
145
|
+
(const <%= node.struct_type %>*) new_node,
|
|
146
|
+
path, old_hashes, new_hashes, result
|
|
147
|
+
);
|
|
148
|
+
} break;
|
|
149
|
+
|
|
150
|
+
<%- elsif node.name == "HTMLAttributeNode" -%>
|
|
151
|
+
case <%= node.type %>: {
|
|
152
|
+
const <%= node.struct_type %>* old_attribute = (const <%= node.struct_type %>*) old_node;
|
|
153
|
+
const <%= node.struct_type %>* new_attribute = (const <%= node.struct_type %>*) new_node;
|
|
154
|
+
|
|
155
|
+
herb_hash_T old_name_hash = herb_hash_map_get(old_hashes, (const AST_NODE_T*) old_attribute->name);
|
|
156
|
+
herb_hash_T new_name_hash = herb_hash_map_get(new_hashes, (const AST_NODE_T*) new_attribute->name);
|
|
157
|
+
|
|
158
|
+
if (old_name_hash != new_name_hash) {
|
|
159
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REPLACED, path, old_node, new_node, 0, 0);
|
|
160
|
+
} else {
|
|
161
|
+
herb_hash_T old_value_hash = herb_hash_map_get(old_hashes, (const AST_NODE_T*) old_attribute->value);
|
|
162
|
+
herb_hash_T new_value_hash = herb_hash_map_get(new_hashes, (const AST_NODE_T*) new_attribute->value);
|
|
163
|
+
|
|
164
|
+
if (old_value_hash != new_value_hash) {
|
|
165
|
+
herb_diff_emit_operation(result, HERB_DIFF_ATTRIBUTE_VALUE_CHANGED, path, old_node, new_node, 0, 0);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
} break;
|
|
169
|
+
|
|
170
|
+
<%- elsif node.name == "HTMLOpenTagNode" -%>
|
|
171
|
+
case <%= node.type %>: {
|
|
172
|
+
const <%= node.struct_type %>* old_open_tag = (const <%= node.struct_type %>*) old_node;
|
|
173
|
+
const <%= node.struct_type %>* new_open_tag = (const <%= node.struct_type %>*) new_node;
|
|
174
|
+
|
|
175
|
+
herb_diff_attributes(old_open_tag->children, new_open_tag->children, path, old_hashes, new_hashes, result);
|
|
176
|
+
} break;
|
|
177
|
+
|
|
178
|
+
<%- else -%>
|
|
179
|
+
<%- all_fields = node.fields.reject(&:always_invisible?).reject { |field| field.is_a?(Herb::Template::PrismNodeField) || field.is_a?(Herb::Template::LocationField) || field.is_a?(Herb::Template::BooleanField) || field.is_a?(Herb::Template::ElementSourceField) } -%>
|
|
180
|
+
<%- token_fields = all_fields.select { |field| field.is_a?(Herb::Template::TokenField) } -%>
|
|
181
|
+
<%- string_fields = all_fields.select { |field| field.is_a?(Herb::Template::StringField) } -%>
|
|
182
|
+
<%- array_fields = all_fields.select { |field| field.is_a?(Herb::Template::ArrayField) } -%>
|
|
183
|
+
<%- node_fields = all_fields.select { |field| field.is_a?(Herb::Template::NodeField) || field.is_a?(Herb::Template::BorrowedNodeField) } -%>
|
|
184
|
+
<%- content_tokens = token_fields.select { |field| %w[content tag_opening].include?(field.name) } -%>
|
|
185
|
+
<%- has_comparisons = content_tokens.any? || string_fields.any? || array_fields.any? || node_fields.any? -%>
|
|
186
|
+
<%- is_erb_node = node.name.start_with?("ERB") || node.name.start_with?("Ruby") -%>
|
|
187
|
+
<%- if !has_comparisons -%>
|
|
188
|
+
case <%= node.type %>: {
|
|
189
|
+
herb_diff_emit_operation(result, HERB_DIFF_NODE_REPLACED, path, old_node, new_node, 0, 0);
|
|
190
|
+
} break;
|
|
191
|
+
|
|
192
|
+
<%- else -%>
|
|
193
|
+
case <%= node.type %>: {
|
|
194
|
+
const <%= node.struct_type %>* old_<%= node.human %> = (const <%= node.struct_type %>*) old_node;
|
|
195
|
+
const <%= node.struct_type %>* new_<%= node.human %> = (const <%= node.struct_type %>*) new_node;
|
|
196
|
+
|
|
197
|
+
<%- if content_tokens.any? -%>
|
|
198
|
+
if (<%= content_tokens.map { |field| "!tokens_equal(old_#{node.human}->#{field.name}, new_#{node.human}->#{field.name})" }.join("\n || ") %>) {
|
|
199
|
+
herb_diff_emit_operation(result, <%= is_erb_node ? "HERB_DIFF_ERB_CONTENT_CHANGED" : "HERB_DIFF_TEXT_CHANGED" %>, path, old_node, new_node, 0, 0);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
<%- end -%>
|
|
203
|
+
|
|
204
|
+
<%- if string_fields.any? -%>
|
|
205
|
+
if (<%= string_fields.map { |field| "!hb_string_equals(old_#{node.human}->#{field.name}, new_#{node.human}->#{field.name})" }.join("\n || ") %>) {
|
|
206
|
+
herb_diff_emit_operation(result, HERB_DIFF_TEXT_CHANGED, path, old_node, new_node, 0, 0);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
<%- end -%>
|
|
210
|
+
|
|
211
|
+
<%- array_fields.each do |field| -%>
|
|
212
|
+
diff_children_nullable(old_<%= node.human %>-><%= field.name %>, new_<%= node.human %>-><%= field.name %>, path, old_hashes, new_hashes, result);
|
|
213
|
+
<%- end -%>
|
|
214
|
+
|
|
215
|
+
<%- node_fields.each do |field| -%>
|
|
216
|
+
herb_diff_node((const AST_NODE_T*) old_<%= node.human %>-><%= field.name %>, (const AST_NODE_T*) new_<%= node.human %>-><%= field.name %>, path, old_hashes, new_hashes, result);
|
|
217
|
+
<%- end -%>
|
|
218
|
+
} break;
|
|
219
|
+
|
|
220
|
+
<%- end -%>
|
|
221
|
+
<%- end -%>
|
|
222
|
+
<%- end -%>
|
|
223
|
+
}
|
|
224
|
+
}
|