Class: Ucode::CodeChart::GapAnalyzer::Manifest

Inherits:
Object
  • Object
show all
Defined in:
lib/ucode/code_chart/gap_analyzer/manifest.rb

Overview

Abstract manifest parser. Subclasses own ONE manifest schema and expose a uniform {block_id => covered_codepoints} shape to Ucode::CodeChart::GapAnalyzer.

Subclasses must implement #parse.

Direct Known Subclasses

EssenfontManifest

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Manifest

Returns a new instance of Manifest.

Parameters:

  • path (Pathname, String)

    manifest file path



15
16
17
# File 'lib/ucode/code_chart/gap_analyzer/manifest.rb', line 15

def initialize(path)
  @path = Pathname.new(path)
end

Instance Method Details

#coverage_by_blockHash{String=>Array<Integer>}

Returns block_id → array of codepoints the manifest's donor sources cover.

Returns:

  • (Hash{String=>Array<Integer>})

    block_id → array of codepoints the manifest's donor sources cover

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/ucode/code_chart/gap_analyzer/manifest.rb', line 26

def coverage_by_block
  raise NotImplementedError
end

#read_textObject

Raises:

  • (ArgumentError)

    when the manifest file doesn't exist



31
32
33
34
35
# File 'lib/ucode/code_chart/gap_analyzer/manifest.rb', line 31

def read_text
  return @path.read unless @path.exist?

  @path.read
end

#ucd_versionString

Returns the UCD version declared in the manifest.

Returns:

  • (String)

    the UCD version declared in the manifest

Raises:

  • (NotImplementedError)


20
21
22
# File 'lib/ucode/code_chart/gap_analyzer/manifest.rb', line 20

def ucd_version
  raise NotImplementedError
end