expressir 2.1.27 → 2.1.28

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: 79f9083d84c90911c68536e3f07c4a2ebeb7675bca18d445b7af90d9ece6e7ee
4
- data.tar.gz: 69e648f694b883906a32fc316219db79dbaa053c2633a4543cd4b62673a9f88d
3
+ metadata.gz: 2818d10a5113fdafcb93fef22c7520b2747b0aa6767003239e99266fbe28aacb
4
+ data.tar.gz: 04d9cc82b902107a07f93114ee0a59f551a0969e158e0fa50a125d49d92dd097
5
5
  SHA512:
6
- metadata.gz: d9cc037357c9803c739a486089fc69b4799b1ba02f5f9de51216175447765f0e650dc02f8c525d2c4be8a3ea38e2ac953c5ef22e530ce4fea1f42f902eead456
7
- data.tar.gz: aca50dfe25f95e07453607f76df4ca532a3c3e97f8d95af08442c5a5ff402434a80e3fa6b2f8147992b72fefbaa1c3b9487f001095960b605abd5a3cfecd2bf1
6
+ metadata.gz: b435f41cfa13599b1547769c1052c2e9ac800f86c3282ad6ef0a5608ba77b0ee86bf31fceed7c21595019aa79e87c8327f001dea6d03ba14d1dea7a024adc5a8
7
+ data.tar.gz: 6c93af83e066f0288d41ec7552b4d512a0aa29626dfb8101f7268e92741989704e4131fbf76a976088b05a22187a952459461764bc18cda1f624380a46c92faf
data/.rubocop_todo.yml CHANGED
@@ -1,120 +1,23 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-10-12 15:55:59 UTC using RuboCop version 1.81.1.
3
+ # on 2025-10-13 04:55:00 UTC using RuboCop version 1.81.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
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 9
10
- # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: EnforcedStyle, IndentationWidth.
12
- # SupportedStyles: with_first_argument, with_fixed_indentation
13
- Layout/ArgumentAlignment:
14
- Exclude:
15
- - 'lib/expressir/commands/changes.rb'
16
- - 'spec/expressir/changes/schema_change_spec.rb'
17
- - 'spec/expressir/commands/changes_import_eengine_spec.rb'
18
- - 'spec/expressir/commands/changes_validate_spec.rb'
19
-
20
- # Offense count: 1
21
- # This cop supports safe autocorrection (--autocorrect).
22
- # Configuration parameters: EnforcedStyleAlignWith.
23
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
24
- Layout/BlockAlignment:
25
- Exclude:
26
- - 'lib/expressir/changes/schema_change.rb'
27
-
28
- # Offense count: 1
29
- # This cop supports safe autocorrection (--autocorrect).
30
- Layout/BlockEndNewline:
31
- Exclude:
32
- - 'lib/expressir/changes/schema_change.rb'
33
-
34
- # Offense count: 1
35
- # This cop supports safe autocorrection (--autocorrect).
36
- # Configuration parameters: AllowForAlignment.
37
- Layout/CommentIndentation:
38
- Exclude:
39
- - 'lib/expressir/commands/changes_validate.rb'
40
-
41
- # Offense count: 2
42
- # This cop supports safe autocorrection (--autocorrect).
43
- Layout/ElseAlignment:
44
- Exclude:
45
- - 'lib/expressir/commands/changes_validate.rb'
46
-
47
- # Offense count: 2
48
- # This cop supports safe autocorrection (--autocorrect).
49
- # Configuration parameters: EnforcedStyle.
50
- # SupportedStyles: empty_lines, no_empty_lines
51
- Layout/EmptyLinesAroundBlockBody:
52
- Exclude:
53
- - 'bin/validate_all_changes'
54
-
55
- # Offense count: 1
56
- # This cop supports safe autocorrection (--autocorrect).
57
- # Configuration parameters: EnforcedStyleAlignWith, Severity.
58
- # SupportedStylesAlignWith: keyword, variable, start_of_line
59
- Layout/EndAlignment:
60
- Exclude:
61
- - 'lib/expressir/commands/changes_validate.rb'
62
-
63
- # Offense count: 12
64
- # This cop supports safe autocorrection (--autocorrect).
65
- # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
66
- # SupportedHashRocketStyles: key, separator, table
67
- # SupportedColonStyles: key, separator, table
68
- # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
69
- Layout/HashAlignment:
70
- Exclude:
71
- - 'lib/expressir/commands/changes.rb'
72
- - 'spec/expressir/changes/schema_change_spec.rb'
73
- - 'spec/expressir/commands/changes_validate_spec.rb'
74
-
75
- # Offense count: 6
76
- # This cop supports safe autocorrection (--autocorrect).
77
- # Configuration parameters: Width, AllowedPatterns.
78
- Layout/IndentationWidth:
79
- Exclude:
80
- - 'bin/validate_all_changes'
81
- - 'lib/expressir/changes/schema_change.rb'
82
- - 'lib/expressir/commands/changes_validate.rb'
83
-
84
- # Offense count: 574
9
+ # Offense count: 565
85
10
  # This cop supports safe autocorrection (--autocorrect).
