suma 0.4.0 → 0.5.1

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: 304c4c7a2ec03c83604a127370259b022e0102d303c4951c2d730d3681d3ad39
4
- data.tar.gz: b8d9bcd807ea0aadb4f038dd58823d829d495827e4785316cb7c715e79b512cb
3
+ metadata.gz: 1136a7e4a745c2e2dda6f8e3a42baca536732794bb5cb92a055831b7eaa9d967
4
+ data.tar.gz: f058690c21e1126054eb135ad09c76f7f95977068c05e195855b4ccafe78ab99
5
5
  SHA512:
6
- metadata.gz: 21977b339cd0a16936940c50de766ba2130f3dc46df7965db1de04360a65c1d685e1b59786e9a49548d0e79f1d20befcf732a66482b6e8b8793a547bd557d28e
7
- data.tar.gz: bd1122e6d73a9a22b3a3830c7cf654c909a541e7c332808349b15bb469f772338ad7a84a25590f1c8d13b46b84d8399673fa2f43f16f5d943e0e1f8e2469a08a
6
+ metadata.gz: dafc7f0fc01386c7568858a480d74da950c0c5b48a3f57fc02abe1e2104d68a0d612f1588a40a3046e5344baa3e177a088df6da0c0e47a47af9cf4d7ca79d365
7
+ data.tar.gz: 9fde63ff34104914a415c13280f29e6ed5e0c2e3c40d14d5e4ea8a3d4c8d45c80a6ba4cc12df6a98f687d2f21627b28532e2591a7071bf62fb7b287dcb6ae1a8
@@ -2,15 +2,15 @@
2
2
  # See https://github.com/metanorma/cimas
3
3
  name: rake
4
4
 
5
- permissions:
6
- contents: write
7
-
8
5
  on:
9
6
  push:
10
7
  branches: [ master, main ]
11
8
  tags: [ v* ]
12
9
  pull_request:
13
10
 
11
+ permissions:
12
+ contents: write
13
+
14
14
  jobs:
15
15
  rake:
16
16
  uses: metanorma/ci/.github/workflows/generic-rake.yml@main
@@ -2,11 +2,6 @@
2
2
  # See https://github.com/metanorma/cimas
3
3
  name: release
4
4
 
5
- permissions:
6
- contents: write
7
- packages: write
8
- id-token: write
9
-
10
5
  on:
11
6
  workflow_dispatch:
12
7
  inputs:
@@ -27,3 +22,4 @@ jobs:
27
22
  secrets:
28
23
  rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
29
24
  pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
25
+
data/.rubocop.yml CHANGED
@@ -1,19 +1,23 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
1
3
  inherit_from:
2
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
3
5
  - .rubocop_todo.yml
4
6
 
7
+ # Rubocop plugins enabled centrally so every metanorma-org gem picks them up
8
+ # on cimas sync — best practice belongs at the shared-template layer, not
9
+ # per-repo. Per ronaldtse feedback on metanorma/ci#332.
5
10
  plugins:
6
- - rubocop-performance
7
- - rubocop-rake
8
- - rubocop-rspec
11
+ - rubocop-rspec
12
+ - rubocop-performance
13
+ - rubocop-rake
14
+
15
+ # local repo-specific modifications
16
+ # ...
9
17
 
10
18
  AllCops:
11
- TargetRubyVersion: 3.1
12
- NewCops: enable
13
- Exclude:
14
- - 'lib/suma/cli/reformat.rb'
15
- - 'lib/suma/cli/generate_schemas.rb'
16
- - 'lib/suma/cli/validate_ascii.rb'
17
- - 'lib/suma/cli/validate_links.rb'
18
- - 'lib/suma/cli/extract_terms.rb'
19
- - 'vendor/**/*'
19
+ # 3.3 matches the org-wide minimum being pushed via #274 (Raise minimum
20
+ # Ruby version to 3.3 due to EOL of 3.2 on 2026-03-31). Was 3.4 before
21
+ # this commit — 3.4 was above the org's stated minimum and would have
22
+ # applied Rubocop rules that fail-close on gems still targeting 3.3.
23
+ TargetRubyVersion: 3.3
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
- # `rubocop --auto-gen-config`
3
- # on 2026-07-02 16:27:30 UTC using RuboCop version 1.87.0.
2
+ # `rubocop --auto-gen-config --no-exclude-limit`
3
+ # on 2026-07-06 10:29:55 UTC using RuboCop version 1.88.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -16,81 +16,15 @@ Gemspec/RequiredRubyVersion:
16
16
  Exclude:
17
17
  - 'suma.gemspec'
18
18
 
19
- # Offense count: 35
19
+ # Offense count: 1
20
20
  # This cop supports safe autocorrection (--autocorrect).
21
21
  # Configuration parameters: EnforcedStyle, IndentationWidth.
22
22
  # SupportedStyles: with_first_argument, with_fixed_indentation
23
23
  Layout/ArgumentAlignment:
24
24
  Exclude:
25
- - 'lib/suma/link_validator.rb'
26
- - 'lib/suma/schema_comparer.rb'
27
- - 'lib/suma/schema_compiler.rb'
28
- - 'lib/suma/schema_manifest_generator.rb'
29
- - 'lib/suma/svg_quality/formatters.rb'
30
25
  - 'lib/suma/term_extractor.rb'
31
- - 'spec/suma/link_validator_spec.rb'
32
- - 'spec/suma/manifest_traverser_spec.rb'
33
- - 'spec/suma/register_manifest_generator_spec.rb'
34
- - 'spec/suma/schema_comparer_integration_spec.rb'
35
- - 'spec/suma/schema_comparer_spec.rb'
36
- - 'spec/suma/schema_discovery_spec.rb'
37
- - 'spec/suma/term_extractor_spec.rb'
38
-
39
- # Offense count: 2
40
- # This cop supports safe autocorrection (--autocorrect).
41
- # Configuration parameters: EnforcedStyle, IndentationWidth.
42
- # SupportedStyles: with_first_element, with_fixed_indentation
43
- Layout/ArrayAlignment:
44
- Exclude:
45
- - 'lib/suma/schema_naming.rb'
46
- - 'spec/suma/register_manifest_generator_spec.rb'
47
-
48
- # Offense count: 6
49
- # This cop supports safe autocorrection (--autocorrect).
50
- # Configuration parameters: EnforcedStyleAlignWith.
51
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
52
- Layout/BlockAlignment:
53
- Exclude:
54
- - 'lib/suma/link_validator.rb'
55
- - 'lib/suma/register_manifest_generator.rb'
56
- - 'spec/suma/term_extractor_spec.rb'
57
-
58
- # Offense count: 6
59
- # This cop supports safe autocorrection (--autocorrect).
60
- Layout/BlockEndNewline:
61
- Exclude:
62
- - 'lib/suma/link_validator.rb'
63
- - 'lib/suma/register_manifest_generator.rb'
64
- - 'spec/suma/term_extractor_spec.rb'
65
-
66
- # Offense count: 3
67
- # This cop supports safe autocorrection (--autocorrect).
68
- # Configuration parameters: IndentationWidth.
69
- Layout/ClosingParenthesisIndentation:
70
- Exclude:
71
- - 'lib/suma/schema_template/document.rb'
72
- - 'spec/suma/link_validator_spec.rb'
73
- - 'spec/suma/schema_index_spec.rb'
74
-
75
- # Offense count: 3
76
- # This cop supports safe autocorrection (--autocorrect).
77
- # Configuration parameters: EnforcedStyle, IndentationWidth.
78
- # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
79
- Layout/FirstArgumentIndentation:
80
- Exclude:
81
- - 'lib/suma/schema_template/document.rb'
82
- - 'spec/suma/link_validator_spec.rb'
83
- - 'spec/suma/schema_index_spec.rb'
84
26
 
