postsvg 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0de930d655e83ae56095a0a297a654f9d5fbf68e394e0bf133f4f6a0851ca8a6
4
- data.tar.gz: d6a2f211f000b43a0ad4b6ff95ed86400b2a2869d25fd0c56394658927bf7c13
3
+ metadata.gz: e16167ba04bd75b82581d7d2b134ab27e86dbfb8d6995b1cf2c90dbd066f8c77
4
+ data.tar.gz: 6037cc81949b6081d656e255cb69df316bdbe281693c63a557fb7594e28bd087
5
5
  SHA512:
6
- metadata.gz: 447ab36ac29c352d4356f41eaabce61c941abc223726fdbee7f6ae0f6a878ac41a297b16f392cf3b0fb1e50d17b1917e5376f6d88de79667490829d0cd64b077
7
- data.tar.gz: 2c851d97ddae78e810c21efee254a0d52f8b89a9bbab871feb5c09436f854a9847841e4bb8483335b091d432c172dec855bcab30cdd4bcb3a06d64098595ef14
6
+ metadata.gz: a877fb8b10d634fd4099bf48722e4f22bc06fd3666d8e4a0fa94e4f47a1c6ba9ab94d4194363e8ed2a2dc4d5b1b90df4f01698f6b6da45f39bdf07ba9806c7a2
7
+ data.tar.gz: 387841a18917ae89771060686407b391c4ad6ad39c028411171a130c46c308f132089b7b3a258508cc4ca4ff66a534c244873d79b70d5608d10604a49b880eae
data/CLAUDE.md CHANGED
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
 
5
5
  ## What this is
6
6
 
7
- `postsvg` is a pure-Ruby bidirectional converter between PostScript/EPS and SVG. Both directions are implemented in the 0.2.x line; the SVg→PS direction is newer. The PS side uses a hand-written lexer + stack-machine interpreter; the SVG side uses Nokogiri. There is no Ghostscript, Inkscape, or other external renderer.
7
+ `postsvg` is a pure-Ruby bidirectional converter between PostScript/EPS and SVG. Both directions are implemented in the 0.2.x line; the SVg→PS direction is newer. The PS side uses a hand-written lexer + stack-machine interpreter; the SVG side uses leptris. There is no Ghostscript, Inkscape, or other external renderer.
8
8
 
9
9
  Code architecture mirrors `emfsvg`: a typed `Model::Program` value object is the single source of truth, with a Renderer / Visitor visiting it to emit SVG, and a Serializer walking it to emit PS.
10
10
 
@@ -54,7 +54,7 @@ PS/EPS bytes ──▶│ Postsvg::Lexer │
54
54
  │ │
55
55
  ▼ │
56
56
  SVG string │
57
- │ Nokogiri │
57
+ │ leptris │
58
58
  ▼ │
59
59
  ┌─────────────────┐ │
60
60
  │ Postsvg:: │ │
@@ -163,7 +163,7 @@ Errors: `Postsvg::ParseError`, `LexError`, `SyntaxError`, `RenderError`, `StackU
163
163
 
164
164
  ## Dependencies
165
165
 
166
- - `parslet`, `thor`, `nokogiri`, `lutaml/canon` (dev only, for XML matcher in integration specs) — see `Gemfile`.
166
+ - `parslet`, `thor`, `leptris`, `lutaml/canon` (dev only, for XML matcher in integration specs) — see `Gemfile`.
167
167
 
168
168
  ## Limitations
169
169
 
@@ -14,6 +14,17 @@ module Postsvg
14
14
  end
15
15
 
16
16
  def emit(record)
17
+ # Operators built by the svg -> ps handlers carry their
18
+ # operands as attributes; the serializer writes keywords only
19
+ # and expects the operands as separate literal statements
20
+ # ahead of the keyword (the shape the PS parse path produces).
21
+ # Splice them in so the record stream round-trips.
22
+ if record.is_a?(Model::Operator) &&
23
+ record.class.public_method_defined?(:operand_values)
24
+ record.operand_values.each do |v|
25
+ @records << Model::Literals::Number.new(v)
26
+ end
27
+ end
17
28
  @records << record
18
29
  self
19
30
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Postsvg
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postsvg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.