86
11
  # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
87
12
  # URISchemes: http, https
88
13
  Layout/LineLength:
89
14
  Enabled: false
90
15
 
91
- # Offense count: 1
92
- # This cop supports safe autocorrection (--autocorrect).
93
- Layout/RescueEnsureAlignment:
94
- Exclude:
95
- - 'bin/validate_all_changes'
96
-
97
- # Offense count: 8
98
- # This cop supports safe autocorrection (--autocorrect).
99
- # Configuration parameters: AllowInHeredoc.
100
- Layout/TrailingWhitespace:
101
- Exclude:
102
- - 'bin/validate_all_changes'
103
- - 'lib/expressir/commands/changes.rb'
104
- - 'spec/expressir/changes/schema_change_spec.rb'
105
- - 'spec/expressir/commands/changes_import_eengine_spec.rb'
106
- - 'spec/expressir/commands/changes_validate_spec.rb'
107
-
108
- # Offense count: 4
109
- # This cop supports safe autocorrection (--autocorrect).
110
- Lint/AmbiguousOperatorPrecedence:
111
- Exclude:
112
- - 'bin/validate_all_changes'
113
-
114
- # Offense count: 1
16
+ # Offense count: 2
115
17
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
116
18
  Lint/DuplicateBranch:
117
19
  Exclude:
20
+ - 'lib/expressir/commands/changes_import_eengine.rb'
118
21
  - 'lib/expressir/coverage.rb'
119
22
 
120
23
  # Offense count: 2
@@ -131,11 +34,11 @@ Lint/UnusedMethodArgument:
131
34
  Metrics/AbcSize:
132
35
  Enabled: false
133
36
 
134
- # Offense count: 2
37
+ # Offense count: 1
135
38
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
136
39
  # AllowedMethods: refine
137
40
  Metrics/BlockLength:
138
- Max: 72
41
+ Max: 46
139
42
 
140
43
  # Offense count: 59
141
44
  # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
@@ -155,7 +58,7 @@ Metrics/CyclomaticComplexity:
155
58
  - 'lib/expressir/model/model_element.rb'
156
59
  - 'spec/support/model_element_helper.rb'
157
60
 
158
- # Offense count: 109
61
+ # Offense count: 110
159
62
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
160
63
  Metrics/MethodLength:
161
64
  Max: 106
@@ -194,7 +97,7 @@ Performance/MapMethodChain:
194
97
  - 'spec/expressir/commands/coverage_ignore_files_spec.rb'
195
98
  - 'spec/expressir/coverage_spec.rb'
196
99
 
197
- # Offense count: 122
100
+ # Offense count: 126
198
101
  # Configuration parameters: CountAsOne.