85
- # Offense count: 6
86
- # This cop supports safe autocorrection (--autocorrect).
87
- # Configuration parameters: EnforcedStyle, IndentationWidth.
88
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
89
- Layout/FirstArrayElementIndentation:
90
- Exclude:
91
- - 'spec/suma/manifest_traverser_spec.rb'
92
-
93
- # Offense count: 14
27
+ # Offense count: 1
94
28
  # This cop supports safe autocorrection (--autocorrect).
95
29
  # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
96
30
  # SupportedHashRocketStyles: key, separator, table
@@ -98,71 +32,67 @@ Layout/FirstArrayElementIndentation:
98
32
  # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
99
33
  Layout/HashAlignment:
100
34
  Exclude:
101
- - 'lib/suma/schema_compiler.rb'
102
35
  - 'lib/suma/term_extractor.rb'
103
- - 'spec/suma/manifest_traverser_spec.rb'
104
36
 
105
- # Offense count: 12
106
- # This cop supports safe autocorrection (--autocorrect).
107
- # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
108
- # SupportedStylesAlignWith: start_of_line, relative_to_receiver
109
- Layout/IndentationWidth:
110
- Exclude:
111
- - 'lib/suma/link_validator.rb'
112
- - 'lib/suma/register_manifest_generator.rb'
113
- - 'spec/suma/term_extractor_spec.rb'
114
-
115
- # Offense count: 189
37
+ # Offense count: 174
116
38
  # This cop supports safe autocorrection (--autocorrect).
117
39
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
118
40
  # URISchemes: http, https
119
41
  Layout/LineLength:
120
- Enabled: false
121
-
122
- # Offense count: 3
123
- # This cop supports safe autocorrection (--autocorrect).
124
- # Configuration parameters: EnforcedStyle.
125
- # SupportedStyles: symmetrical, new_line, same_line
126
- Layout/MultilineArrayBraceLayout:
127
- Exclude:
128
- - 'spec/suma/manifest_traverser_spec.rb'
129
-
130
- # Offense count: 3
131
- # This cop supports safe autocorrection (--autocorrect).
132
- # Configuration parameters: EnforcedStyle.
133
- # SupportedStyles: symmetrical, new_line, same_line
134
- Layout/MultilineMethodCallBraceLayout:
135
- Exclude:
136
- - 'lib/suma/schema_template/document.rb'
137
- - 'spec/suma/link_validator_spec.rb'
138
- - 'spec/suma/schema_index_spec.rb'
139
-
140
- # Offense count: 32
141
- # This cop supports safe autocorrection (--autocorrect).
142
- # Configuration parameters: AllowInHeredoc.
143
- Layout/TrailingWhitespace:
144
42
  Exclude:
43
+ - 'Gemfile'
44
+ - 'lib/suma/cli/build.rb'
45
+ - 'lib/suma/cli/check_svg_quality.rb'
46
+ - 'lib/suma/cli/compare.rb'
47
+ - 'lib/suma/cli/core.rb'
48
+ - 'lib/suma/cli/validate.rb'
49
+ - 'lib/suma/cli/validate_links.rb'
50
+ - 'lib/suma/eengine/wrapper.rb'
51
+ - 'lib/suma/express_reformatter.rb'
52
+ - 'lib/suma/jsdai/figure.rb'
53
+ - 'lib/suma/jsdai/figure_image.rb'
54
+ - 'lib/suma/link_validation.rb'
145
55
  - 'lib/suma/link_validator.rb'
56
+ - 'lib/suma/link_validator/step.rb'
57
+ - 'lib/suma/manifest_traverser.rb'
58
+ - 'lib/suma/note_processor.rb'
59
+ - 'lib/suma/processor.rb'
60
+ - 'lib/suma/register_manifest_generator.rb'
146
61
  - 'lib/suma/schema_comparer.rb'
147
- - 'lib/suma/schema_compiler.rb'
148
- - 'lib/suma/schema_manifest_generator.rb'
149
62
  - 'lib/suma/schema_naming.rb'
150
- - 'lib/suma/svg_quality/formatters.rb'
151
- - 'lib/suma/term_extractor.rb'
63
+ - 'lib/suma/staged_collection_builder.rb'
64
+ - 'lib/suma/svg_quality/formatters/terminal_formatter.rb'
65
+ - 'lib/suma/thor_ext.rb'
66
+ - 'spec/suma/cli/build_spec.rb'
67
+ - 'spec/suma/cli/export_spec.rb'
68
+ - 'spec/suma/cli/extract_terms_spec.rb'
69
+ - 'spec/suma/cli/generate_register_spec.rb'
70
+ - 'spec/suma/eengine_converter_spec.rb'
71
+ - 'spec/suma/eengine_spec.rb'
72
+ - 'spec/suma/express_schema_spec.rb'
73
+ - 'spec/suma/jsdai/figure_spec.rb'
152
74
  - 'spec/suma/link_validator_spec.rb'
153
75
  - 'spec/suma/manifest_traverser_spec.rb'
76
+ - 'spec/suma/note_processor_spec.rb'
154
77
  - 'spec/suma/register_manifest_generator_spec.rb'
78
+ - 'spec/suma/schema_category_spec.rb'
155
79
  - 'spec/suma/schema_comparer_integration_spec.rb'
156
- - 'spec/suma/schema_comparer_spec.rb'
157
80
  - 'spec/suma/schema_discovery_spec.rb'
81
+ - 'spec/suma/schema_exporter_spec.rb'
82
+ - 'spec/suma/schema_index_spec.rb'
83
+ - 'spec/suma/schema_naming_spec.rb'
84
+ - 'spec/suma/schema_template_spec.rb'
85
+ - 'spec/suma/staged_collection_builder_spec.rb'
86
+ - 'spec/suma/term_classification_spec.rb'
158
87
  - 'spec/suma/term_extractor_spec.rb'
88
+ - 'spec/suma/urn_spec.rb'
89
+ - 'suma.gemspec'
159
90
 
160
- # Offense count: 4
91
+ # Offense count: 2
161
92
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
162
93
  Lint/DuplicateBranch:
163
94
  Exclude:
164
95
  - 'lib/suma/jsdai/figure.rb'
165
- - 'lib/suma/term_extractor.rb'
166
96
 
167
97
  # Offense count: 1
168
98
  Lint/DuplicateMethods:
@@ -182,7 +112,7 @@ Lint/UnusedMethodArgument:
182
112
  Exclude:
183
113
  - 'lib/suma/svg_quality.rb'
184
114
 
185
- # Offense count: 32
115
+ # Offense count: 24
186
116
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
187
117
  Metrics/AbcSize:
188
118
  Exclude:
@@ -202,13 +132,14 @@ Metrics/AbcSize:
202
132
  - 'lib/suma/term_extractor.rb'
203
133
  - 'lib/suma/thor_ext.rb'
204
134
 
205
- # Offense count: 3
206
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
135
+ # Offense count: 2
136
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
207
137
  # AllowedMethods: refine
208
138
  Metrics/BlockLength:
209
- Max: 58
139
+ Exclude:
140
+ - 'lib/suma/term_extractor.rb'
210
141
 
211
- # Offense count: 14
142
+ # Offense count: 8
212
143
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
213
144
  Metrics/CyclomaticComplexity:
214
145
  Exclude:
@@ -217,32 +148,47 @@ Metrics/CyclomaticComplexity:
217
148
  - 'lib/suma/express_schema.rb'
218
149
  - 'lib/suma/jsdai/figure.rb'
219
150
  - 'lib/suma/jsdai/figure_image.rb'
220
- - 'lib/suma/link_validator.rb'
221
151
  - 'lib/suma/schema_comparer.rb'
222
152
  - 'lib/suma/svg_quality/formatters/terminal_formatter.rb'
223
- - 'lib/suma/term_extractor.rb'
224
153
  - 'lib/suma/thor_ext.rb'
225
154
 
226
- # Offense count: 31
227
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
155
+ # Offense count: 32
156
+ # Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
228
157
  Metrics/MethodLength:
