isodoc 3.2.3 → 3.2.4

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: 9f0e05f77735c813b7b9a87ffd569cd025d4f47397ca799f72b4853feb6122ef
4
- data.tar.gz: '01821bce42580bfd1d2119c505bfdd4ea8dbc2df0794a0c19d53ed2e2f004df4'
3
+ metadata.gz: 819d3c20ea4ccb0037115026969f618e21162b177380574c7d2c3be138ef6f69
4
+ data.tar.gz: cb207eec17fa2a44459809689955e60ac612d4db3d44f5c0ad3d91a30da084e2
5
5
  SHA512:
6
- metadata.gz: 49d7914e7011f2d681c3919bac3148ac6bef4a6050597cbbef8f78a60fda60c89137aefb3f6b8f54b25caa1feaf1a78bfa9ef62ea67c58161018730c4476fcf6
7
- data.tar.gz: e797d276719f0c36bba46a6409122f265cbff8bef922759f2d517ff4189ca0b1500674a63cf96337c953dd6f0c87ef6453a3c7d9819c1f85ebcbb4121f1e1bca
6
+ metadata.gz: 27592d4f55312126f518f475247fdb73125c24af3c1a1e47ed9dadfa9e47418c8b3656ddf8cee4aaa7584ba6852facb051bc6d34cce2b17c16f97cbd077fce7d
7
+ data.tar.gz: 190486f76b78338fd7078175141af00165ae0f6f540394ba00b34f35a398aa10f04b8107eeb95e3f60772892aa52a57a2894674a21350ee88eb4e1d413e95631
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  dir = init_dir(filename, debug)
15
15
  @filename = filename
16
16
  @output_dir = File.dirname(filename)
17
- @localdir = (@baseassetpath || filepath.parent.to_s) + "/"
17
+ @localdir = "#{@baseassetpath || filepath.parent.to_s}/"
18
18
  @sourcedir = @localdir
19
19
  @sourcefilename and
20
20
  @sourcedir = "#{Pathname.new(@sourcefilename).parent}/"
@@ -58,7 +58,7 @@ module IsoDoc
58
58
  end
59
59
 
60
60
  def docstatus(xml, _out)
61
- published_default(xml)
61
+ published = published_default(xml)
62
62
  s = xml.at(ns("//bibdata/status/stage#{NOLANG}")) or return
63
63
  s1 = xml.at(ns("//bibdata/status/stage#{currlang}")) || s
64
64
  set(:stage, status_print(s.text))
@@ -69,23 +69,23 @@ module IsoDoc
69
69
  set(:substage_display, i1)
70
70
  (i2 = xml.at(ns("//bibdata/status/iteration"))&.text) and
71
71
  set(:iteration, i2)
72
- unpublished(s.text) && set(:stageabbr, stage_abbr(s.text))
72
+ !published && set(:stageabbr, stage_abbr(s.text))
73
73
  end
74
74
 
75
75
  def published_default(xml)
76
76
  override = xml.at(ns("//semantic-metadata/stage-published"))&.text
77
77
  default = override || "true"
78
78
  ret = default == "false"
79
- s = xml.at(ns("//bibdata/status/stage#{NOLANG}"))
80
- override || !s or ret = unpublished(s.text)
81
79
  set(:unpublished, ret)
80
+ default == "true"
82
81
  end
83
82
 
84
83
  def stage_abbr(docstatus)
85
84
  status_print(docstatus).split(/ /).map { |s| s[0].upcase }.join
86
85
  end
87
86
 
88
- def unpublished(status)
87
+ # KILL
88
+ def unpublishedx(status)
89
89
  !status.casecmp("published").zero?
90
90
  end
91
91
 
@@ -49,16 +49,22 @@ module IsoDoc
49
49
  id
50
50
  end
51
51
 
52
+ def xml_to_string_skip_fn(node)
53
+ node1 = node.dup
54
+ node1.xpath(ns(".//fn")).each(&:remove)
55
+ to_xml(node1.children)
56
+ end
57
+
52
58
  def bracket_if_num(num)
53
59
  num.nil? and return nil
54
- num = to_xml(num.children).sub(/^\[/, "").sub(/\]$/, "")
60
+ num = xml_to_string_skip_fn(num).sub(/^\[/, "").sub(/\]$/, "")
55
61
  /^\d+$/.match?(num) and return "[#{num}]"
56
62
  num
57
63
  end
58
64
 
59
65
  def unbracket1(ident)
60
66
  ident.nil? and return nil
61
- ident.is_a?(String) or ident = to_xml(ident.children)
67
+ ident.is_a?(String) or ident = xml_to_string_skip_fn(ident)
62
68
  ident.sub(/^\[/, "").sub(/\]$/, "")
63
69
  end
64
70
 
@@ -1,3 +1,3 @@
1
1
  module IsoDoc
2
- VERSION = "3.2.3".freeze
2
+ VERSION = "3.2.4".freeze
3
3
  end
@@ -58,8 +58,15 @@ module IsoDoc
58
58
  ret["--param baseassetpath="] = @baseassetpath
59
59
  ret = ret.merge(@pdf_cmd_options)
60
60
  %w(--xsl-file --xsl-file-override).each do |x|
61
- ret[x] &&= Pathname.new(File.expand_path(ret[x])).to_s
62
- # .relative_path_from(File.dirname(@xsl)).to_s
61
+ if ret[x]
62
+ ret[x] = if File.absolute_path?(ret[x])
63
+ Pathname.new(ret[x]).to_s
64
+ else
65
+ Pathname.new(
66
+ File.expand_path(File.join(@baseassetpath, ret[x])),
67
+ ).to_s
68
+ end
69
+ end
63
70
  end
64
71
  if ret["--xsl-file"]
65
72
  @xsl = ret["--xsl-file"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isodoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-08-04 00:00:00.000000000 Z
11
+ date: 2025-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64