metanorma-plugin-lutaml 0.7.33 → 0.7.34

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: 249c6be1ae1a19967a906113b2142e3608e65ffc784e85bb990a7226b4818982
4
- data.tar.gz: 405ea5857dab3f2750d0ab8c4a27c9a0abc119f97dccbe0b67f143cfe780e754
3
+ metadata.gz: bdcd6f308c7b6b9aedf946aaf6c83524cc53fe0d861376b2f27488bdc66f03ea
4
+ data.tar.gz: 950763731a5d2712b15ae1f98fd06f173ffbab4e520243a8474ef652839455b5
5
5
  SHA512:
6
- metadata.gz: 3008f74df51c0ed75b44a87acc302ac0fcecf5e4e2501e7c55de8aac6023a7e247df13e088d554b217280c3329049c826768e3d5557cddbd63570810262d7d45
7
- data.tar.gz: bf0891bae566ccbeaacd9a98516e2495642d9629c8eed5adc8e9b4025338fe1fcfd7aa2c5555f2f0c4e2795d25a4e7ee98c760b7eaf486c16762efb4318533cb
6
+ metadata.gz: c7f843aa5286d1b952437b330749ade1854e510a33f2ec100e7a384c3049838f60fb099339c23c66ef54cad12c862ca29c7e5138eca3a8306ed326ba9e55e615
7
+ data.tar.gz: fbb5cbe113944fb2106143b8ad653dd39daca164df59b99b2564292132cd3b29c634c939589c4ce8de303aad30d9316b9e943ef6c3b90d3a71ff3258b60745fd
@@ -16,6 +16,7 @@ module Metanorma
16
16
  attribute :package_root_level, :integer
17
17
  attribute :render_nested_packages, :boolean
18
18
  attribute :external_classes, :hash
19
+ attribute :skip_unrecognized_connector, :boolean
19
20
 
20
21
  yaml do
21
22
  map "packages", to: :packages,
@@ -32,6 +33,7 @@ module Metanorma
32
33
  map "package_root_level", to: :package_root_level
33
34
  map "render_nested_packages", to: :render_nested_packages
34
35
  map "external_classes", to: :external_classes
36
+ map "skip_unrecognized_connector", to: :skip_unrecognized_connector
35
37
  end
36
38
 
37
39
  def packages_from_yaml(model, values) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
@@ -295,13 +295,9 @@ module Metanorma
295
295
  )
296
296
  root_package = package_level(lutaml_document.to_liquid,
297
297
  options.package_root_level || 1)
298
- contexts = {}
299
- contexts[context_name] = {
300
- "name" => root_package["name"],
301
- "root_packages" => [root_package],
302
- "additional_context" => additional_context
303
- .merge("external_classes" => options.external_classes),
304
- }
298
+ contexts = create_default_context_object(
299
+ context_name, root_package, additional_context, options
300
+ )
305
301
 
306
302
  if options.packages.nil?
307
303
  contexts[context_name]["render_nested_packages"] = true
@@ -316,14 +312,28 @@ module Metanorma
316
312
  "packages" => sort_and_filter_out_packages(all_packages, options),
317
313
  "package_entities" => package_hash(options, "render_entities"),
318
314
  "package_skip_sections" => package_hash(options, "skip_tables"),
319
- "render_nested_packages" => options.render_nested_packages ||
320
- false,
315
+ "render_nested_packages" => !!options.render_nested_packages,
321
316
  },
322
317
  )
323
318
 
324
319
  contexts
325
320
  end
326
321
 
322
+ def create_default_context_object(
323
+ context_name, root_package, additional_context, options
324
+ )
325
+ contexts = {}
326
+ contexts[context_name] = {
327
+ "name" => root_package["name"],
328
+ "root_packages" => [root_package],
329
+ "additional_context" => additional_context
330
+ .merge("external_classes" => options.external_classes),
331
+ "skip_unrecognized_connector" => !!options
332
+ .skip_unrecognized_connector,
333
+ }
334
+ contexts
335
+ end
336
+
327
337
  def package_hash(options, key)
328
338
  return {} unless options.packages
329
339
 
@@ -1,7 +1,7 @@
1
1
  module Metanorma
2
2
  module Plugin
3
3
  module Lutaml
4
- VERSION = "0.7.33".freeze
4
+ VERSION = "0.7.34".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plugin-lutaml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.33
4
+ version: 0.7.34
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-06-26 00:00:00.000000000 Z
11
+ date: 2025-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor