expressir 2.4.4 → 2.4.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: faa2eff1343ffba0a34111f1b9c48f2ea65fc8585da64b15844e39cd413b067f
4
- data.tar.gz: 34ad23a65dabd3806206cf741c4e19d468bad9f6c566b89c0af10c594e0ca99b
3
+ metadata.gz: 2b92ce4a74f26a9a05edb583616053db6229b64705bbde94435fa5e6e326e84b
4
+ data.tar.gz: 1d3fa87cf6305caf6c4dffe592be2927b4a7101c993bcd5a3fdcecdb8c595ab7
5
5
  SHA512:
6
- metadata.gz: 05d55fe19517184f73d6f97815be45fef28a7c8d84360ee8a83288e2d0de63671f8fd5715bd4e14c0154cc731d3531871ebeccf83a52c41d6dc1f6dc412e433f
7
- data.tar.gz: fc4a6d27fde05257a4b8023ed7507caecdbbb6f79a28f32085ce17c79d1f30428bae762d70b80906f3b6e1e8a46237e7fe5a6ab2d67f407b8fc5cf0c86bf8864
6
+ metadata.gz: 5b3a8686a796910f01abb565a00fdb995e4d5b14f159941eeddbdecdba1b5c4ec793b4c17e3231113e8342e1d62f91d9b778acb1d1b0c7398abc5780d60a32bc
7
+ data.tar.gz: a5df0468bd977b6ac6cca9abbddbd60b8c8cee60149f5584132b7e2d2bc62aabe9d586237fb04200ae1232cc23c06592150b1071cfae5dfd2de0eacc54579148
data/README.adoc CHANGED
@@ -213,6 +213,7 @@ Commands:
213
213
  expressir clean PATH # Strip remarks and prettify EXPRESS schema at PATH
214
214
  expressir expand PATH # Concatenate the interface closure into one .exp
215
215
  expressir flatten PATH # Flatten the interface closure into an ISO 10303-11:1994 longform schema
216
+ expressir fix PATH # Rewrite self-schema-qualified references (#125)
216
217
  expressir format PATH # pretty print EXPRESS schema located at PATH
217
218
  expressir help [COMMAND] # Describe available commands or one specific command
218
219
  expressir validate load *PATH # validate EXPRESS schema located at PATH
@@ -527,10 +528,18 @@ expressir expand schemas/resources/action_schema/action_schema.exp \
527
528
  |===
528
529
  | Option | Description
529
530
  | `--output PATH`, `-o PATH` | Write the artifact to PATH (defaults to stdout)
531
+ | `--manifest PATH` | ELF schema manifest YAML defining where schemas live (primary
532
+ resolution mode)
533
+ | `--stepmod DIR` | STEPmod checkout root — explicit opt-in to directory-convention
534
+ resolution as the fallback
530
535
  |===
531
536
 
532
537
  The closure is resolved by scanning `USE FROM` / `REFERENCE FROM` names in the
533
- root source and looking them up in the same directory.
538
+ root source. Schema resolution order: `--manifest PATH` (an ELF schema
539
+ manifest — explicit, layout-independent) first; `--stepmod DIR` (the STEPmod
540
+ directory convention) as an explicit fallback; otherwise the file's own
541
+ directory, with a failed lookup warning and pointing at the two explicit
542
+ modes.
534
543
 
535
544
  === Flatten schema (SHTOLO longform)
536
545
 
@@ -551,8 +560,35 @@ expressir flatten schemas/resources/action_schema/action_schema.exp \
551
560
  | Option | Description
552
561
  | `--output PATH`, `-o PATH` | Write the longform schema to PATH (defaults to stdout)
553
562
  | `--longform_name ID` | Identifier for the resulting SCHEMA (default: `<root>_lf`)
563
+ | `--extenders all|none` | `all` (default, the WG12 requirement): fold every extensible
564
+ SELECT/ENUMERATION extension in the closure into its base type — for
565
+ `EXTENSIBLE GENERIC_ENTITY SELECT` that means every entity the closure
566
+ carries. `none`: leave extensible types exactly as declared.
567
+ | `--manifest PATH` | ELF schema manifest YAML defining where schemas live (primary
568
+ resolution mode)
569
+ | `--stepmod DIR` | STEPmod checkout root — explicit opt-in to directory-convention
570
+ resolution as the fallback
554
571
  |===
555
572
 
573
+ The longform output is verified against Express Engine: for
574
+ `description_assignment`, `eengine --compare` of our longform against
575
+ eengine's own reference artifact reports *No differences detected*
576
+ (`spec/expressir/express/shtolo_eengine_oracle_differential_spec.rb`).
577
+
578
+ === Fix schema (self-schema references)
579
+
580
+ The `fix` command rewrites string literals that qualify an item with the
581
+ CURRENT schema's name — `'THIS_SCHEMA.ITEM'` inside THIS_SCHEMA is
582
+ technically incorrect: the item usually comes from another schema,
583
+ imported implicitly through a USEd supertype. Local items drop the
584
+ prefix; foreign items gain their true defining schema
585
+ (`'GEOMETRY_SCHEMA.B_SPLINE_SURFACE'`); unknown items are left untouched.
586
+
587
+ [source, sh]
588
+ ----
589
+ expressir fix schemas/aic_topologically_bounded_surface.exp --output fixed.exp
590
+ ----
591
+
556
592
  === Validate schema
