fontisan 0.4.44 → 0.4.45

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: 7d195924806ae6e5a9ca3f0796493ec611303a30f39aeed2293829a6d3317a06
4
- data.tar.gz: 96183528b1693ff11796622f2df05541a371606cfaddd8bc8ae5fccacf42b488
3
+ metadata.gz: 5809fbd27b8c1e2d11d559e90e45201748c35aee50106d6eda8e34f363c4ead7
4
+ data.tar.gz: 897ed09e0131fc562d21b5796d1c4e263967277bbbbc038b1eac3ea4f10ffc9e
5
5
  SHA512:
6
- metadata.gz: 0c991caf6890e43dd5d95c47fe187421f536b4dc14c70f1a2c035ab254212356a4f85886e118832e3586721726fc69411b71739654fcf017ecaa9d09e5a2aa7a
7
- data.tar.gz: dd7c245e25cc82d4024a49404938c624462a0b8d1593764c5c2c5bdb0555da052ce7bb436079d6959eaf17359f601034bf0c4c46b064b8be6cb419abc941829a
6
+ metadata.gz: 31e50b7dc96edb8ad675f5ad4843264708890a40b77586496a75ca61335dc46a5ab1e96b587d66e03512b5cca8b38a7d6d78804ea3d3520797b5b9cd740571c4
7
+ data.tar.gz: 19d29274a8fd77b7fe5dc39dec2f2435f38ecfc16df1a00c560051afd5b42f14add68cf92f0873b3cb59c1d35647904917a99826ca5b10c1c4710871cacdae7f
@@ -0,0 +1,36 @@
1
+ # 30 — Eliminate .send(:private_method) calls in specs
2
+
3
+ ## Priority
4
+ P1
5
+
6
+ ## Problem
7
+ 288 `.send(:method_name, ...)` calls in spec files bypass
8
+ encapsulation to test private methods directly. This violates the
9
+ "never use private send methods" rule.
10
+
11
+ ## Approach
12
+ For each method tested via `.send()`:
13
+ 1. Make it public (move above `private` keyword)
14
+ 2. Replace `.send(:method, args)` with `.method(args)` in specs
15
+
16
+ Rationale: if a method is important enough to test directly,
17
+ it should be part of the public API.
18
+
19
+ ## Top files by send count
20
+ - type1_converter_spec.rb (66)
21
+ - cff2/table_builder_spec.rb (34)
22
+ - format_converter_spec.rb (17)
23
+ - type1_property_spec.rb (13)
24
+ - outline_converter_spec.rb (11)
25
+ - conversion_options_spec.rb (10)
26
+ - info_command_spec.rb (10)
27
+ - base_command_spec.rb (10)
28
+ - pattern_analyzer_spec.rb (10)
29
+ - variation/converter_spec.rb (10)
30
+ - woff2_font_spec.rb (10)
31
+ - Plus ~15 more files
32
+
33
+ ## Acceptance criteria
34
+ - 0 `.send(:` calls in spec/
35
+ - All tested methods are public
36
+ - All specs pass
@@ -45,5 +45,8 @@ Each file is `NN-short-name.md` where `NN` is the priority order.
45
45
 
46
46
  ### P3 — Architecture polish (post-#137 audit)
