Sha256: 9c028a0724092a70358d5cf4109f4a64e8d31fa9b2f2bec3d0058b889c9456db
Contents?: true
Size: 642 Bytes
Versions: 27
Compression:
Stored size: 642 Bytes
Contents
require_relative "otfinfo/otfinfo_requirement" require_relative "text_helper" module Fontist module Import class OtfParser REQUIREMENTS = { otfinfo: Fontist::Import::Otfinfo::OtfinfoRequirement.new, }.freeze def initialize(path) @path = path end def call raise ArgumentError, "Empty path" unless @path text = REQUIREMENTS[:otfinfo].call(@path) text.split("\n") .select { |x| x.include?(":") } .map { |x| x.split(":", 2) } .map { |x| x.map { |y| Fontist::Import::TextHelper.cleanup(y) } } .to_h end end end end
Version data entries
27 entries across 27 versions & 1 rubygems