metanorma-document 0.2.4 → 0.2.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: afb9ddd75c55018b0ff15fb41d06a1eddc5fe7448a3841a5a7fd4d4061965756
4
- data.tar.gz: 52550547f425bbcab7fb88b940eda4798ae842240ec9b53e8c7052737128cfcd
3
+ metadata.gz: '08953283a82f46382002daac11ebb5befc241c798702b21d189db6943ba91f46'
4
+ data.tar.gz: 56e998c5b5b02599f863c29136491711f0dcb2b78da77c5c81bdc62967619e70
5
5
  SHA512:
6
- metadata.gz: effae9a6cd899788ea8f22a3fe78583a18094001d38e322f96c0a99cd8c78c1b24084f7ceb7514158474117dea01e471325a78c2ad0ffef30314ce2eca1f7157
7
- data.tar.gz: bdbd96deb4acee546290fbb5f3fbbb2ea7a2a9a608d0d34800c8fe6dfffc57b9063ac8ec00c7bdec5cedc5b1bccb7bfe0e5593f5ca642c3bc6aca19eaa4bc279
6
+ metadata.gz: acdce24a10e9919a5dd2396ed6c51a30387686671f3ec8e17125bfea76adaba020709007ff36cbbc9697e0a5c95e02155a4c8993f95406e895a2958d2d7b7bd6
7
+ data.tar.gz: 3d59fb7d487a8ac32042f4827054c1f2bd301359073bf27840a215f8eae267b91130232124041cec706662e189503b0206c8449cccf57dc562ff2cc6d1104598
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Metanorma
4
4
  module Document
5
- VERSION = "0.2.4"
5
+ VERSION = "0.2.5"
6
6
  Version = VERSION
7
7
  end
8
8
  end
@@ -109,7 +109,7 @@ module Metanorma
109
109
 
110
110
  def method_missing(method_name, *args, **kwargs, &block)
111
111
  if DELEGATED_METHODS.include?(method_name)
112
- @renderer.send(method_name, *args, **kwargs, &block)
112
+ @renderer.public_send(method_name, *args, **kwargs, &block)
113
113
  else
114
114
  super
115
115
  end
@@ -476,7 +476,7 @@ module Metanorma
476
476
  return escape_html(node) if node.is_a?(String)
477
477
 
478
478
  method = lookup_dispatch(node.class, :render_registry)
479
- method ? send(method, node, **) : ""
479
+ method ? public_send(method, node, **) : ""
480
480
  end
481
481
 
482
482
  # Dispatch to the appropriate inline render method via type registry.
@@ -486,7 +486,7 @@ module Metanorma
486
486
 
487
487
  method = lookup_dispatch(element.class, :inline_registry)
488
488
  if method
489
- send(method, element)
489
+ public_send(method, element)
490
490
  elsif element.is_a?(Lutaml::Model::Serializable) && element.mixed?
491
491
  render_mixed_inline(element)
492
492
  end
@@ -567,13 +567,11 @@ module Metanorma
567
567
  register_inline_render Metanorma::Document::Components::Inline::FmtIdentifierElement, :render_mixed_inline
568
568
  register_inline_render Metanorma::Document::Components::Inline::FmtSourcecodeElement, :render_mixed_inline
569
569
 
570
- private
571
-
572
570
  def lookup_dispatch(type_class, registry_method)
573
571
  self.class.ancestors.each do |ancestor|
574
- next unless ancestor.respond_to?(registry_method)
572
+ next unless ancestor.is_a?(Class) && (ancestor == BaseRenderer || ancestor < BaseRenderer)
575
573
 
576
- registry = ancestor.send(registry_method)
574
+ registry = ancestor.public_send(registry_method)
577
575
  method_name = registry[type_class]
578
576
  return method_name if method_name
579
577
  end
@@ -962,7 +960,7 @@ module Metanorma
962
960
  # Apply optional filter (used by semx to skip semantic attrs)
963
961
  next if allow_filter && !allow_filter.include?(attr_name)
964
962
 
965
- coll = node.send(attr_name)
963
+ coll = node.public_send(attr_name)
966
964
  obj = if coll.is_a?(Array)
967
965
  idx = indices[attr_name]
968
966
  indices[attr_name] += 1
@@ -1056,8 +1054,9 @@ module Metanorma
1056
1054
 
1057
1055
  def raw_content_node?(node)
1058
1056
  node.is_a?(Lutaml::Model::Serializable) &&
1059
- node.respond_to?(:content) &&
1060
1057
  node.content.is_a?(String)
1058
+ rescue NoMethodError
1059
+ false
1061
1060
  end
1062
1061
 
1063
1062
  # Iterate element_order directly, preserving whitespace text nodes
@@ -1494,7 +1493,9 @@ module Metanorma
1494
1493
  end
1495
1494
 
1496
1495
  def safe_attr(obj, method_name)
1497
- obj.public_send(method_name) if obj.respond_to?(method_name)
1496
+ obj.public_send(method_name)
1497
+ rescue NoMethodError
1498
+ nil
1498
1499
  end
1499
1500
 
1500
1501
  def collect_index_term(element)
@@ -154,8 +154,6 @@ module Metanorma
154
154
  val.strip.empty? ? nil : val
155
155
  end
156
156
 
157
- private
158
-
159
157
  # --- Top-level document rendering ---
160
158
 
161
159
  def render_document(doc, **_opts)
@@ -19,8 +19,6 @@ module Metanorma
19
19
  register_render Metanorma::StandardDocument::Sections::FloatingTitle, :render_floating_title
20
20
  register_render Metanorma::StandardDocument::Blocks::AmendBlock, :render_amend_block
21
21
 
22
- private
23
-
24
22
  # --- Top-level document rendering ---
25
23
 
26
24
  def render_standard_document(doc, **_opts)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-document
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
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-05-06 00:00:00.000000000 Z
11
+ date: 2026-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model