Class: Ucode::Glyphs::RealFonts::Writer
- Inherits:
-
Object
- Object
- Ucode::Glyphs::RealFonts::Writer
- Defined in:
- lib/ucode/glyphs/real_fonts/writer.rb
Overview
Persists a FontCoverageReport as a JSON file under ‘output/font_coverage/`. One file per audited face; the filename is derived from the report’s ‘source_file` so the source and the report are trivially correlated.
Constant Summary collapse
- DEFAULT_OUTPUT_DIR =
"font_coverage"
Instance Method Summary collapse
-
#initialize(output_root) ⇒ Writer
constructor
A new instance of Writer.
-
#write(report) ⇒ Pathname
Absolute path of the written file.
Constructor Details
#initialize(output_root) ⇒ Writer
Returns a new instance of Writer.
20 21 22 |
# File 'lib/ucode/glyphs/real_fonts/writer.rb', line 20 def initialize(output_root) @output_root = Pathname(output_root) end |
Instance Method Details
#write(report) ⇒ Pathname
Returns absolute path of the written file.
26 27 28 29 30 31 |
# File 'lib/ucode/glyphs/real_fonts/writer.rb', line 26 def write(report) path = target_path(report) path.dirname.mkpath path.write("#{JSON.pretty_generate(report.to_hash)}\n") path end |