Sha256: 7314531dd40fe66378349009d323c3d652734b688d7d27eb3be58df0c2c47c12
Contents?: true
Size: 632 Bytes
Versions: 43
Compression:
Stored size: 632 Bytes
Contents
require "fontist/indexes/filename_index" module Fontist class FontPath def initialize(path) @path = path end def to_s [].tap do |s| s << "-" s << @path s << "(from #{formulas.join(' or ')} formula)" if formulas.any? end.join(" ") end def formulas @formulas ||= if fontist_font? Indexes::FilenameIndex.from_yaml.load_index_formulas(File.basename(@path)).map(&:name) else [] end end def fontist_font? @path.start_with?(Fontist.fonts_path.to_s) end end end
Version data entries
43 entries across 43 versions & 1 rubygems