kramdown-rfc2629 1.7.26 → 1.7.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: 7aa2d98f6377652b1c5bf94a53831f65c4e454d4a8f293eef483b6541a323d36
4
- data.tar.gz: 5c04d3787a5f5624c437208eb8ace8016ba52a1e4b47390ee307581986918023
3
+ metadata.gz: 880af82027af212e74845c3ceb283ecc48954d3208ce7cee1209908604202052
4
+ data.tar.gz: 71397f5c1e959147bb5c7374cd8a03517bf8e77181640ac9e23d6b838a0e7d3e
5
5
  SHA512:
6
- metadata.gz: 3ffa19bbfc3366e71cae7b9614397d7c3ff03ac1dd151939ba20be94e1515f4cab8f6a7ec4be6fcb9e5a4c5a5640b660a5e347a7042a168ff8778e76db64d40b
7
- data.tar.gz: ca5898ccabb02316de20ff47c7a02e5035e8a38eee53f0d486e684b260e53204432470465d740fc8efdc045b9a51389c0f2d8eae92a15d9d1a3f52ab87de8784
6
+ metadata.gz: '018402d18f48ae61a425c84b320ff1a812c54bf568b1eadd93b6f9a619fd170927c49b4192fa455faf981c9a37dcf74542eb1aac791c2936aeeb8484a53e2cb0'
7
+ data.tar.gz: d5288a91a0d6a7979197ca585fe4f474bcc8868b0d2b56b3b0ef204df3da141c92d01992d46fe58240b12db7c152428856976965f584c59ac12269c22c24f481
@@ -1,6 +1,6 @@
1
1
  spec = Gem::Specification.new do |s|
2
2
  s.name = 'kramdown-rfc2629'
3
- s.version = '1.7.26'
3
+ s.version = '1.7.28'
4
4
  s.summary = "Kramdown extension for generating RFCXML (RFC 799x)."
5
5
  s.description = %{An RFCXML (RFC 799x) generating backend for Thomas Leitner's
6
6
  "kramdown" markdown parser. Mostly useful for RFC writers.}
@@ -268,6 +268,13 @@ end
268
268
 
269
269
  include ::Kramdown::Utils::Html
270
270
 
271
+ # Make this a method so there is a more speaking traceback if this fails
272
+ def read_erbfile
273
+ erbfilename = ENV["KRAMDOWN_ERB_FILE"] ||
274
+ File.expand_path('../../../data/kramdown-rfc2629.erb', __FILE__)
275
+ File.read(erbfilename, coding: "UTF-8")
276
+ end
277
+
271
278
  def xml_from_sections(input)
272
279
 
273
280
  unless ENV["KRAMDOWN_NO_SOURCE"]
@@ -436,8 +443,9 @@ def xml_from_sections(input)
436
443
 
437
444
  norm_ref.each do |k, v|
438
445
  # could check bibtagsys here: needed if open_refs is nil or string
439
- target = ps.has(v ? :normative : :informative)
440
- warn "*** overwriting #{k}" if target.has_key?(k)
446
+ kind = v ? :normative : :informative
447
+ target = ps.has(kind)
448
+ warn "** (#{kind} reference #{k} is both inline and in YAML header)" if target.has_key?(k)
441
449
  target[k] = open_refs[k] # add reference to normative/informative
442
450
  end
443
451
  # note that unused items from ref are considered OK, therefore no check for that here
@@ -509,8 +517,7 @@ def xml_from_sections(input)
509
517
  end
510
518
  end
511
519
 
512
- erbfilename = File.expand_path '../../../data/kramdown-rfc2629.erb', __FILE__
513
- erbfile = File.read(erbfilename, coding: "UTF-8")
520
+ erbfile = read_erbfile
514
521
  erb = ERB.trim_new(erbfile, '-')
515
522
  # remove redundant nomarkdown pop outs/pop ins as they confuse kramdown
516
523
  input = erb.result(binding).gsub(%r"{::nomarkdown}\s*{:/nomarkdown}"m, "")
@@ -7,7 +7,7 @@ module KramdownRFC
7
7
  if node.scalar?
8
8
  node.value
9
9
  else
10
- node.children&.map {short_name(_1)}&.join("_")
10
+ node.children&.map {|nm| short_name(nm)}&.join("_")
11
11
  end
12
12
  end
13
13
 
@@ -15,8 +15,8 @@ module KramdownRFC
15
15
  def self.check_dup_keys1(node, path)
16
16
  if YAML::Nodes::Mapping === node
17
17
  children = node.children.each_slice(2)
18
- duplicates = children.map { |key_node, _value_node|
19
- key_node }.group_by{short_name(_1)}.select { |_value, nodes| nodes.size > 1 }
18
+ duplicates = children.map { |key_node, _value_node|
19
+ key_node }.group_by{|nm| short_name(nm)}.select { |_value, nodes| nodes.size > 1 }
20
20
 
21
21
  duplicates.each do |key, nodes|
22
22
  name = (path + [key]).join("/")
@@ -24,7 +24,7 @@ module KramdownRFC
24
24
  warn "** duplicate map key >#{name}< in YAML, lines #{lines}"
25
25
  end
26
26
 
27
- children.each do |key_node, value_node|
27
+ children.each do |key_node, value_node|
28
28
  newname = short_name(key_node)
29
29
  check_dup_keys1(value_node, path + Array(newname))
30
30
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown-rfc2629
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.26
4
+ version: 1.7.28
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carsten Bormann
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-03-16 00:00:00.000000000 Z
10
+ date: 2025-04-05 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: kramdown