47
47
  - [x] ~~[27 — Table class registry (OCP: eliminate case/when tag dispatch)](27-table-class-registry.md)~~ ✓ Done (#138)
48
- - [ ] [28 — Spec doubles cleanup](28-spec-doubles-cleanup.md)
49
- - [x] ~~[29 — Strategy registries for per-tag dispatch](29-strategy-registries.md)~~ ✓ Done
48
+ - [x] ~~[28 — Spec doubles cleanup](28-spec-doubles-cleanup.md)~~ ✓ Done (#140-#145)
49
+ - [x] ~~[29 — Strategy registries for per-tag dispatch](29-strategy-registries.md)~~ ✓ Done (#139)
50
+
51
+ ### P3 — Encapsulation completion (post-#146 audit)
52
+ - [ ] [30 — Eliminate .send(:private_method) calls in specs](30-eliminate-send-in-specs.md)
@@ -50,7 +50,7 @@ module Fontisan
50
50
  # @return [Hash] Command options
51
51
  attr_reader :font_path, :font, :options
52
52
 
53
- private
53
+ # Methods below were private; made public for testability (TODO 30)
54
54
 
55
55
  # Load the font using FontLoader.
56
56
  #
@@ -37,7 +37,7 @@ module Fontisan
37
37
  end
38
38
  end
39
39
 
40
- private
40
+ # Methods below were private; made public for testability (TODO 30)
41
41
 
42
42
  # Get collection information
43
43
  #
@@ -150,7 +150,7 @@ module Fontisan
150
150
  PRESETS.keys
151
151
  end
152
152
 
153
- private
153
+ # Methods below were private; made public for testability (TODO 30)
154
154
 
155
155
  # Normalize format symbol
156
156
  #
@@ -236,7 +236,7 @@ module Fontisan
236
236
  end
237
237
  end
238
238
 
239
- private
239
+ # Methods below were private; made public for testability (TODO 30)
240
240
 
241
241
  # Convert variable font to SVG at specific coordinates
242
242
  #
@@ -126,7 +126,7 @@ module Fontisan
126
126
  true
127
127
  end
128
128
 
129
- private
129
+ # Methods below were private; made public for testability (TODO 30)
130
130
 
131
131
  # Extract ConversionOptions from options hash
132
132
  #
@@ -120,7 +120,7 @@ module Fontisan
120
120
  result
121
121
  end
122
122
 
123
- private
123
+ # Methods below were private; made public for testability (TODO 30)
124
124
 
125
125
  # Convert a single hint to PostScript format
126
126
  #
@@ -83,7 +83,7 @@ module Fontisan
83
83
  @patterns.values.sort_by { |p| -p.savings }
84
84
  end
85
85
 
86
- private
86
+ # Methods below were private; made public for testability (TODO 30)
87
87
 
88
88
  # Find operator boundaries in CharString
89
89
  # Returns positions where operators end, which are valid pattern boundaries
@@ -184,8 +184,8 @@ module Fontisan
184
184
  io.read(data_length)
185
185
  end
186
186
 
187
- private_class_method :parse_header, :find_sfnt_resources,
188
- :extract_resource_data
187
+ # parse_header, find_sfnt_resources, extract_resource_data
188
+ # were private_class_method; made public for testability (TODO 30)
189
189
  end
190
190
  end
191
191
  end
@@ -105,7 +105,7 @@ module Fontisan
105
105
  handle_error(e)
106
106
  end
107
107
 
108
- private
108
+ # Methods below were private; made public for testability (TODO 30)
109
109
 
110
110
  # Detect input format and capabilities
111
111
  #
@@ -86,7 +86,7 @@ module Fontisan
86
86
  !@variable_store.nil?
87
87
  end
88
88
 
89
- private
89
+ # Methods below were private; made public for testability (TODO 30)
90
90
 
91
91
  # Extract number of variation axes from Variable Store
92
92
  #
@@ -170,7 +170,7 @@ module Fontisan
170
170
  !parser.seac_components.nil?
171
171
  end
172
172
 
173
- private
173
+ # Methods below were private; made public for testability (TODO 30)
174
174
 
175
175
  # Encode number in CFF format
176
176
  #
@@ -124,7 +124,7 @@ module Fontisan
124
124
  )
125
125
  end
126
126
 
127
- private
127
+ # Methods below were private; made public for testability (TODO 30)
128
128
 
129
129
  # Convert blend data from a glyph to tuple format
130
130
  #
@@ -118,7 +118,7 @@ module Fontisan
118
118
  true
119
119
  end
120
120
 
121
- private
121
+ # Methods below were private; made public for testability (TODO 30)
122
122
 
123
123
  # Extract regions from ItemVariationStore
124
124
  #
@@ -213,8 +213,6 @@ module Fontisan
213
213
  end
214
214
  end
215
215
 
216
- public
217
-
218
216
  # Maps MVAR metric tags to [table_tag, method] for base value lookup.
219
217
  METRIC_SOURCES = {
220
218
  "hasc" => ["hhea", :ascender],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Fontisan
4
- VERSION = "0.4.44"
4
+ VERSION = "0.4.45"
5
5
  end
@@ -55,7 +55,7 @@ module Fontisan
55
55
  TRANSFORM_VERSIONS.fetch(tag, TRANSFORM_NONE)
56
56
  end
57
57
 
58
- private
58
+ # Methods below were private; made public for testability (TODO 30)
59
59
 
60
60
  def tag_index
61
61
  @flags & 0x3F
@@ -726,7 +726,7 @@ module Fontisan
726
726
  sfnt_data[head_offset + 8, 4] = [adjustment].pack("N")
727
727
  end
728
728
 
729
- private
729
+ # Methods below were private; made public for testability (TODO 30)
730
730
 
731
731
  # Read variable-length UIntBase128 integer from IO
732
732
  def read_uint_base128(io)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fontisan
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.44
4
+ version: 0.4.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-18 00:00:00.000000000 Z
11
+ date: 2026-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -162,6 +162,7 @@ files:
162
162
  - TODO.bug-fixes/27-table-class-registry.md
163
163
  - TODO.bug-fixes/28-spec-doubles-cleanup.md
164
164
  - TODO.bug-fixes/29-strategy-registries.md
165
+ - TODO.bug-fixes/30-eliminate-send-in-specs.md
165
166
  - TODO.bug-fixes/README.md
166
167
  - TODO.improvements/01-cbdt-cblc-gid-stable-propagation.md
167
168
  - TODO.improvements/02-collection-outline-priority.md