229
- Max: 63
158
+ Exclude:
159
+ - 'spec/**/*'
160
+ - 'lib/suma/cli/check_svg_quality.rb'
161
+ - 'lib/suma/cli/core.rb'
162
+ - 'lib/suma/cli/reformat.rb'
163
+ - 'lib/suma/eengine/wrapper.rb'
164
+ - 'lib/suma/link_validation.rb'
165
+ - 'lib/suma/link_validator.rb'
166
+ - 'lib/suma/note_processor.rb'
167
+ - 'lib/suma/processor.rb'
168
+ - 'lib/suma/register_manifest_generator.rb'
169
+ - 'lib/suma/schema_collection.rb'
170
+ - 'lib/suma/schema_comparer.rb'
171
+ - 'lib/suma/schema_manifest_generator.rb'
172
+ - 'lib/suma/staged_collection_builder.rb'
173
+ - 'lib/suma/svg_quality/formatters/terminal_formatter.rb'
174
+ - 'lib/suma/term_extractor.rb'
230
175
 
231
176
  # Offense count: 3
232
- # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
177
+ # Configuration parameters: Max, CountKeywordArgs, MaxOptionalParameters.
233
178
  Metrics/ParameterLists:
234
- Max: 9
179
+ Exclude:
180
+ - 'lib/suma/cli/check_svg_quality.rb'
181
+ - 'lib/suma/link_validator.rb'
182
+ - 'lib/suma/register_manifest_generator.rb'
235
183
 
236
- # Offense count: 8
184
+ # Offense count: 4
237
185
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
238
186
  Metrics/PerceivedComplexity:
239
187
  Exclude:
240
188
  - 'lib/suma/eengine/wrapper.rb'
241
189
  - 'lib/suma/jsdai/figure_image.rb'
242
- - 'lib/suma/link_validator.rb'
243
190
  - 'lib/suma/schema_comparer.rb'
244
191
  - 'lib/suma/svg_quality/formatters/terminal_formatter.rb'
245
- - 'lib/suma/term_extractor.rb'
246
192
 
247
193
  # Offense count: 1
248
194
  # Configuration parameters: Mode, AllowedMethods, AllowedPatterns, AllowBangMethods, WaywardPredicates.
@@ -252,17 +198,6 @@ Naming/PredicateMethod:
252
198
  Exclude:
253
199
  - 'lib/suma/eengine/wrapper.rb'
254
200
 
255
- # Offense count: 1
256
- # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros, UseSorbetSigs.
257
- # NamePrefix: is_, has_, have_, does_
258
- # ForbiddenPrefixes: is_, has_, have_, does_
259
- # AllowedMethods: is_a?
260
- # MethodDefinitionMacros: define_method, define_singleton_method
261
- Naming/PredicatePrefix:
262
- Exclude:
263
- - 'spec/**/*'
264
- - 'lib/suma/term_extractor.rb'
265
-
266
201
  # Offense count: 2
267
202
  # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
268
203
  # SupportedStyles: snake_case, normalcase, non_integer
@@ -286,10 +221,41 @@ RSpec/ContextWording:
286
221
  Exclude:
287
222
  - 'spec/suma/cli/export_spec.rb'
288
223
 
289
- # Offense count: 111
290
- # Configuration parameters: CountAsOne.
224
+ # Offense count: 136
225
+ # Configuration parameters: Max, CountAsOne.
291
226
  RSpec/ExampleLength:
