Class: SvgConform::Commands::SvgcheckCompatibility

Inherits:
Object
  • Object
show all
Defined in:
lib/svg_conform/commands/svgcheck_compatibility.rb

Overview

Command for comparing SvgConform with svgcheck compatibility

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ SvgcheckCompatibility

Returns a new instance of SvgcheckCompatibility.



9
10
11
# File 'lib/svg_conform/commands/svgcheck_compatibility.rb', line 9

def initialize(options = {})
  @options = options
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/svg_conform/commands/svgcheck_compatibility.rb', line 13

def execute
  validate_options

  analyzer = SvgConform::Compatibility::CompatibilityAnalyzer.new(
    mode: @options[:mode] || @options["mode"] || "check",
    profile: @options[:profile] || @options["profile"] || "svg_1_2_rfc_compatible",
    semantic: @options[:semantic] || @options["semantic"] || false,
    svgcheck_dir: @options[:svgcheck_dir] || @options["svgcheck_dir"] || "spec/fixtures/svgcheck",
    file: @options[:file] || @options["file"],
    output: @options[:output] || @options["output"],
  )

  analyzer.run_analysis
end