199
102
  RSpec/ExampleLength:
200
103
  Max: 123
@@ -210,13 +113,7 @@ RSpec/IndexedLet:
210
113
  - 'spec/expressir/model/data_types/set_spec.rb'
211
114
  - 'spec/expressir/model/data_types/string_spec.rb'
212
115
 
213
- # Offense count: 1
214
- # This cop supports safe autocorrection (--autocorrect).
215
- RSpec/IteratedExpectation:
216
- Exclude:
217
- - 'spec/expressir/schema_manifest_spec.rb'
218
-
219
- # Offense count: 254
116
+ # Offense count: 257
220
117
  RSpec/MultipleExpectations:
221
118
  Max: 114
222
119
 
@@ -237,23 +134,6 @@ RSpec/RepeatedExample:
237
134
  Exclude:
238
135
  - 'spec/expressir/model/data_types/logical_spec.rb'
239
136
 
240
- # Offense count: 2
241
- # This cop supports unsafe autocorrection (--autocorrect-all).
242
- Security/YAMLLoad:
243
- Exclude:
244
- - 'bin/validate_all_changes'
245
-
246
- # Offense count: 1
247
- # This cop supports safe autocorrection (--autocorrect).
248
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
249
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
250
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
251
- # FunctionalMethods: let, let!, subject, watch
252
- # AllowedMethods: lambda, proc, it
253
- Style/BlockDelimiters:
254
- Exclude:
255
- - 'lib/expressir/changes/schema_change.rb'
256
-
257
137
  # Offense count: 1
258
138
  # This cop supports safe autocorrection (--autocorrect).
259
139
  # Configuration parameters: EnforcedStyle, AllowComments.
@@ -269,57 +149,8 @@ Style/MissingRespondToMissing:
269
149
 
270
150
  # Offense count: 1
271
151
  # This cop supports unsafe autocorrection (--autocorrect-all).
272
- # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
273
- # SupportedStyles: predicate, comparison
274
- Style/NumericPredicate:
275
- Exclude:
276
- - 'spec/**/*'
277
- - 'lib/expressir/commands/changes_import_eengine.rb'
278
-
279
- # Offense count: 1
280
- # This cop supports safe autocorrection (--autocorrect).
281
- Style/RedundantBegin:
282
- Exclude:
283
- - 'bin/validate_all_changes'
284
-
285
- # Offense count: 4
286
- # This cop supports unsafe autocorrection (--autocorrect-all).
287
- # Configuration parameters: Mode.
288
- Style/StringConcatenation:
289
- Exclude:
290
- - 'bin/validate_all_changes'
291
-
292
- # Offense count: 4
293
- # This cop supports safe autocorrection (--autocorrect).
294
- # Configuration parameters: EnforcedStyle.
295
- # SupportedStyles: single_quotes, double_quotes
296
- Style/StringLiteralsInInterpolation:
297
- Exclude:
298
- - 'bin/validate_all_changes'
299
-
300
- # Offense count: 4
301
- # This cop supports safe autocorrection (--autocorrect).
302
- # Configuration parameters: EnforcedStyleForMultiline.
303
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
304
- Style/TrailingCommaInArguments:
305
- Exclude:
306
- - 'lib/expressir/changes/schema_change.rb'
307
- - 'lib/expressir/commands/changes_import_eengine.rb'
308
-
309
- # Offense count: 5
310
- # This cop supports safe autocorrection (--autocorrect).
311
- # Configuration parameters: EnforcedStyleForMultiline.
312
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
313
- Style/TrailingCommaInArrayLiteral:
314
- Exclude:
315
- - 'spec/expressir/changes/schema_change_spec.rb'
316
-
317
- # Offense count: 10
318
- # This cop supports safe autocorrection (--autocorrect).
319
- # Configuration parameters: EnforcedStyleForMultiline.
320
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
321
- Style/TrailingCommaInHashLiteral:
152
+ # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments.
153
+ # AllowedMethods: define_method
154
+ Style/SymbolProc:
322
155
  Exclude:
