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.21.2 lib/fontist/import/otf_parser.rb
fontist-1.21.1 lib/fontist/import/otf_parser.rb
fontist-1.20.0 lib/fontist/import/otf_parser.rb
fontist-1.19.0 lib/fontist/import/otf_parser.rb
fontist-1.18.2 lib/fontist/import/otf_parser.rb
fontist-1.17.1 lib/fontist/import/otf_parser.rb
fontist-1.17.0 lib/fontist/import/otf_parser.rb
fontist-1.16.0 lib/fontist/import/otf_parser.rb
fontist-1.15.2 lib/fontist/import/otf_parser.rb
fontist-1.15.1 lib/fontist/import/otf_parser.rb
fontist-1.15.0 lib/fontist/import/otf_parser.rb
fontist-1.14.6 lib/fontist/import/otf_parser.rb
fontist-1.14.5 lib/fontist/import/otf_parser.rb
fontist-1.14.4 lib/fontist/import/otf_parser.rb
fontist-1.14.3 lib/fontist/import/otf_parser.rb
fontist-1.14.2 lib/fontist/import/otf_parser.rb
fontist-1.14.1 lib/fontist/import/otf_parser.rb
fontist-1.14.0 lib/fontist/import/otf_parser.rb
fontist-1.13.2 lib/fontist/import/otf_parser.rb
fontist-1.13.1 lib/fontist/import/otf_parser.rb