Class: SvgConform::ExternalCheckers::BaseChecker

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

Overview

Base class for external checker integrations

Direct Known Subclasses

Svgcheck::Checker

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, version: nil) ⇒ BaseChecker

Returns a new instance of BaseChecker.



13
14
15
16
# File 'lib/svg_conform/external_checkers.rb', line 13

def initialize(name:, version: nil)
  @name = name
  @version = version
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/svg_conform/external_checkers.rb', line 11

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



11
12
13
# File 'lib/svg_conform/external_checkers.rb', line 11

def version
  @version
end

Instance Method Details

#available?Boolean

Check if the checker is available on the system

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/svg_conform/external_checkers.rb', line 29

def available?
  raise NotImplementedError, "Subclasses must implement available?"
end

#generate_outputs(input_file, mode: :both) ⇒ Object

Generate outputs for a given file - to be implemented by subclasses

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/svg_conform/external_checkers.rb', line 19

def generate_outputs(input_file, mode: :both)
  raise NotImplementedError, "Subclasses must implement generate_outputs"
end

#parse_output(output_content, error_content = nil) ⇒ Object

Parse checker output into a ConformanceReport - to be implemented by subclasses

Raises:

  • (NotImplementedError)


24
25
26
# File 'lib/svg_conform/external_checkers.rb', line 24

def parse_output(output_content, error_content = nil)
  raise NotImplementedError, "Subclasses must implement parse_output"
end