292
- Max: 60
227
+ Exclude:
228
+ - 'spec/suma/cli/export_spec.rb'
229
+ - 'spec/suma/cli/extract_terms_spec.rb'
230
+ - 'spec/suma/cli/generate_register_spec.rb'
231
+ - 'spec/suma/cli/generate_schemas_spec.rb'
232
+ - 'spec/suma/cli/reformat_spec.rb'
233
+ - 'spec/suma/cli_spec.rb'
234
+ - 'spec/suma/collection_config_spec.rb'
235
+ - 'spec/suma/collection_manifest_spec.rb'
236
+ - 'spec/suma/eengine_converter_spec.rb'
237
+ - 'spec/suma/express_reformatter_spec.rb'
238
+ - 'spec/suma/express_schema_spec.rb'
239
+ - 'spec/suma/jsdai/figure_spec.rb'
240
+ - 'spec/suma/link_validation_spec.rb'
241
+ - 'spec/suma/link_validator/step_spec.rb'
242
+ - 'spec/suma/link_validator_spec.rb'
243
+ - 'spec/suma/manifest_traverser_spec.rb'
244
+ - 'spec/suma/note_processor_spec.rb'
245
+ - 'spec/suma/processor_spec.rb'
246
+ - 'spec/suma/register_manifest_generator_spec.rb'
247
+ - 'spec/suma/schema_category_spec.rb'
248
+ - 'spec/suma/schema_comparer_integration_spec.rb'
249
+ - 'spec/suma/schema_comparer_spec.rb'
250
+ - 'spec/suma/schema_compiler_spec.rb'
251
+ - 'spec/suma/schema_discovery_spec.rb'
252
+ - 'spec/suma/schema_exporter_spec.rb'
253
+ - 'spec/suma/schema_template_spec.rb'
254
+ - 'spec/suma/site_config/config_spec.rb'
255
+ - 'spec/suma/svg_quality/scanner_spec.rb'
256
+ - 'spec/suma/term_classification_spec.rb'
257
+ - 'spec/suma/term_extractor_spec.rb'
258
+ - 'spec/suma/urn_spec.rb'
293
259
 
294
260
  # Offense count: 4
295
261
  # Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
@@ -311,20 +277,53 @@ RSpec/IteratedExpectation:
311
277
  - 'spec/suma/schema_comparer_integration_spec.rb'
312
278
 
313
279
  # Offense count: 1
314
- # Configuration parameters: EnforcedStyle.
280
+ # Configuration parameters: .
315
281
  # SupportedStyles: have_received, receive
316
282
  RSpec/MessageSpies:
317
- Exclude:
318
- - 'spec/suma/schema_comparer_integration_spec.rb'
283
+ EnforcedStyle: receive
319
284
 
320
- # Offense count: 87
285
+ # Offense count: 117
286
+ # Configuration parameters: Max.
321
287
  RSpec/MultipleExpectations:
322
- Max: 21
288
+ Exclude:
289
+ - 'spec/suma/cli/build_spec.rb'
290
+ - 'spec/suma/cli/export_spec.rb'
291
+ - 'spec/suma/cli/expressir_spec.rb'
292
+ - 'spec/suma/cli/extract_terms_spec.rb'
293
+ - 'spec/suma/cli/reformat_spec.rb'
294
+ - 'spec/suma/cli_spec.rb'
295
+ - 'spec/suma/collection_config_spec.rb'
296
+ - 'spec/suma/collection_manifest_spec.rb'
297
+ - 'spec/suma/eengine_converter_spec.rb'
298
+ - 'spec/suma/eengine_spec.rb'
299
+ - 'spec/suma/express_reformatter_spec.rb'
300
+ - 'spec/suma/express_schema_spec.rb'
301
+ - 'spec/suma/jsdai/figure_spec.rb'
302
+ - 'spec/suma/link_validation_spec.rb'
303
+ - 'spec/suma/link_validator/step_spec.rb'
304
+ - 'spec/suma/link_validator_spec.rb'
305
+ - 'spec/suma/manifest_traverser_spec.rb'
306
+ - 'spec/suma/note_processor_spec.rb'
307
+ - 'spec/suma/processor_spec.rb'
308
+ - 'spec/suma/register_manifest_generator_spec.rb'
309
+ - 'spec/suma/schema_category_spec.rb'
310
+ - 'spec/suma/schema_comparer_integration_spec.rb'
311
+ - 'spec/suma/schema_compiler_spec.rb'
312
+ - 'spec/suma/schema_discovery_spec.rb'
313
+ - 'spec/suma/schema_exporter_spec.rb'
314
+ - 'spec/suma/schema_index_spec.rb'
315
+ - 'spec/suma/schema_template_spec.rb'
316
+ - 'spec/suma/site_config/config_spec.rb'
317
+ - 'spec/suma/staged_collection_builder_spec.rb'
318
+ - 'spec/suma/svg_quality/scanner_spec.rb'
319
+ - 'spec/suma/term_classification_spec.rb'
320
+ - 'spec/suma/term_extractor_spec.rb'
323
321
 