323
- - 'bin/validate_all_changes'
324
- - 'lib/expressir/commands/changes_import_eengine.rb'
325
- - 'spec/expressir/changes/schema_change_spec.rb'
156
+ - 'spec/expressir/commands/changes_import_eengine_spec.rb'
data/README.adoc CHANGED
@@ -729,6 +729,10 @@ This is useful for:
729
729
  The `changes import-eengine` command converts eengine comparison XML files to
730
730
  EXPRESS Changes YAML format.
731
731
 
732
+ The eengine compare XML format is created through
733
+ `exp-engine-engine/kernel/compare.lisp` in the EXPRESS Engine code. Expressir is
734
+ compatible with v5.2.7 of eengine output.
735
+
732
736
  [source, sh]
733
737
  ----
734
738
  # Import and output to stdout
@@ -754,7 +758,7 @@ expressir changes import-eengine comparison.xml schema_name "3" -o existing.yaml
754
758
  The import command:
755
759
 
756
760
  . Parses the eengine XML comparison file
757
- . Extracts additions, modifications, and removals
761
+ . Extracts additions, modifications, and deletions
758
762
  . Creates or updates an EXPRESS Changes YAML file
759
763
  . Supports appending new versions to existing files
760
764
 
@@ -1174,7 +1178,7 @@ The Changes module enables:
1174
1178
  * Loading and saving schema change records from/to YAML files
1175
1179
  * Programmatic creation and manipulation of change records
1176
1180
  * Smart edition handling (replace same version, add new version)
1177
- * Support for all change types: additions, modifications, removals, deletions
1181
+ * Support for all change types: additions, modifications, deletions
1178
1182
  * Support for mapping changes in ARM/MIM schemas
1179
1183
 
1180
1184
  === Reading change files
