Class: SvgConform::Compatibility::ValidityAnalyzer
- Inherits:
-
Object
- Object
- SvgConform::Compatibility::ValidityAnalyzer
- Defined in:
- lib/svg_conform/compatibility/validity_analysis.rb
Overview
Enhanced validity analyzer following model-driven architecture
Instance Attribute Summary collapse
-
#analysis_results ⇒ Object
readonly
Returns the value of attribute analysis_results.
Instance Method Summary collapse
- #analyze_semantic_patterns(svg_conform_issues, svgcheck_issues) ⇒ Object
- #analyze_validity_mismatch(svg_conform_result, svgcheck_result, filename) ⇒ Object
-
#initialize ⇒ ValidityAnalyzer
constructor
A new instance of ValidityAnalyzer.
Constructor Details
#initialize ⇒ ValidityAnalyzer
Returns a new instance of ValidityAnalyzer.
84 85 86 |
# File 'lib/svg_conform/compatibility/validity_analysis.rb', line 84 def initialize @analysis_results = [] end |
Instance Attribute Details
#analysis_results ⇒ Object (readonly)
Returns the value of attribute analysis_results.
82 83 84 |
# File 'lib/svg_conform/compatibility/validity_analysis.rb', line 82 def analysis_results @analysis_results end |
Instance Method Details
#analyze_semantic_patterns(svg_conform_issues, svgcheck_issues) ⇒ Object
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/svg_conform/compatibility/validity_analysis.rb', line 117 def analyze_semantic_patterns(svg_conform_issues, svgcheck_issues) patterns = [] svg_conform_issues.each do |svg_issue| svgcheck_issues.each do |svg_issue_check| pattern = SemanticPattern.new( pattern_type: determine_pattern_type(svg_issue, svg_issue_check), svg_conform_message: svg_issue.to_s, svgcheck_message: svg_issue_check.to_s, ) # Try to map to existing semantic keys map_semantic_pattern(pattern) patterns << pattern end end patterns end |
#analyze_validity_mismatch(svg_conform_result, svgcheck_result, filename) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/svg_conform/compatibility/validity_analysis.rb', line 88 def analyze_validity_mismatch(svg_conform_result, svgcheck_result, filename) # Handle different result types svg_conform_valid = if svg_conform_result.respond_to?(:valid?) svg_conform_result.valid? else svg_conform_result.valid end svgcheck_valid = if svgcheck_result.respond_to?(:valid?) svgcheck_result.valid? else svgcheck_result.valid end analysis = ValidityAnalysis.new( svg_conform_valid: svg_conform_valid, svgcheck_valid: svgcheck_valid, ) if analysis.mismatch? investigate_mismatch_reasons(analysis, svg_conform_result, svgcheck_result, filename) end @analysis_results << analysis analysis end |