557
593
 
558
594
  The `validate load` command performs validation checks on EXPRESS schema files.
@@ -597,6 +633,10 @@ expressir validate check schemas/resources/action_schema/action_schema.exp
597
633
  # Check all .exp files under a directory
598
634
  expressir validate check schemas/resources/
599
635
 
636
+ # Resolve the closure through an ELF schema manifest (or --stepmod DIR)
637
+ expressir validate check modules/description_assignment/mim.exp \
638
+ --manifest schemas-srl.yaml
639
+
600
640
  # Exit 1 when any :error note fires
601
641
  expressir validate check schemas/resources/action_schema/action_schema.exp
602
642
  ----
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Express
5
+ # HyperlinkFormatter variant emitting AsciiDoc xref macros instead
6
+ # of the legacy stepmod +{{{<<express:...>>}}}+ markup: a reference
7
+ # to schema.item renders as +<<schema.item,item>>+, the anchor
8
+ # namespace schema document pages emit (expressir #255 / iso-10303
9
+ # #41). With +subs="+macros"+ source blocks the links go live.
10
+ module AdocHyperlinkFormatter
11
+ # @!visibility private
12
+ def self.included(mod)
13
+ unless mod.superclass <= Expressir::Express::Formatter
14
+ raise Error::FormatterMethodMissingError.new("AdocHyperlinkFormatter",
15
+ "format_references_simple_reference")
16
+ end
17
+ end
18
+
19
+ def format_references_simple_reference(node)
20
+ return node.id unless node.base_path
21
+
22
+ parts = node.base_path.split(".")
23
+ return node.id if parts.size < 2
24
+
25
+ anchor = parts[-2, 2].join(".")
26
+ "<<#{anchor},#{node.id}>>"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Expressir
4
+ module Express
5
+ # Pre-built Formatter subclass rendering the FULL schema with
6
+ # cross-references as AsciiDoc xref macros — the document-page
7
+ # counterpart of SourceFormatter (Schema#formatted_hyperlinked_adoc).
8
+ class AdocSourceFormatter < Formatter
9
+ include AdocHyperlinkFormatter
10
+ end
11
+ end
12
+ end
@@ -10,6 +10,8 @@ module Expressir
10
10
 
11
11
  # Core classes (autoloaded for lazy loading)
12
12
  autoload :Cache, "#{__dir__}/express/cache"
13
+ autoload :AdocHyperlinkFormatter, "#{__dir__}/express/adoc_hyperlink_formatter"
14
+ autoload :AdocSourceFormatter, "#{__dir__}/express/adoc_source_formatter"
13
15
  autoload :Checker, "#{__dir__}/express/checker"
14
16
  autoload :Concatenator, "#{__dir__}/express/concatenator"
15
17
  autoload :Core, "#{__dir__}/express/core"
@@ -59,6 +59,8 @@ module Expressir
59
59
  liquid do
60
60
  map :header, to: :header
61
61
  map :formatted, to: :formatted
62
+ map :formatted_hyperlinked, to: :formatted_hyperlinked
63
+ map :formatted_hyperlinked_adoc, to: :formatted_hyperlinked_adoc
62
64
  map :source, to: :source
63
65
  map :source_hyperlinked, to: :source_hyperlinked
64
66
  map :full_source, to: :full_source
@@ -111,6 +113,20 @@ module Expressir
111
113
  Expressir::Express::SchemaSourceFormatter.format(self)
112
114
  end
113
115
 
116
+ # FULL schema text with cross-references rendered as hyperlinks
117
+ # — what a schema document page renders (#255): every line of
118
+ # the schema, live links included.
119
+ def formatted_hyperlinked
120
+ @formatted_hyperlinked ||= Expressir::Express::SourceFormatter.format(self)
121
+ end
122
+
123
+ # FULL schema text with cross-references as AsciiDoc xref macros
124
+ # (+<<schema.item,item>>+) — drop-in for a schema document page
125
+ # rendered through a +subs="+macros"+ source block.
126
+ def formatted_hyperlinked_adoc
127
+ @formatted_hyperlinked_adoc ||= Expressir::Express::AdocSourceFormatter.format(self)
128
+ end
129
+
114
130
  private
115
131
 
116
132
  # @param [String] id
@@ -3,6 +3,6 @@ module Expressir
3
3
  # autoload it (Ruby autoload only works for module/class constants, not
4
4
  # for string constants like `Expressir::VERSION`).
5
5
  module Version
6
- VERSION = "2.4.4".freeze
6
+ VERSION = "2.4.5".freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
@@ -436,6 +436,8 @@ files:
436
436
  - lib/expressir/eengine/modified_object.rb
437
437
  - lib/expressir/errors.rb
438
438
  - lib/expressir/express.rb
439
+ - lib/expressir/express/adoc_hyperlink_formatter.rb
440
+ - lib/expressir/express/adoc_source_formatter.rb
439
441
  - lib/expressir/express/ast_key_converter.rb
440
442
  - lib/expressir/express/builder.rb
441
443
  - lib/expressir/express/builder_context.rb