@@ -1192,14 +1196,13 @@ change_schema = Expressir::Changes::SchemaChange.from_file("schema.changes.yaml"
1192
1196
  puts "Schema: #{change_schema.schema}"
1193
1197
 
1194
1198
  # Iterate through change editions
1195
- change_schema.edition_change.each do |edition|
1199
+ change_schema.editions.each do |edition|
1196
1200
  puts "Version #{edition.version}: #{edition.description}"
1197
1201
 
1198
1202
  # Access changes by type
1199
1203
  puts " Additions: #{edition.additions.size}" if edition.additions
1200
1204
  puts " Modifications: #{edition.modifications.size}" if edition.modifications
1201
1205
  puts " Deletions: #{edition.deletions.size}" if edition.deletions
1202
- puts " Removals: #{edition.removals.size}" if edition.removals
1203
1206
  end
1204
1207
  ----
1205
1208
 
@@ -1210,7 +1213,7 @@ Create a new change schema programmatically:
1210
1213
  [source,ruby]
1211
1214
  ----
1212
1215
  # Create a new empty change schema
1213
- change_schema = Expressir::Changes::SchemaChange.create_new("my_schema")
1216
+ change_schema = Expressir::Changes::SchemaChange.new(schema: "my_schema")
1214
1217
 
1215
1218
  # Create change items
1216
1219
  new_entity = Expressir::Changes::ItemChange.new(
@@ -1228,7 +1231,7 @@ modified_function = Expressir::Changes::ItemChange.new(
1228
1231
  changes = {
1229
1232
  additions: [new_entity],
1230
1233
  modifications: [modified_function],
1231
- removals: []
1234
+ deletions: []
1232
1235
  }
1233
1236
 
1234
1237
  change_schema.add_or_update_edition(
@@ -1292,8 +1295,7 @@ Change editions support categorizing changes into:
1292
1295
 
1293
1296
  `additions`:: New elements added to the schema
1294
1297
  `modifications`:: Existing elements that were modified
1295
- `removals`:: Elements removed from the schema
1296
- `deletions`:: Alternative term for removals (both supported)
1298
+ `deletions`:: Elements removed from the schema
1297
1299
  `mapping`:: Mapping-related changes (for ARM/MIM modules)
1298
1300
  `changes`:: General changes (alternative to mapping)
1299
1301
 
@@ -1326,7 +1328,7 @@ mapping_change = Expressir::Changes::MappingChange.new(
1326
1328
  ----
1327
1329
  ---
1328
1330
  schema: support_resource_schema
1329
- edition_change:
1331
+ editions:
1330
1332
  - version: '2'
1331
1333
  description: |-
1332
1334
  The definitions of the following EXPRESS entity data types were modified:
data/expressir.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "csv"
37
37
  spec.add_dependency "liquid"
38
38
  spec.add_dependency "lutaml-model"
39
+ spec.add_dependency "moxml"
39
40
  spec.add_dependency "parslet", "~> 2.0"
40
41
  spec.add_dependency "ruby-progressbar", "~> 1.11"
41
42
  spec.add_dependency "table_tennis"
@@ -12,7 +12,6 @@ module Expressir
12
12
  attribute :description, :string
13
13
  attribute :additions, ItemChange, collection: true
14
14
  attribute :modifications, ItemChange, collection: true
15
- attribute :removals, ItemChange, collection: true
16
15
  attribute :deletions, ItemChange, collection: true
17
16
  attribute :mapping, MappingChange, collection: true
18
17
  attribute :changes, MappingChange, collection: true
@@ -22,7 +21,6 @@ module Expressir
22
21
  map "description", to: :description
23
22
  map "additions", to: :additions
24
23
  map "modifications", to: :modifications
25
- map "removals", to: :removals
26
24
  map "deletions", to: :deletions
27
25
  map "mapping", to: :mapping
28
26
  map "changes", to: :changes
@@ -8,11 +8,11 @@ module Expressir
8
8
  # Represents changes to an EXPRESS schema across multiple versions
9
9
  class SchemaChange < Lutaml::Model::Serializable
10
10
  attribute :schema, :string
11
- attribute :edition_change, EditionChange, collection: true
11
+ attribute :editions, EditionChange, collection: true
12
12
 
13
13
  yaml do
14
14
  map "schema", to: :schema
15
- map "edition_change", to: :edition_change
15
+ map "editions", to: :editions
16
16
  end
17
17
 
18
18
  class << self
@@ -23,31 +23,26 @@ module Expressir
23
23
  def from_file(path)
24
24
  content = File.read(path)
25
25
  # Handle empty or minimal YAML files
26
- return new(schema: "", edition_change: []) if content.strip == "---"
26
+ return new if content.strip == "---" || content.strip.empty?
27
27
 
28
28
  from_yaml(content)
29
29
  end
30
-
31
- # Create a new empty SchemaChange
32
- #
33
- # @param schema_name [String] Name of the schema
34
- # @return [SchemaChange] New instance with empty change editions
35
- def create_new(schema_name)
36
- new(schema: schema_name, edition_change: [])
37
- end
38
30
  end
39
31
 
40
32
  # Add or update a change edition in this schema
41
33
  #
42
34
  # @param version [String] Version number
43
35
  # @param description [String] Description of changes
44
- # @param changes [Hash] Hash with :additions, :modifications, :removals
36
+ # @param changes [Hash] Hash with :additions, :modifications, :deletions
45
37
  # @return [EditionChange] The added or updated edition
46
38
  def add_or_update_edition(version, description, changes)
47
39
  version_str = version.to_s
48
40
 
41
+ # Initialize editions array if nil
42
+ self.editions ||= []
43
+
49
44
  # Find existing edition with this version
50
- existing_index = edition_change.find_index do |ed|
45
+ existing_index = editions.find_index do |ed|
51
46
  ed.version == version_str
52
47
  end
53
48
 
@@ -57,16 +52,15 @@ module Expressir
57
52
  description: description,
58
53
  additions: changes[:additions] || [],
59
54
  modifications: changes[:modifications] || [],
60
- removals: changes[:removals] || [],
61
55
  deletions: changes[:deletions] || [],
62
56
  )
63
57
 
64
58
  if existing_index
65
59
  # Replace existing edition with same version
66
- edition_change[existing_index] = edition
60
+ editions[existing_index] = edition
67
61
  else
68
62
  # Add new edition
69
- edition_change << edition
63
+ editions << edition
70
64
  end
71
65
 
72
66
  edition
@@ -1,12 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "changes/schema_change"
4
- require_relative "changes/edition_change"
5
- require_relative "changes/item_change"
6
- require_relative "changes/mapping_change"
7
-
8
3
  module Expressir
9
4
  # Module for EXPRESS schema change tracking and management
10
5
  module Changes
11
6
  end
12
7
  end
8
+
9
+ require_relative "changes/schema_change"
10
+ require_relative "changes/mapping_change"
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "base"
4
- require "nokogiri"
4
+ require "moxml"
5
5
 
6
6
  module Expressir
7
7
  module Commands
@@ -14,18 +14,22 @@ module Expressir
14
14
  def call(input_file, output_file, schema_name, version, **options)
15
15
  require "expressir/changes"
16
16
 
17
- # Parse the eengine XML
18
- xml_doc = File.open(input_file) { |f| Nokogiri::XML(f) }
17
+ # Parse the eengine XML using Moxml
18
+ xml_content = File.read(input_file)
19
+ xml_doc = Moxml.new.parse(xml_content)
20
+
21
+ # Detect XML mode from root element
22
+ xml_mode = detect_xml_mode(xml_doc)
19
23
 
20
24
  # Extract changes from XML
21
- changes = extract_changes(xml_doc)
22
- description = generate_description(xml_doc)
25
+ changes = extract_changes(xml_doc, xml_mode)
26
+ description = generate_description(xml_doc, xml_mode)
23
27
 
24
28
  # Load or create change schema
25
29
  change_schema = if output_file && File.exist?(output_file) && File.size(output_file).positive?
26
30
  Expressir::Changes::SchemaChange.from_file(output_file)
27
31
  else
28
- Expressir::Changes::SchemaChange.create_new(schema_name)
32
+ Expressir::Changes::SchemaChange.new(schema: schema_name)
29
33
  end
30
34
 
31
35
  # Add or update edition
@@ -44,58 +48,84 @@ module Expressir
44
48
 
45
49
  private
46
50
 
47
- def extract_changes(xml_doc)
51
+ # Detect XML mode from root element (arm, mim, or schema)
52
+ def detect_xml_mode(xml_doc)
53
+ root = xml_doc.root
54
+ return nil unless root
55
+
56
+ case root.name
57
+ when "arm.changes"
58
+ "arm"
59
+ when "mim.changes"
60
+ "mim"
61
+ when "schema.changes"
62
+ "schema"
63
+ else
64
+ # Default to schema mode if unrecognized
65
+ "schema"
66
+ end
67
+ end
68
+
69
+ def extract_changes(xml_doc, xml_mode)
48
70
  {
49
- additions: extract_added_objects(xml_doc),
50
- modifications: extract_modified_objects(xml_doc),
51
- removals: extract_removed_objects(xml_doc),
71
+ additions: extract_added_objects(xml_doc, xml_mode),
72
+ modifications: extract_modified_objects(xml_doc, xml_mode),
73
+ deletions: extract_deleted_objects(xml_doc, xml_mode),
52
74
  }
53
75
  end
54
76
 
55
- def extract_modified_objects(xml_doc)
56
- xml_doc.xpath("//schema.modifications/modified.object").map do |node|
57
- Expressir::Changes::ItemChange.new(
58
- type: node["type"],
59
- name: node["name"],
60
- )
77
+ def extract_modified_objects(xml_doc, xml_mode)
78
+ xpath = "//#{xml_mode}.modifications/modified.object"
79
+ xml_doc.xpath(xpath).map do |node|
80
+ extract_item_change(node)
61
81
  end
62
82
  end
63
83
 
64
- def extract_added_objects(xml_doc)
65
- xml_doc.xpath("//schema.additions/added.object").map do |node|
66
- Expressir::Changes::ItemChange.new(
67
- type: node["type"],
68
- name: node["name"],
69
- )
84
+ def extract_added_objects(xml_doc, xml_mode)
85
+ xpath = "//#{xml_mode}.additions/modified.object"
86
+ xml_doc.xpath(xpath).map do |node|
87
+ extract_item_change(node)
70
88
  end
71
89
  end
72
90
 
73
- def extract_removed_objects(xml_doc)
74
- xml_doc.xpath("//schema.removals/removed.object").map do |node|
75
- Expressir::Changes::ItemChange.new(
76
- type: node["type"],
77
- name: node["name"],
78
- )
91
+ def extract_deleted_objects(xml_doc, xml_mode)
92
+ xpath = "//#{xml_mode}.deletions/modified.object"
93
+ xml_doc.xpath(xpath).map do |node|
94
+ extract_item_change(node)
79
95
  end
80
96
  end
81
97
 
82
- def generate_description(xml_doc)
98
+ def extract_item_change(node)
99
+ item_change = Expressir::Changes::ItemChange.new(
100
+ type: node["type"],
101
+ name: node["name"],
102
+ )
103
+
104
+ # Extract interfaced.items attribute if present (for interface changes)
105
+ if node["interfaced.items"]
106
+ item_change.interfaced_items = node["interfaced.items"]
107
+ end
108
+
109
+ item_change
110
+ end
111
+
112
+ def generate_description(xml_doc, xml_mode)
83
113
  parts = []
84
114
 
85
115
  # Get descriptions from modifications
86
- xml_doc.xpath("//schema.modifications/modified.object/description").each do |desc|
116
+ xml_doc.xpath("//#{xml_mode}.modifications/modified.object/description").each do |desc|
87
117
  text = desc.text.strip
88
118
  parts << text unless text.empty?
89
119
  end
90
120
 
91
121
  # Get descriptions from additions
92
- xml_doc.xpath("//schema.additions/added.object/description").each do |desc|
122
+ xml_doc.xpath("//#{xml_mode}.additions/modified.object/description").each do |desc|
93
123
  text = desc.text.strip
94
124
  parts << text unless text.empty?
95
125
  end
96
126
 
97
- # Get descriptions from removals
98
- xml_doc.xpath("//schema.removals/removed.object/description").each do |desc|
127
+ # Get descriptions from deletions
128
+ xml_doc.xpath("//#{xml_mode}.deletions/modified.object/description").each do |desc|
99
129
  text = desc.text.strip
100
130
  parts << text unless text.empty?
101
131
  end
@@ -31,7 +31,7 @@ module Expressir
31
31
 
32
32
  say "✓ File is valid" if options[:verbose]
33
33
  say " Schema: #{schema_change.schema}" if options[:verbose]
34
- say " Editions: #{schema_change.edition_change.length}" if options[:verbose]
34
+ say " Editions: #{schema_change.editions.length}" if options[:verbose]
35
35
 
36
36
  # Normalize if requested
37
37
  if options[:normalize]
@@ -1,3 +1,3 @@
1
1
  module Expressir
2
- VERSION = "2.1.27".freeze
2
+ VERSION = "2.1.28".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressir
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.27
4
+ version: 2.1.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-10-12 00:00:00.000000000 Z
11
+ date: 2025-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: moxml
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: parslet
85
99
  requirement: !ruby/object:Gem::Requirement