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

Version Path
fontist-1.13.0 lib/fontist/import/otf_parser.rb
fontist-1.12.0 lib/fontist/import/otf_parser.rb
fontist-1.11.7 lib/fontist/import/otf_parser.rb
fontist-1.11.6 lib/fontist/import/otf_parser.rb
fontist-1.11.5 lib/fontist/import/otf_parser.rb
fontist-1.11.3 lib/fontist/import/otf_parser.rb
fontist-1.11.2 lib/fontist/import/otf_parser.rb