324
322
  # Offense count: 3
325
- # Configuration parameters: AllowedGroups.
323
+ # Configuration parameters: Max, AllowedGroups.
326
324
  RSpec/NestedGroups:
327
- Max: 4
325
+ Exclude:
326
+ - 'spec/suma/express_schema_spec.rb'
328
327
 
329
328
  # Offense count: 1
330
329
  # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
@@ -338,31 +337,3 @@ RSpec/SpecFilePathFormat:
338
337
  RSpec/StubbedMock:
339
338
  Exclude:
340
339
  - 'spec/suma/schema_comparer_integration_spec.rb'
341
-
342
- # Offense count: 9
343
- # This cop supports safe autocorrection (--autocorrect).
344
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
345
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
346
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
347
- # FunctionalMethods: let, let!, subject, watch
348
- # AllowedMethods: lambda, proc, it
349
- Style/BlockDelimiters:
350
- Exclude:
351
- - 'lib/suma/link_validator.rb'
352
- - 'lib/suma/register_manifest_generator.rb'
353
- - 'spec/suma/term_extractor_spec.rb'
354
-
355
- # Offense count: 4
356
- # This cop supports safe autocorrection (--autocorrect).
357
- Style/MultilineIfModifier:
358
- Exclude:
359
- - 'lib/suma/schema_comparer.rb'
360
- - 'lib/suma/schema_manifest_generator.rb'
361
- - 'lib/suma/schema_naming.rb'
362
-
363
- # Offense count: 1
364
- # Configuration parameters: AllowedMethods.
365
- # AllowedMethods: respond_to_missing?
366
- Style/OptionalBooleanParameter:
367
- Exclude:
368
- - 'lib/suma/cli/check_svg_quality.rb'
data/Gemfile CHANGED
@@ -6,7 +6,11 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "canon"
9
- # gem "metanorma", github: "metanorma/metanorma", branch: "main"
9
+ # Staged build (suma#94) needs the preserve_unresolved: / artifact_store_dir: /
10
+ # reinflate: render options from metanorma#578 (metanorma 2.5.0). Point at the
11
+ # feature branch until it is released; drop this once 2.5.0 is on rubygems.
12
+ gem "metanorma", github: "metanorma/metanorma",
13
+ branch: "feature/collection-incremental-resumable"
10
14
  # gem "metanorma-plugin-lutaml", github: "metanorma/metanorma-plugin-lutaml", branch: "main"
11
15
  # gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "main"
12
16
  gem "nokogiri"
@@ -12,6 +12,10 @@ module Suma
12
12
  desc: "Compile or skip compile of collection"
13
13
  option :schemas_all_path, type: :string, aliases: "-s",
14
14
  desc: "Generate file that contains all schemas in the collection."
15
+ option :staged, type: :boolean, default: false,
16
+ desc: "Memory-bounded staged build: compile each member in " \
17
+ "its own process (sequential) and reinflate. For large " \
18
+ "collections that OOM a single-process build (suma#94)."
15
19
 
16
20
  def build(metanorma_site_manifest)
17
21
  unless File.exist?(metanorma_site_manifest)
@@ -34,6 +38,7 @@ module Suma
34
38
  schemas_all_path: schemas_all_path,
35
39
  compile: options[:compile],
36
40
  output_directory: "_site",
41
+ staged: options[:staged],
37
42
  ).run
38
43
  end
39
44
 
data/lib/suma/cli/core.rb CHANGED
@@ -40,14 +40,42 @@ module Suma
40
40
  desc "extract-terms SCHEMA_MANIFEST_FILE GLOSSARIST_OUTPUT_PATH",
41
41
  "Extract terms from SCHEMA_MANIFEST_FILE into " \
42
42
  "Glossarist v3 format"
43
- def extract_terms(_schema_manifest_file, _glossarist_output_path)
44
- Cli::ExtractTerms.start
43
+ option :urn, type: :string, required: true, aliases: "-u",
44
+ desc: "URN for the dataset source " \
45
+ "(used for section references)"
46
+ option :language_code, type: :string, default: "eng", aliases: "-l",
47
+ desc: "Language code for the Glossarist"
48
+ def extract_terms(schema_manifest_file, glossarist_output_path)
49
+ TermExtractor.new(
50
+ schema_manifest_file,
51
+ glossarist_output_path,
52
+ urn: options[:urn],
53
+ language_code: options[:language_code],
54
+ ).call
45
55
  end
46
56
 
47
57
  desc "generate-register SCHEMA_MANIFEST_FILE OUTPUT_PATH",
48
58
  "Generate a Glossarist register.yaml with hierarchical sections"
49
- def generate_register(_schema_manifest_file, _output_path)
50
- Cli::GenerateRegister.start
59
+ option :urn, type: :string, required: true, aliases: "-u",
60
+ desc: "URN prefix for the dataset"
61
+ option :id, type: :string, required: true,
62
+ desc: "Dataset identifier (e.g. iso10303-2-express)"
63
+ option :ref, type: :string, required: true,
64
+ desc: "Human-readable reference label"
65
+ option :language_code, type: :string, default: "eng", aliases: "-l",
66
+ desc: "Language code for section names"
67
+ option :owner, type: :string, default: Suma::RegisterManifestGenerator::DEFAULT_OWNER,
68
+ desc: "Owner of the dataset (e.g. 'ISO/TC 184/SC 4')"
69
+ def generate_register(schema_manifest_file, output_path)
70
+ RegisterManifestGenerator.new(
71
+ schema_manifest_file,
72
+ output_path,
73
+ urn: options[:urn],
74
+ id: options[:id],
75
+ ref: options[:ref],
76
+ language_code: options[:language_code],
77
+ owner: options[:owner],
78
+ ).generate
51
79
  end
52
80
 
53
81
  desc "convert-jsdai XML_FILE IMAGE_FILE OUTPUT_DIR",
@@ -3,24 +3,25 @@
3
3
  require "expressir/commands/changes_import_eengine"
4
4
 
5
5
  module Suma
6
- # Converts eengine comparison XML to Expressir::Changes::SchemaChange
7
- # This is a thin wrapper around Expressir's ChangesImportEengine command
6
+ # Converts eengine comparison XML to Expressir::Changes::SchemaChange.
7
+ #
8
+ # Pure converter: takes XML content as a string (no I/O). The caller
9
+ # is responsible for reading the file. This keeps the object cheap
10
+ # to construct and easy to test in isolation — no fixture file
11
+ # required just to instantiate.
8
12
  class EengineConverter
9
- def initialize(xml_path, schema_name)
10
- @xml_path = xml_path
13
+ def initialize(schema_name, xml_content)
11
14
  @schema_name = schema_name
12
- @xml_content = File.read(xml_path)
15
+ @xml_content = xml_content
13
16
  end
14
17
 
15
- # Convert the eengine XML to a ChangeSchema
18
+ # Convert the eengine XML to a ChangeSchema.
16
19
  #
17
20
  # @param version [String] Version number for this change version
18
21
  # @param existing_change_schema [Expressir::Changes::SchemaChange, nil]
19
22
  # Existing schema to append to, or nil to create new
20
23
  # @return [Expressir::Changes::SchemaChange] The updated change schema
21
24
  def convert(version:, existing_change_schema: nil)
22
- # Use Expressir's built-in conversion which properly handles
23
- # HTML elements in descriptions
24
25
  Expressir::Commands::ChangesImportEengine.from_xml(
25
26
  @xml_content,
26
27
  @schema_name,